From f82cdfa043aaf1e1ad07d2934cd94d56668ed166 Mon Sep 17 00:00:00 2001 From: Bart Janssens Date: Tue, 12 Nov 2024 22:07:30 +0100 Subject: [PATCH] Integrate changes needed for OpenCV Issue https://github.com/JuliaInterop/CxxWrap.jl/issues/260 --- include/jlcxx/array.hpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/jlcxx/array.hpp b/include/jlcxx/array.hpp index fe758ac..059d703 100644 --- a/include/jlcxx/array.hpp +++ b/include/jlcxx/array.hpp @@ -252,6 +252,10 @@ class ArrayRef { return data()[i]; } + else if constexpr(std::is_same>::value && !std::is_same::value) + { + return *reinterpret_cast(&data()[i]); + } else { return *extract_pointer_nonull(data()[i]); @@ -263,6 +267,10 @@ class ArrayRef if constexpr(std::is_same::value) { return data()[i]; + } + else if constexpr(std::is_same>::value && !std::is_same::value) + { + return *reinterpret_cast(&data()[i]); } else {