Skip to content

Commit 4def6d8

Browse files
authored
fix for msvc17 (#112)
1 parent 0d8abef commit 4def6d8

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

bindings/SofaTypes/src/SofaPython3/SofaTypes/Binding_Vec.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -219,15 +219,8 @@ T addCross(T p)
219219
{
220220
p.def("cross", [](typename T::type& a, typename T::type& b)
221221
{
222-
if constexpr (T::type::spatial_dimensions == 2 || T::type::spatial_dimensions == 3)
223-
{
224-
return sofa::type::cross(a, b);
225-
}
226-
else
227-
{
228-
// can only call cross with vec2 or vec3
229-
return T();
230-
}
222+
static_assert(T::type::spatial_dimensions == 2 || T::type::spatial_dimensions == 3, "Cross product function can only be used with Vec2 and Vec3");
223+
return sofa::type::cross(a, b);
231224
});
232225
return p;
233226
}

0 commit comments

Comments
 (0)