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
This constructor (and presumably corresponding constructors from different sized vectors):
template <typename U>
GLM_FUNC_DECL explicit tvec2(
U const & x);
prevents users from implementing type conversions from other vector classes which are very useful. C++ prefers constructors over conversion operators and U will match anything even if the U type cannot be converted to float or double.
This bug has been fixed in GLM 0.9.5.branch for GLM 0.9.5.1 release.
The change will generate warnings in case if required conversions but the feature seems relevant.
This constructor (and presumably corresponding constructors from different sized vectors):
prevents users from implementing type conversions from other vector classes which are very useful. C++ prefers constructors over conversion operators and U will match anything even if the U type cannot be converted to float or double.
So, even if I have the following:
It will not be used even with
static_cast<glm::vec2>(my_vec())
I believe the desired behavior can be achieved with std::enable_if and std::is_convertible (at least for C++11 compilers)
The text was updated successfully, but these errors were encountered: