Closed kalmarek closed 4 years ago
@barche could you have a look at this? I got hit by it again:
jlcxx::ArrayRef<std::string> jlvec;
std::vector<std::string> vec(jlvec.begin(), jlvec.end());
results in
error: no match for ‘operator!=’
(operand types are ‘jlcxx::array_iterator_base<_jl_value_t*, std::__cxx11::basic_string<char> >’ and
‘jlcxx::array_iterator_base<_jl_value_t*, std::__cxx11::basic_string<char> >’)
82 | for (; __first != __last; ++__first, (void)++__cur)
again, changing https://github.com/JuliaInterop/libcxxwrap-julia/blob/43eb10052af3f25ad7f4efec7817f115e7b7f6b2/include/jlcxx/array.hpp#L371 to
template<typename L, typename R>
bool operator!=(const array_iterator_base<L,R>& l, const array_iterator_base<L,R>& r)
{
return r.ptr() != l.ptr();
}
fixes the issue
fixed by #33
a simple application of
std::copy
produces an error:
this is because https://github.com/JuliaInterop/libcxxwrap-julia/blob/3818cbe8615c41d7f1d9b557cb85e66953494cde/include/jlcxx/array.hpp#L305
templates always as
array_iterator_base<T,T>
; e.g. changing the definition ofoperator-
tofixes the above.
It seems that using
array_iterator_base<T,S>
seems a reasonable choice, but I don't really feel competent in C++. @barche could You have a look at those template parameters?