I’m continuing on my CxxWrap.jl journey… I would like to wrap a function that returns the complex type:
std::vector<std::tuple<int, int> >
.
A function that returns simply a tuple or a vector works fine. I can also get vectors of my own structures just fine, mapping to Julia structures. What do I need to make the vector of tuples work, though?
Here’s the example code I’m working with, the last one causes the erro message following. Sorry the syntax is not too elegant!
mod.method("apair", [](){
std::tuple<int, int> mm(222,123456);
return mm;
});
mod.method("alist", [](){
std::vector<int> mm={222,123456};
return mm;
});
mod.method("apairlist", [](){
std::tuple<int, int> a1(111,123);
std::tuple<int, int> a2(222,456);
std::vector<std::tuple<int, int> > mm={a1,a2};
return mm;
});
/home/user/src/libcxxwrap-julia/include/jlcxx/array.hpp:226:45: error: no matching function for call to ‘extract_pointer_nonull<std::tuple<int, int> >(jl_value_t*&)’
return *extract_pointer_nonull<ValueT>(data()[i]);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~