From 8b60ca8d0a180b25963e4d39b82fa76822d8ad0e Mon Sep 17 00:00:00 2001 From: Dave Abrahams Date: Wed, 7 Feb 2001 04:49:32 +0000 Subject: [PATCH] Factored if_true out into boost/detail/select_type.hpp [SVN r8991] --- include/boost/detail/numeric_traits.hpp | 26 +++++-------------------- 1 file changed, 5 insertions(+), 21 deletions(-) diff --git a/include/boost/detail/numeric_traits.hpp b/include/boost/detail/numeric_traits.hpp index 4444766..1a65520 100644 --- a/include/boost/detail/numeric_traits.hpp +++ b/include/boost/detail/numeric_traits.hpp @@ -49,11 +49,13 @@ // See http://www.boost.org for most recent version including documentation. // Revision History +// 06 Feb 2001 - Factored if_true out into boost/detail/select_type.hpp +// (David Abrahams) // 23 Jan 2001 - Fixed logic of difference_type selection, which was // completely wack. In the process, added digit_traits<> // to compute the number of digits in intmax_t even when -// not supplied by numeric_limits<>. -// 21 Jan 2001 - Created +// not supplied by numeric_limits<>. (David Abrahams) +// 21 Jan 2001 - Created (David Abrahams) #ifndef BOOST_NUMERIC_TRAITS_HPP_DWA20001901 # define BOOST_NUMERIC_TRAITS_HPP_DWA20001901 @@ -62,31 +64,13 @@ # include # include # include +# include # ifndef BOOST_NO_LIMITS # include # endif namespace boost { namespace detail { - // Template class if_true -- select among 2 types based on a bool constant expression - // Usage: - // typename if_true<(bool_const_expression)>::template then::type - template struct if_true; - - template <> - struct if_true - { - template - struct then { typedef T1 type; }; - }; - - template <> - struct if_true - { - template - struct then { typedef T2 type; }; - }; - // Template class is_signed -- determine whether a numeric type is signed // Requires that T is constructable from the literals -1 and 0. Compile-time // error results if that requirement is not met (and thus signedness is not