medfall

A super great game engine
Log | Files | Refs

commit b6ad979bf1b1d1931fb2675963e9a9c4bfc30914
parent 74e01d98b2d4a59d7f2921fbca99e3002f20b2f9
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat, 21 Oct 2017 10:50:04 +0300

min/max3

Diffstat:
intrinsics.h | 18++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/intrinsics.h b/intrinsics.h @@ -91,18 +91,28 @@ constexpr T min( T a, T b ) { } template< typename T > +constexpr T min( T a, T b, T c ) { + return min( min( a, b ), c ); +} + +template< typename T > +constexpr T min( T a, T b, T c, T d ) { + return min( min( min( a, b ), c ), d ); +} + +template< typename T > constexpr T max( T a, T b ) { return a > b ? a : b; } template< typename T > -constexpr T max( T a, T b, T c, T d ) { - return max( max( max( a, b ), c ), d ); +constexpr T max( T a, T b, T c ) { + return max( max( a, b ), c ); } template< typename T > -constexpr T min( T a, T b, T c, T d ) { - return min( min( min( a, b ), c ), d ); +constexpr T max( T a, T b, T c, T d ) { + return max( max( max( a, b ), c ), d ); } template< typename T >