Open kalmarek opened 5 years ago
Hi,
Sorry for the very late reply, completely missed this somehow. You could try to add an argument overload, using something like this before wrapping the functions:
@readmodule(libfoo, :register_foo)
@wraptypes
CxxWrap.argument_overloads(t::Type{Vector{T}}) where {T <: jl_elemType} = [Vector{jl_elemType}]
@wrapfunctions
Suppose that I have a CxxWrapped type
myType
, it producesmyTypeAllocated
andmyTypeRef
concrete types on the julia side; I'd like to construct a CxxWrapped type parametrized bymyType
(in the example below: an array ofmyType
s)This works fine for integers:
module._new_array([1,2,3])
produces apm_ArrayAllocated{Int64}
; however I can not callmodule._new_array([myType()])
since the argument is of typeVector{myTypeAllocated}
and notVector{myType}
as_new_array
expects. I could of course dom = MyType(); module._new_array(myType[m])
to force the abstract type on the arguments elements.Question: is it possible to make the declaration
register
_new_array(::Array{T}) where T<:jl_elemType
method (wherejl_elemType
is the appropriate CxxWrapped type?)