From a9f99c627e3af97436717ca9e9eeac3ef783d489 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sat, 13 Dec 2025 20:02:08 -0800 Subject: [PATCH] bx::saturateCast requries values to be integer or float. (#356) --- include/bx/inline/bx.inl | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/include/bx/inline/bx.inl b/include/bx/inline/bx.inl index 734b9a8..ab20841 100644 --- a/include/bx/inline/bx.inl +++ b/include/bx/inline/bx.inl @@ -172,6 +172,8 @@ namespace bx } template + requires (isInteger< Ty>() || isFloatingPoint< Ty>() ) + && (isInteger() || isFloatingPoint() ) inline constexpr Ty saturateCast(const FromT& _from) { if constexpr (isSame() ) @@ -225,7 +227,7 @@ namespace bx return true; } - *_out = saturateCast(_from); + *_out = static_cast(_from); return static_cast(*_out) == _from; }