You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to be able to express a comparison between two glm::vec3 types (aka. 3d vectors).
It's a struct with x,y,z members, and has appropriate overloads for operator==, operator-, etc.
Actual Behavior
I keep getting a compiler error:
boost/ut.hpp:1029:55: error: no match for ‘operator<’ (operand types are ‘glm::vec<3, float, glm::packed_highp>’ and ‘float’)
1029 | return math::abs_diff(get(lhs), get(rhs)) < get(epsilon);
Steps to Reproduce the Problem
This is the code that I would like to get working, because it would be cool to actually get a print out of the compared vectors when the comparison fails:
As you can see, I have defined the appropriate operator which should satisfy glm::vec3 < float and glm::vec3 < glm::vec3.
But this test cannot compile, sadly:
Hi, if this is still relevant to you, then review the error message. The problem is not the missing operator, but the fact that it tries to compare a vector and a scalar. Remember your Calculus lessons: The abs function is supposed to return a float.
Expected Behavior
I would like to be able to express a comparison between two
glm::vec3
types (aka. 3d vectors).It's a struct with x,y,z members, and has appropriate overloads for
operator==
,operator-
, etc.Actual Behavior
I keep getting a compiler error:
Steps to Reproduce the Problem
This is the code that I would like to get working, because it would be cool to actually get a print out of the compared vectors when the comparison fails:
As you can see, I have defined the appropriate operator which should satisfy
glm::vec3 < float
andglm::vec3 < glm::vec3
.But this test cannot compile, sadly:
Specifications
BOOST_UT_VERSION 1'1'9
Ubuntu 23.04
g++ 12.3.0
The text was updated successfully, but these errors were encountered: