1 // Boost integer/static_min_max.hpp header file ----------------------------//
\r
3 // (C) Copyright Daryle Walker 2001.
\r
4 // Distributed under the Boost Software License, Version 1.0. (See
\r
5 // accompanying file LICENSE_1_0.txt or copy at
\r
6 // http://www.boost.org/LICENSE_1_0.txt)
\r
8 // See http://www.boost.org for updates, documentation, and revision history.
\r
10 #ifndef BOOST_INTEGER_STATIC_MIN_MAX_HPP
\r
11 #define BOOST_INTEGER_STATIC_MIN_MAX_HPP
\r
13 #include <boost/integer_fwd.hpp> // self include
\r
18 // Compile-time extrema class declarations ---------------------------------//
\r
19 // Get the minimum or maximum of two values, signed or unsigned.
\r
21 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
\r
22 struct static_signed_min
\r
24 BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 > Value2) ? Value2 : Value1 );
\r
27 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
\r
28 struct static_signed_max
\r
30 BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 < Value2) ? Value2 : Value1 );
\r
33 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
\r
34 struct static_unsigned_min
\r
36 BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value
\r
37 = (Value1 > Value2) ? Value2 : Value1 );
\r
40 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
\r
41 struct static_unsigned_max
\r
43 BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value
\r
44 = (Value1 < Value2) ? Value2 : Value1 );
\r
48 } // namespace boost
\r
51 #endif // BOOST_INTEGER_STATIC_MIN_MAX_HPP
\r