diff --git a/shared/XrUtility/XrMath.h b/shared/XrUtility/XrMath.h index abf1f00..7cefd5a 100644 --- a/shared/XrUtility/XrMath.h +++ b/shared/XrUtility/XrMath.h @@ -53,9 +53,11 @@ namespace xr::math { NearFar NearFar; }; - // Type conversion between math types + // Type conversion between math types. + // If you get the error "attempting to reference a deleted function" then you need to implement + // xr::math::detail::implement_math_cast for types X and Y. See examples further down. template - constexpr const X& cast(const Y& value); + constexpr const X& cast(const Y& value) = delete; // Convert XR types to DX DirectX::XMVECTOR XM_CALLCONV LoadXrVector2(const XrVector2f& vector); @@ -105,13 +107,6 @@ namespace xr::math { } } // namespace detail -#ifdef _MSC_VER - template - constexpr const X& cast(const Y& value) { - static_assert(false, "Undefined cast from Y to type X"); - } -#endif - #define DEFINE_CAST(X, Y) \ template <> \ constexpr const X& cast(const Y& value) { \