From 2d57ed63c0e0c733059f8e437cb6f02779cf4f1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D1=80=D0=B0=D0=BD=D0=B8=D0=BC=D0=B8=D1=80=20=D0=9A?= =?UTF-8?q?=D0=B0=D1=80=D0=B0=D1=9F=D0=B8=D1=9B?= Date: Mon, 12 Sep 2022 19:13:31 -0700 Subject: [PATCH] Cleanup. --- include/bx/bx.h | 12 ++++++------ include/bx/inline/bx.inl | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/include/bx/bx.h b/include/bx/bx.h index 6c81996..fb032a5 100644 --- a/include/bx/bx.h +++ b/include/bx/bx.h @@ -87,27 +87,27 @@ namespace bx /// Returns minimum of two values. template - constexpr Ty min(const Ty& _a, const Ty& _b); + constexpr Ty min(const Ty& _a, const TypeIdentityType& _b); /// Returns maximum of two values. template - constexpr Ty max(const Ty& _a, const Ty& _b); + constexpr Ty max(const Ty& _a, const TypeIdentityType& _b); /// Returns minimum of three or more values. template - constexpr Ty min(const Ty& _a, const Ty& _b, const Args&... _args); + constexpr Ty min(const Ty& _a, const TypeIdentityType& _b, const Args&... _args); /// Returns maximum of three or more values. template - constexpr Ty max(const Ty& _a, const Ty& _b, const Args&... _args); + constexpr Ty max(const Ty& _a, const TypeIdentityType& _b, const Args&... _args); /// Returns middle of three or more values. template - constexpr Ty mid(const Ty& _a, const Ty& _b, const Args&... _args); + constexpr Ty mid(const Ty& _a, const TypeIdentityType& _b, const Args&... _args); /// Returns clamped value between min/max. template - constexpr Ty clamp(const Ty& _a, const Ty& _min, const Ty& _max); + constexpr Ty clamp(const Ty& _a, const TypeIdentityType& _min, const TypeIdentityType& _max); /// Returns true if value `_a` is power of 2. template diff --git a/include/bx/inline/bx.inl b/include/bx/inline/bx.inl index 72a2a4f..3c65185 100644 --- a/include/bx/inline/bx.inl +++ b/include/bx/inline/bx.inl @@ -106,37 +106,37 @@ namespace bx } template - inline constexpr Ty min(const Ty& _a, const Ty& _b) + inline constexpr Ty min(const Ty& _a, const TypeIdentityType& _b) { return _a < _b ? _a : _b; } template - inline constexpr Ty max(const Ty& _a, const Ty& _b) + inline constexpr Ty max(const Ty& _a, const TypeIdentityType& _b) { return _a > _b ? _a : _b; } template - inline constexpr Ty min(const Ty& _a, const Ty& _b, const Args&... _args) + inline constexpr Ty min(const Ty& _a, const TypeIdentityType& _b, const Args&... _args) { return min(min(_a, _b), _args...); } template - inline constexpr Ty max(const Ty& _a, const Ty& _b, const Args&... _args) + inline constexpr Ty max(const Ty& _a, const TypeIdentityType& _b, const Args&... _args) { return max(max(_a, _b), _args...); } template - inline constexpr Ty mid(const Ty& _a, const Ty& _b, const Args&... _args) + inline constexpr Ty mid(const Ty& _a, const TypeIdentityType& _b, const Args&... _args) { return max(min(_a, _b), min(max(_a, _b), _args...) ); } template - inline constexpr Ty clamp(const Ty& _a, const Ty& _min, const Ty& _max) + inline constexpr Ty clamp(const Ty& _a, const TypeIdentityType& _min, const TypeIdentityType& _max) { return max(min(_a, _max), _min); }