Skip to content

Commit 2ddb952

Browse files
committed
Fix for C++
1 parent a4392ed commit 2ddb952

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

include/binsparse/detail/cpp/array.hpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
#ifdef __cplusplus
44

5+
#include <string>
56
#include <type_traits>
67
#include <variant>
78

@@ -71,7 +72,7 @@ void bsp_array_read(bsp_array_t array, size_t index, T& value) {
7172
[&](auto* ptr) {
7273
using U = std::remove_pointer_t<decltype(ptr)>;
7374

74-
if constexpr (std::is_assignable_v<T, U>) {
75+
if constexpr (std::is_assignable_v<T&, U>) {
7576
value = ptr[index];
7677
}
7778
},
@@ -87,7 +88,7 @@ void bsp_array_write(bsp_array_t array, size_t index, U value) {
8788
[&](auto* ptr) {
8889
using T = std::remove_pointer_t<decltype(ptr)>;
8990

90-
if constexpr (std::is_assignable_v<T, U>) {
91+
if constexpr (std::is_assignable_v<T&, U>) {
9192
ptr[index] = value;
9293
}
9394
},
@@ -105,7 +106,7 @@ void bsp_array_awrite(bsp_array_t array_0, size_t index_0, bsp_array_t array_1,
105106
using T = std::remove_pointer_t<decltype(ptr_0)>;
106107
using U = std::remove_pointer_t<decltype(ptr_1)>;
107108

108-
if constexpr (std::is_assignable_v<T, U>) {
109+
if constexpr (std::is_assignable_v<T&, U>) {
109110
ptr_0[index_0] = ptr_1[index_1];
110111
}
111112
},

0 commit comments

Comments
 (0)