Skip to content

Releases: JuliaInterop/CxxWrap.jl

v0.9.0

29 Jan 17:57
v0.9.0
Compare
Choose a tag to compare

New features:

  • More robust handling of pointer, reference and value types, which are each distinct Julia types now. This can make writing Julia functions that operate on C++ objects more cumbersome, see the @cxxdereference macro for a way to simplify this.
  • Initial work to start wrapping the C++ standard library, currently with basic support for std::(w)string, std::vector and std::valarray

Breaking changes

Many breaking changes on both the Julia and C++ side:

  • No automatic conversion between Julia String and std::string, but StdString (which maps std::string) implements the Julia AbstractStringinterface.
  • No automatic dereference of const ref
  • ArrayRef no longer supports boxed values
  • Custom smart pointer: use jlcxx::add_smart_pointer<MySmartPointer>(module, "MySmartPointer")
  • IsMirroredType instead of IsImmutable and IsBits, added using map_type.
    By default, IsMirroredType is true for trivial standard layout types, so if you want to wrap these normally
    (i.e. you get an unexpected error Mirrored types (marked with IsMirroredType) can't be added using add_type, map them directly to a struct instead and use map_type) then you have to explicitly disable the mirroring for that type:
template<> struct IsMirroredType<Foo> : std::false_type { };
  • box C++ function takes an explicit template argument
  • Introduction of specific integer types, such as CxxBool, that map to the C++ equivalent (should be transparent except for template parameters)
  • Defining SuperType on the C++ side is now necessary for any kind of casting to base class, because the previous implementation was wrong in the case of multiple inheritance.
  • Use Ref(CxxPtr(x)) for pointer or reference to pointer
  • Use CxxPtr{MyData}(C_NULL) instead of nullptr(MyData)
  • Defining a C++ supertype in C++ must now be done using the jlcxx::julia_base_type<T>() function instead of jlcxx::julia_type<T>()

v0.8.2

28 Apr 21:43
Compare
Choose a tag to compare
Delete REQUIRE -- no longer needed

CMake fixes

18 Oct 19:58
Compare
Choose a tag to compare

Bump the libcxxwrap-julia version to incorporate CMake fixes.

Remove CppAny and drop Julia 0.7

13 Oct 19:51
Compare
Choose a tag to compare

This should only cause breakage for packages that manually introduced types deriving from CppAny on the Julia side.

Package manager changes

23 Aug 14:08
Compare
Choose a tag to compare
  • Bounds in REQUIRE
  • Remove Project.toml (issue #107)

Precompilation

20 Aug 21:26
Compare
Choose a tag to compare

Modules using CxxWrap now support precompilation. To make use of this, add an init function as follows:

module CppHello
  using CxxWrap
  @wrapmodule(joinpath("path/to/built/lib","libhello"))

  function __init__()
    @initcxx
  end
end

Update for Julia 1.0

11 Aug 16:25
Compare
Choose a tag to compare
v0.7.2

Update version to 0.7.2

Use optimized binaries

31 Jul 21:30
Compare
Choose a tag to compare

The previous release accidentally had debugging on for the C++ binaries, resulting in a much higher function call overhead. This release refers to the optimized libcxxwrap v0.3.1 binaries.

Julia 0.7 release

29 Jul 16:48
Compare
Choose a tag to compare

This release adds support for Julia v0.7 and ceases support for all previous Julia versions.

Breaking changes

  • JULIA_CPP_MODULE_BEGIN and JULIA_CPP_MODULE_END no longer exists, define a function with return type JLCXX_MODULE in the global namespace instead. By default, the Julia side expects this function to be named define_julia_module, but another name can be chosen and passed as a second argument to @wrapmodule.

  • wrap_modules is removed, replace wrap_modules(lib_file_path) with

    module Foo
       @wrapmodule(lib_file_path)
    end
  • export_symbols is removed, since all C++ modules are now wrapped in a corresponding module declared on the Julia side, so the regular Julia export
    statement can be used.

  • safe_cfunction is now a macro, just like cfunction became a macro in Julia

Improved std::complex support

23 May 20:51
Compare
Choose a tag to compare