Closed kalmarek closed 6 years ago
You should be able to define the type like this:
Module.add_type<jlcxx::Parametric<jlcxx::TypeVar<1>>>("pm_Set", jlcxx::julia_type("AbstractSet", "Base"))
The downside is that it will no longer inherit from CxxWrap.CppAny
then, but at this point that type is only used to determine the smart pointer type, so if you need smart pointers holding pm_Set
objects you can add this after the @wrapmodule
:
CxxWrap.smart_pointer_type(x::Type{T}) where {T <: pm_Set} = CxxWrap.ptrunion(x)
I should really try to find a way to make the CppAny
base type obsolete (maybe using traits), since it gets in the way in cases like these.
thanks!
I'm interfacing a C++ library which implements its own Set type I add the declaration as follows:
Is it possible to declare the created
Module.pm_Set{T}
as a subtype ofBase.AbstractSet
?in julia-0.7 most of the set functionality has been split into methods with
AbstractSet
s (29 of them) and implementation specific methods withSet
s (just 15). To makepm_Set
behave as juliaSets
do would require implementing only those 15.