CxxWrap.jl icon indicating copy to clipboard operation
CxxWrap.jl copied to clipboard

Passing a julia Set to C++ (std::set)

Open TransGirlCodes opened this issue 5 years ago • 1 comments

If I have a C++ function that accepts std::set<int64_t> as an argument, will CxxWrap it to accept a julia Set{Int} type, or do I need to do some intermediary work or use a CxxWrap type (like one does with ArrayRef)?

TransGirlCodes avatar Nov 18 '18 09:11 TransGirlCodes

No, and unlike the arrays types like Set are implemented completely in Julia, so the easiest way is to manipulate the set on the Julia side, maybe converting it to an array and passing that to a wrapper function that turns it back into a set.

It's probably a good idea to add some generic support for these kind of conversions in CxxWrap, though.

barche avatar Nov 19 '18 20:11 barche