Skip to content

Commit d4192fe

Browse files
committed
Integrate changes needed for OpenCV
Issue JuliaInterop/CxxWrap.jl#260
1 parent efbb555 commit d4192fe

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

include/jlcxx/array.hpp

+8
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,10 @@ class ArrayRef
252252
{
253253
return data()[i];
254254
}
255+
else if constexpr(std::is_same<julia_t, static_julia_type<ValueT>>::value && !std::is_same<julia_t, WrappedCppPtr>::value)
256+
{
257+
return *reinterpret_cast<ValueT*>(&data()[i]);
258+
}
255259
else
256260
{
257261
return *extract_pointer_nonull<ValueT>(data()[i]);
@@ -263,6 +267,10 @@ class ArrayRef
263267
if constexpr(std::is_same<julia_t, ValueT>::value)
264268
{
265269
return data()[i];
270+
}
271+
else if constexpr(std::is_same<julia_t, static_julia_type<ValueT>>::value && !std::is_same<julia_t, WrappedCppPtr>::value)
272+
{
273+
return *reinterpret_cast<ValueT*>(&data()[i]);
266274
}
267275
else
268276
{

0 commit comments

Comments
 (0)