Releases: JuliaInterop/CxxWrap.jl
v0.9.0
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
andstd::valarray
Breaking changes
Many breaking changes on both the Julia and C++ side:
- No automatic conversion between Julia
String
andstd::string
, butStdString
(which mapsstd::string
) implements the JuliaAbstractString
interface. - 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 ofIsImmutable
andIsBits
, 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 errorMirrored 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 ofnullptr(MyData)
- Defining a C++ supertype in C++ must now be done using the
jlcxx::julia_base_type<T>()
function instead ofjlcxx::julia_type<T>()
v0.8.2
Delete REQUIRE -- no longer needed
CMake fixes
Bump the libcxxwrap-julia version to incorporate CMake fixes.
Remove CppAny and drop Julia 0.7
This should only cause breakage for packages that manually introduced types deriving from CppAny
on the Julia side.
Package manager changes
- Bounds in REQUIRE
- Remove Project.toml (issue #107)
Precompilation
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
v0.7.2 Update version to 0.7.2
Use optimized binaries
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
This release adds support for Julia v0.7 and ceases support for all previous Julia versions.
Breaking changes
-
JULIA_CPP_MODULE_BEGIN
andJULIA_CPP_MODULE_END
no longer exists, define a function with return typeJLCXX_MODULE
in the global namespace instead. By default, the Julia side expects this function to be nameddefine_julia_module
, but another name can be chosen and passed as a second argument to@wrapmodule
. -
wrap_modules
is removed, replacewrap_modules(lib_file_path)
withmodule 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
Addresses issue #99