diff --git a/include/bx/bx.h b/include/bx/bx.h index 9706862..a45057d 100644 --- a/include/bx/bx.h +++ b/include/bx/bx.h @@ -227,7 +227,7 @@ namespace bx /// Performs `static_cast` of value `_from`, and if value doesn't fit result type `Ty` it clamps /// the value to `Ty` min/max. template - constexpr Ty saturateCast(const FromT& _from); + constexpr Ty saturateCast(FromT _from); /// Performs `static_cast` of value `_from`, and returns true if the value `_from` is /// representable as `Ty`. diff --git a/include/bx/inline/bx.inl b/include/bx/inline/bx.inl index ab20841..1bd971c 100644 --- a/include/bx/inline/bx.inl +++ b/include/bx/inline/bx.inl @@ -174,9 +174,9 @@ namespace bx template requires (isInteger< Ty>() || isFloatingPoint< Ty>() ) && (isInteger() || isFloatingPoint() ) - inline constexpr Ty saturateCast(const FromT& _from) + inline constexpr Ty saturateCast(FromT _from) { - if constexpr (isSame() ) + if constexpr (isSame, RemoveCvType >() ) { return _from; }