Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:38:24

0001 //  Boost integer/static_min_max.hpp header file  ----------------------------//
0002 
0003 //  (C) Copyright Daryle Walker 2001.
0004 //  Distributed under the Boost Software License, Version 1.0. (See
0005 //  accompanying file LICENSE_1_0.txt or copy at
0006 //  https://www.boost.org/LICENSE_1_0.txt)
0007 
0008 //  See https://www.boost.org for updates, documentation, and revision history. 
0009 
0010 #ifndef BOOST_INTEGER_STATIC_MIN_MAX_HPP
0011 #define BOOST_INTEGER_STATIC_MIN_MAX_HPP
0012 
0013 #include <boost/config.hpp>
0014 #include <boost/integer_fwd.hpp>  // self include
0015 
0016 namespace boost
0017 {
0018 
0019 //  Compile-time extrema class declarations  ---------------------------------//
0020 //  Get the minimum or maximum of two values, signed or unsigned.
0021 
0022 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
0023 struct static_signed_min
0024 {
0025     BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 > Value2) ? Value2 : Value1 );
0026 };
0027 
0028 template <static_min_max_signed_type Value1, static_min_max_signed_type Value2>
0029 struct static_signed_max
0030 {
0031     BOOST_STATIC_CONSTANT(static_min_max_signed_type, value = (Value1 < Value2) ? Value2 : Value1 );
0032 };
0033 
0034 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
0035 struct static_unsigned_min
0036 {
0037     BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value
0038      = (Value1 > Value2) ? Value2 : Value1 );
0039 };
0040 
0041 template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2>
0042 struct static_unsigned_max
0043 {
0044     BOOST_STATIC_CONSTANT(static_min_max_unsigned_type, value
0045      = (Value1 < Value2) ? Value2 : Value1 );
0046 };
0047 
0048 
0049 }  // namespace boost
0050 
0051 
0052 #endif  // BOOST_INTEGER_STATIC_MIN_MAX_HPP