Skip to content

Commit 3bc0137

Browse files
committed
Add explicit static_cast to bool in if constexpr.
1 parent 4bba737 commit 3bc0137

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bindings/Python/type_caster/matrix_type_caster.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ struct type_caster<plssvm::matrix<T, layout>> {
110110
const T *ptr = static_cast<T *>(buffer.ptr);
111111

112112
// check the memory layout of the Python Numpy array
113-
if constexpr (Flags & py::array::c_style) {
113+
if constexpr (static_cast<bool>(Flags & py::array::c_style)) {
114114
// the provided Python Numpy array has C style layout
115115
if constexpr (layout == plssvm::layout_type::aos) {
116116
// memory layout of Python Numpy array and PLSSVM matrix are the same -> can use memcpy to convert
@@ -130,7 +130,7 @@ struct type_caster<plssvm::matrix<T, layout>> {
130130
// unsupported PLSSVM matrix memory layout
131131
return false;
132132
}
133-
} else if constexpr (Flags & py::array::f_style) {
133+
} else if constexpr (static_cast<bool>(Flags & py::array::f_style)) {
134134
if constexpr (layout == plssvm::layout_type::aos) {
135135
// the memory layouts don't match -> must use loops to convert layouts
136136
#pragma omp parallel for collapse(2)

0 commit comments

Comments
 (0)