Chris@16: // Boost integer/static_min_max.hpp header file ----------------------------// Chris@16: Chris@16: // (C) Copyright Daryle Walker 2001. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: Chris@16: #ifndef BOOST_INTEGER_STATIC_MIN_MAX_HPP Chris@16: #define BOOST_INTEGER_STATIC_MIN_MAX_HPP Chris@16: Chris@16: #include // self include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: Chris@16: // Compile-time extrema class declarations ---------------------------------// Chris@16: // Get the minimum or maximum of two values, signed or unsigned. Chris@16: Chris@16: template Chris@16: struct static_signed_min Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 > Value2) ? Value2 : Value1 ); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct static_signed_max Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 < Value2) ? Value2 : Value1 ); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct static_unsigned_min Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value Chris@16: = (Value1 > Value2) ? Value2 : Value1 ); Chris@16: }; Chris@16: Chris@16: template Chris@16: struct static_unsigned_max Chris@16: { Chris@16: BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value Chris@16: = (Value1 < Value2) ? Value2 : Value1 ); Chris@16: }; Chris@16: Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: Chris@16: #endif // BOOST_INTEGER_STATIC_MIN_MAX_HPP