From 00da69bd77782a0a897a0ace0e4085d35910bd2f Mon Sep 17 00:00:00 2001 From: bugaevskiy Date: Sun, 7 Aug 2022 21:20:06 +0300 Subject: Reimport boost/numeric_conversion as a separate project --- contrib/restricted/boost/CMakeLists.txt | 1 + contrib/restricted/boost/boost/cast.hpp | 20 - .../boost/boost/numeric/conversion/bounds.hpp | 24 - .../boost/boost/numeric/conversion/cast.hpp | 61 - .../boost/numeric/conversion/conversion_traits.hpp | 32 - .../boost/boost/numeric/conversion/converter.hpp | 68 - .../numeric/conversion/converter_policies.hpp | 194 --- .../boost/numeric/conversion/detail/bounds.hpp | 58 - .../conversion/detail/conversion_traits.hpp | 97 -- .../boost/numeric/conversion/detail/converter.hpp | 593 ------- .../conversion/detail/int_float_mixture.hpp | 72 - .../numeric/conversion/detail/is_subranged.hpp | 234 --- .../boost/boost/numeric/conversion/detail/meta.hpp | 120 -- .../conversion/detail/numeric_cast_traits.hpp | 138 -- .../numeric/conversion/detail/old_numeric_cast.hpp | 308 ---- .../preprocessed/numeric_cast_traits_common.hpp | 1741 -------------------- .../preprocessed/numeric_cast_traits_long_long.hpp | 347 ---- .../numeric/conversion/detail/sign_mixture.hpp | 72 - .../conversion/detail/udt_builtin_mixture.hpp | 69 - .../boost/numeric/conversion/int_float_mixture.hpp | 30 - .../numeric/conversion/int_float_mixture_enum.hpp | 29 - .../boost/numeric/conversion/is_subranged.hpp | 27 - .../numeric/conversion/numeric_cast_traits.hpp | 31 - .../boost/numeric/conversion/sign_mixture.hpp | 30 - .../boost/numeric/conversion/sign_mixture_enum.hpp | 29 - .../numeric/conversion/udt_builtin_mixture.hpp | 28 - .../conversion/udt_builtin_mixture_enum.hpp | 26 - .../boost/numeric_conversion/CMakeLists.txt | 24 + .../restricted/boost/numeric_conversion/README.md | 8 + .../numeric_conversion/include/boost/cast.hpp | 20 + .../include/boost/numeric/conversion/bounds.hpp | 24 + .../include/boost/numeric/conversion/cast.hpp | 61 + .../boost/numeric/conversion/conversion_traits.hpp | 32 + .../include/boost/numeric/conversion/converter.hpp | 68 + .../numeric/conversion/converter_policies.hpp | 194 +++ .../boost/numeric/conversion/detail/bounds.hpp | 58 + .../conversion/detail/conversion_traits.hpp | 97 ++ .../boost/numeric/conversion/detail/converter.hpp | 593 +++++++ .../conversion/detail/int_float_mixture.hpp | 72 + .../numeric/conversion/detail/is_subranged.hpp | 234 +++ .../boost/numeric/conversion/detail/meta.hpp | 120 ++ .../conversion/detail/numeric_cast_traits.hpp | 138 ++ .../numeric/conversion/detail/old_numeric_cast.hpp | 308 ++++ .../preprocessed/numeric_cast_traits_common.hpp | 1741 ++++++++++++++++++++ .../preprocessed/numeric_cast_traits_long_long.hpp | 347 ++++ .../numeric/conversion/detail/sign_mixture.hpp | 72 + .../conversion/detail/udt_builtin_mixture.hpp | 69 + .../numeric/conversion/int_float_mixture_enum.hpp | 29 + .../numeric/conversion/numeric_cast_traits.hpp | 31 + .../boost/numeric/conversion/sign_mixture_enum.hpp | 29 + .../conversion/udt_builtin_mixture_enum.hpp | 26 + 51 files changed, 4396 insertions(+), 4478 deletions(-) delete mode 100644 contrib/restricted/boost/boost/cast.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/bounds.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/cast.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/conversion_traits.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/converter.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/converter_policies.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/bounds.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/conversion_traits.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/converter.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/int_float_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/is_subranged.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/meta.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/sign_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/int_float_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/int_float_mixture_enum.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/is_subranged.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/numeric_cast_traits.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/sign_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/sign_mixture_enum.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture.hpp delete mode 100644 contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/CMakeLists.txt create mode 100644 contrib/restricted/boost/numeric_conversion/README.md create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/cast.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/bounds.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/cast.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/conversion_traits.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter_policies.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/bounds.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/conversion_traits.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/converter.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/int_float_mixture.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/is_subranged.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/meta.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/numeric_cast_traits.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/old_numeric_cast.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/sign_mixture.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/int_float_mixture_enum.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/numeric_cast_traits.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/sign_mixture_enum.hpp create mode 100644 contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/udt_builtin_mixture_enum.hpp (limited to 'contrib') diff --git a/contrib/restricted/boost/CMakeLists.txt b/contrib/restricted/boost/CMakeLists.txt index 89af20b0004..c688fd08910 100644 --- a/contrib/restricted/boost/CMakeLists.txt +++ b/contrib/restricted/boost/CMakeLists.txt @@ -33,6 +33,7 @@ target_link_libraries(contrib-restricted-boost INTERFACE restricted-boost-move restricted-boost-mp11 restricted-boost-mpl + restricted-boost-numeric_conversion restricted-boost-optional restricted-boost-polygon restricted-boost-predef diff --git a/contrib/restricted/boost/boost/cast.hpp b/contrib/restricted/boost/boost/cast.hpp deleted file mode 100644 index ab452bdf163..00000000000 --- a/contrib/restricted/boost/boost/cast.hpp +++ /dev/null @@ -1,20 +0,0 @@ -// boost cast.hpp header file -// -// (C) Copyright Antony Polukhin 2014. -// -// Distributed under the Boost -// Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -// -// See http://www.boost.org/libs/conversion for Documentation. - -// This is a DEPRECATED header file! -// Use or instead - -#ifndef BOOST_CAST_HPP -#define BOOST_CAST_HPP - -# include -# include - -#endif // BOOST_CAST_HPP diff --git a/contrib/restricted/boost/boost/numeric/conversion/bounds.hpp b/contrib/restricted/boost/boost/numeric/conversion/bounds.hpp deleted file mode 100644 index e4c7c7deee8..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/bounds.hpp +++ /dev/null @@ -1,24 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/bounds.hpp" - -namespace boost { namespace numeric -{ - -template -struct bounds : boundsdetail::get_impl::type -{} ; - -} } // namespace boost::numeric - -#endif diff --git a/contrib/restricted/boost/boost/numeric/conversion/cast.hpp b/contrib/restricted/boost/boost/numeric/conversion/cast.hpp deleted file mode 100644 index 61286c13119..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/cast.hpp +++ /dev/null @@ -1,61 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -// -// Revision History -// -// 19 Nov 2001 Syntatic changes as suggested by Darin Adler (Fernando Cacciola) -// 08 Nov 2001 Fixes to accommodate MSVC (Fernando Cacciola) -// 04 Nov 2001 Fixes to accommodate gcc2.92 (Fernando Cacciola) -// 30 Oct 2001 Some fixes suggested by Daryle Walker (Fernando Cacciola) -// 25 Oct 2001 Initial boostification (Fernando Cacciola) -// 23 Jan 2004 Inital add to cvs (post review)s -// 22 Jun 2011 Added support for specializing cast policies via numeric_cast_traits (Brandon Kohn). -// -#ifndef BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP -#define BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP - -#include - -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) - -# include - -#else - -#include -#include -#include - -namespace boost -{ - template - inline Target numeric_cast( Source arg ) - { - typedef numeric::conversion_traits conv_traits; - typedef numeric::numeric_cast_traits cast_traits; - typedef boost::numeric::converter - < - Target, - Source, - conv_traits, - typename cast_traits::overflow_policy, - typename cast_traits::rounding_policy, - boost::numeric::raw_converter< conv_traits >, - typename cast_traits::range_checking_policy - > converter; - return converter::convert(arg); - } - - using numeric::bad_numeric_cast; -} // namespace boost - -#endif - -#endif diff --git a/contrib/restricted/boost/boost/numeric/conversion/conversion_traits.hpp b/contrib/restricted/boost/boost/numeric/conversion/conversion_traits.hpp deleted file mode 100644 index 23e0eb8c9ab..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/conversion_traits.hpp +++ /dev/null @@ -1,32 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/conversion_traits.hpp" -#include "boost/detail/workaround.hpp" -#include "boost/config.hpp" - -namespace boost { namespace numeric -{ - -template -struct conversion_traits - : convdetail::get_conversion_traits::type -{ -} ; - -} } // namespace boost::numeric - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/converter.hpp b/contrib/restricted/boost/boost/numeric/conversion/converter.hpp deleted file mode 100644 index 331caddea54..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/converter.hpp +++ /dev/null @@ -1,68 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/conversion_traits.hpp" -#include "boost/numeric/conversion/converter_policies.hpp" - -#include "boost/numeric/conversion/detail/converter.hpp" - -namespace boost { namespace numeric -{ - -template, - class OverflowHandler = def_overflow_handler, - class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type> , - class RawConverter = raw_converter, - class UserRangeChecker = UseInternalRangeChecker - > -struct converter : convdetail::get_converter_impl::type -{ - typedef Traits traits ; - - typedef typename Traits::argument_type argument_type ; - typedef typename Traits::result_type result_type ; - - result_type operator() ( argument_type s ) const { return this->convert(s) ; } -} ; - - - -template , - class UserRangeChecker = UseInternalRangeChecker - > -struct make_converter_from -{ - template, - class RawConverter = raw_converter - > - struct to - { - typedef converter type ; - } ; - -} ; - -} } // namespace boost::numeric - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/converter_policies.hpp b/contrib/restricted/boost/boost/numeric/conversion/converter_policies.hpp deleted file mode 100644 index 57a255d451c..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/converter_policies.hpp +++ /dev/null @@ -1,194 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP - -#include // for std::bad_cast - -#include // for std::floor and std::ceil -#include - -#include - -#include "boost/type_traits/is_arithmetic.hpp" - -#include "boost/mpl/if.hpp" -#include "boost/mpl/integral_c.hpp" - -namespace boost { namespace numeric -{ - -template -struct Trunc -{ - typedef S source_type ; - - typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; - - static source_type nearbyint ( argument_type s ) - { -#if !defined(BOOST_NO_STDC_NAMESPACE) - using std::floor ; - using std::ceil ; -#endif - - return s < static_cast(0) ? ceil(s) : floor(s) ; - } - - typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ; -} ; - - - -template -struct Floor -{ - typedef S source_type ; - - typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; - - static source_type nearbyint ( argument_type s ) - { -#if !defined(BOOST_NO_STDC_NAMESPACE) - using std::floor ; -#endif - - return floor(s) ; - } - - typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ; -} ; - -template -struct Ceil -{ - typedef S source_type ; - - typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; - - static source_type nearbyint ( argument_type s ) - { -#if !defined(BOOST_NO_STDC_NAMESPACE) - using std::ceil ; -#endif - - return ceil(s) ; - } - - typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ; -} ; - -template -struct RoundEven -{ - typedef S source_type ; - - typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; - - static source_type nearbyint ( argument_type s ) - { - // Algorithm contributed by Guillaume Melquiond - -#if !defined(BOOST_NO_STDC_NAMESPACE) - using std::floor ; - using std::ceil ; -#endif - - // only works inside the range not at the boundaries - S prev = floor(s); - S next = ceil(s); - - S rt = (s - prev) - (next - s); // remainder type - - S const zero(0.0); - S const two(2.0); - - if ( rt < zero ) - return prev; - else if ( rt > zero ) - return next; - else - { - bool is_prev_even = two * floor(prev / two) == prev ; - return ( is_prev_even ? prev : next ) ; - } - } - - typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ; -} ; - - -enum range_check_result -{ - cInRange = 0 , - cNegOverflow = 1 , - cPosOverflow = 2 -} ; - -class bad_numeric_cast : public std::bad_cast -{ - public: - - virtual const char * what() const noexcept - { return "bad numeric conversion: overflow"; } -}; - -class negative_overflow : public bad_numeric_cast -{ - public: - - virtual const char * what() const noexcept - { return "bad numeric conversion: negative overflow"; } -}; -class positive_overflow : public bad_numeric_cast -{ - public: - - virtual const char * what() const noexcept - { return "bad numeric conversion: positive overflow"; } -}; - -struct def_overflow_handler -{ - void operator() ( range_check_result r ) // - { -#ifndef BOOST_NO_EXCEPTIONS - if ( r == cNegOverflow ) - throw negative_overflow() ; - else if ( r == cPosOverflow ) - throw positive_overflow() ; -#else - if ( r == cNegOverflow ) - ::boost::throw_exception(negative_overflow()) ; - else if ( r == cPosOverflow ) - ::boost::throw_exception(positive_overflow()) ; -#endif - } -} ; - -struct silent_overflow_handler -{ - void operator() ( range_check_result ) {} // noexcept -} ; - -template -struct raw_converter -{ - typedef typename Traits::result_type result_type ; - typedef typename Traits::argument_type argument_type ; - - static result_type low_level_convert ( argument_type s ) { return static_cast(s) ; } -} ; - -struct UseInternalRangeChecker {} ; - -} } // namespace boost::numeric - -#endif diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/bounds.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/bounds.hpp deleted file mode 100644 index 67342b8e570..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/bounds.hpp +++ /dev/null @@ -1,58 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP - -#include "boost/limits.hpp" -#include "boost/config.hpp" -#include "boost/mpl/if.hpp" - -namespace boost { namespace numeric { namespace boundsdetail -{ - template - class Integral - { - typedef std::numeric_limits limits ; - - public : - - static N lowest () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); } - static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); } - static N smallest() { return static_cast(1); } - } ; - - template - class Float - { - typedef std::numeric_limits limits ; - - public : - - static N lowest () { return static_cast(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; } - static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); } - static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); } - } ; - - template - struct get_impl - { - typedef mpl::bool_< ::std::numeric_limits::is_integer > is_int ; - - typedef Integral impl_int ; - typedef Float impl_float ; - - typedef typename mpl::if_::type type ; - } ; - -} } } // namespace boost::numeric::boundsdetail. - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/conversion_traits.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/conversion_traits.hpp deleted file mode 100644 index ed25349c671..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/conversion_traits.hpp +++ /dev/null @@ -1,97 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP - -#include "boost/type_traits/is_arithmetic.hpp" -#include "boost/type_traits/is_same.hpp" -#include "boost/type_traits/remove_cv.hpp" - -#include "boost/numeric/conversion/detail/meta.hpp" -#include "boost/numeric/conversion/detail/int_float_mixture.hpp" -#include "boost/numeric/conversion/detail/sign_mixture.hpp" -#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp" -#include "boost/numeric/conversion/detail/is_subranged.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - //------------------------------------------------------------------- - // Implementation of the Conversion Traits for T != S - // - // This is a VISIBLE base class of the user-level conversion_traits<> class. - //------------------------------------------------------------------- - template - struct non_trivial_traits_impl - { - typedef typename get_int_float_mixture ::type int_float_mixture ; - typedef typename get_sign_mixture ::type sign_mixture ; - typedef typename get_udt_builtin_mixture ::type udt_builtin_mixture ; - - typedef typename get_is_subranged::type subranged ; - - typedef mpl::false_ trivial ; - - typedef T target_type ; - typedef S source_type ; - typedef T result_type ; - - typedef typename mpl::if_< is_arithmetic, S, S const&>::type argument_type ; - - typedef typename mpl::if_::type supertype ; - typedef typename mpl::if_::type subtype ; - } ; - - //------------------------------------------------------------------- - // Implementation of the Conversion Traits for T == S - // - // This is a VISIBLE base class of the user-level conversion_traits<> class. - //------------------------------------------------------------------- - template - struct trivial_traits_impl - { - typedef typename get_int_float_mixture ::type int_float_mixture ; - typedef typename get_sign_mixture ::type sign_mixture ; - typedef typename get_udt_builtin_mixture::type udt_builtin_mixture ; - - typedef mpl::false_ subranged ; - typedef mpl::true_ trivial ; - - typedef N target_type ; - typedef N source_type ; - typedef N const& result_type ; - typedef N const& argument_type ; - - typedef N supertype ; - typedef N subtype ; - - } ; - - //------------------------------------------------------------------- - // Top level implementation selector. - //------------------------------------------------------------------- - template - struct get_conversion_traits - { - typedef typename remove_cv::type target_type ; - typedef typename remove_cv::type source_type ; - - typedef typename is_same::type is_trivial ; - - typedef trivial_traits_impl trivial_imp ; - typedef non_trivial_traits_impl non_trivial_imp ; - - typedef typename mpl::if_::type type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/converter.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/converter.hpp deleted file mode 100644 index f7bf7b4436a..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/converter.hpp +++ /dev/null @@ -1,593 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP - -#include - -#include "boost/numeric/conversion/detail/meta.hpp" -#include "boost/numeric/conversion/detail/conversion_traits.hpp" -#include "boost/numeric/conversion/bounds.hpp" - -#include "boost/type_traits/is_same.hpp" - -#include "boost/mpl/integral_c.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - // Integral Constants representing rounding modes - typedef mpl::integral_c round2zero_c ; - typedef mpl::integral_c round2nearest_c ; - typedef mpl::integral_c round2inf_c ; - typedef mpl::integral_c round2neg_inf_c ; - - // Metafunction: - // - // for_round_style::type - // - // {RoundStyle} Integral Constant specifying a round style as declared above. - // {RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf} arbitrary types. - // - // Selects one of the 4 types according to the value of RoundStyle. - // - template - struct for_round_style - { - typedef ct_switch4 selector ; - - typedef typename selector::type type ; - } ; - - - - - - - - - - - - - - - - - - -//-------------------------------------------------------------------------- -// Range Checking Logic. -// -// The range checking logic is built up by combining 1 or 2 predicates. -// Each predicate is encapsulated in a template class and exposes -// the static member function 'apply'. -// -//-------------------------------------------------------------------------- - - - // Because a particular logic can combine either 1 or two predicates, the following - // tags are used to allow the predicate applier to receive 2 preds, but optimize away - // one of them if it is 'non-applicable' - struct non_applicable { typedef mpl::false_ do_apply ; } ; - struct applicable { typedef mpl::true_ do_apply ; } ; - - - //-------------------------------------------------------------------------- - // - // Range Checking Logic implementations. - // - // The following classes, collectivelly named 'Predicates', are instantiated within - // the corresponding range checkers. - // Their static member function 'apply' is called to perform the actual range checking logic. - //-------------------------------------------------------------------------- - - // s < Lowest(T) ? cNegOverflow : cInRange - // - template - struct LT_LoT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s < static_cast(bounds::lowest()) ? cNegOverflow : cInRange ; - } - } ; - - // s < 0 ? cNegOverflow : cInRange - // - template - struct LT_Zero : applicable - { - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s < static_cast(0) ? cNegOverflow : cInRange ; - } - } ; - - // s <= Lowest(T)-1 ? cNegOverflow : cInRange - // - template - struct LE_PrevLoT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s <= static_cast(bounds::lowest()) - static_cast(1.0) - ? cNegOverflow : cInRange ; - } - } ; - - // s < Lowest(T)-0.5 ? cNegOverflow : cInRange - // - template - struct LT_HalfPrevLoT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s < static_cast(bounds::lowest()) - static_cast(0.5) - ? cNegOverflow : cInRange ; - } - } ; - - // s > Highest(T) ? cPosOverflow : cInRange - // - template - struct GT_HiT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s > static_cast(bounds::highest()) - ? cPosOverflow : cInRange ; - } - } ; - - // s >= Lowest(T) + 1 ? cPosOverflow : cInRange - // - template - struct GE_SuccHiT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s >= static_cast(bounds::highest()) + static_cast(1.0) - ? cPosOverflow : cInRange ; - } - } ; - - // s >= Lowest(T) + 0.5 ? cPosgOverflow : cInRange - // - template - struct GT_HalfSuccHiT : applicable - { - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - typedef typename Traits::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - return s >= static_cast(bounds::highest()) + static_cast(0.5) - ? cPosOverflow : cInRange ; - } - } ; - - - //-------------------------------------------------------------------------- - // - // Predicate Combiner. - // - // This helper classes are used to possibly combine the range checking logic - // individually performed by the predicates - // - //-------------------------------------------------------------------------- - - - // Applies both predicates: first 'PredA', and if it equals 'cInRange', 'PredB' - template - struct applyBoth - { - typedef typename PredA::argument_type argument_type ; - - static range_check_result apply ( argument_type s ) - { - range_check_result r = PredA::apply(s) ; - if ( r == cInRange ) - r = PredB::apply(s); - return r ; - } - } ; - - template - struct combine - { - typedef applyBoth Both ; - typedef void NNone ; // 'None' is defined as a macro in (/usr/X11R6/include/X11/X.h) - - typedef typename PredA::do_apply do_applyA ; - typedef typename PredB::do_apply do_applyB ; - - typedef typename for_both::type type ; - } ; - - - - - - - - - - - - -//-------------------------------------------------------------------------- -// Range Checker classes. -// -// The following classes are VISIBLE base classes of the user-level converter<> class. -// They supply the optimized 'out_of_range()' and 'validate_range()' static member functions -// visible in the user interface. -// -//-------------------------------------------------------------------------- - - // Dummy range checker. - template - struct dummy_range_checker - { - typedef typename Traits::argument_type argument_type ; - - static range_check_result out_of_range ( argument_type ) { return cInRange ; } - static void validate_range ( argument_type ) {} - } ; - - // Generic range checker. - // - // All the range checking logic for all possible combinations of source and target - // can be arranged in terms of one or two predicates, which test overflow on both neg/pos 'sides' - // of the ranges. - // - // These predicates are given here as IsNegOverflow and IsPosOverflow. - // - template - struct generic_range_checker - { - typedef OverflowHandler overflow_handler ; - - typedef typename Traits::argument_type argument_type ; - - static range_check_result out_of_range ( argument_type s ) - { - typedef typename combine::type Predicate ; - - return Predicate::apply(s); - } - - static void validate_range ( argument_type s ) - { OverflowHandler()( out_of_range(s) ) ; } - } ; - - - -//-------------------------------------------------------------------------- -// -// Selectors for the optimized Range Checker class. -// -//-------------------------------------------------------------------------- - - template - struct GetRC_Sig2Sig_or_Unsig2Unsig - { - typedef dummy_range_checker Dummy ; - - typedef LT_LoT Pred1 ; - typedef GT_HiT Pred2 ; - - typedef generic_range_checker Normal ; - - typedef typename Traits::subranged subranged ; - - typedef typename mpl::if_::type type ; - } ; - - template - struct GetRC_Sig2Unsig - { - typedef LT_Zero Pred1 ; - typedef GT_HiT Pred2 ; - - typedef generic_range_checker ChoiceA ; - - typedef generic_range_checker ChoiceB ; - - typedef typename Traits::target_type T ; - typedef typename Traits::source_type S ; - - typedef typename subranged_Unsig2Sig::type oposite_subranged ; - - typedef typename mpl::not_::type positively_subranged ; - - typedef typename mpl::if_::type type ; - } ; - - template - struct GetRC_Unsig2Sig - { - typedef GT_HiT Pred1 ; - - typedef generic_range_checker type ; - } ; - - template - struct GetRC_Int2Int - { - typedef GetRC_Sig2Sig_or_Unsig2Unsig Sig2SigQ ; - typedef GetRC_Sig2Unsig Sig2UnsigQ ; - typedef GetRC_Unsig2Sig Unsig2SigQ ; - typedef Sig2SigQ Unsig2UnsigQ ; - - typedef typename Traits::sign_mixture sign_mixture ; - - typedef typename - for_sign_mixture::type - selector ; - - typedef typename selector::type type ; - } ; - - template - struct GetRC_Int2Float - { - typedef dummy_range_checker type ; - } ; - - template - struct GetRC_Float2Int - { - typedef LE_PrevLoT Pred1 ; - typedef GE_SuccHiT Pred2 ; - typedef LT_HalfPrevLoT Pred3 ; - typedef GT_HalfSuccHiT Pred4 ; - typedef GT_HiT Pred5 ; - typedef LT_LoT Pred6 ; - - typedef generic_range_checker ToZero ; - typedef generic_range_checker ToNearest ; - typedef generic_range_checker ToInf ; - typedef generic_range_checker ToNegInf ; - - typedef typename Float2IntRounder::round_style round_style ; - - typedef typename for_round_style::type type ; - } ; - - template - struct GetRC_Float2Float - { - typedef dummy_range_checker Dummy ; - - typedef LT_LoT Pred1 ; - typedef GT_HiT Pred2 ; - - typedef generic_range_checker Normal ; - - typedef typename Traits::subranged subranged ; - - typedef typename mpl::if_::type type ; - } ; - - template - struct GetRC_BuiltIn2BuiltIn - { - typedef GetRC_Int2Int Int2IntQ ; - typedef GetRC_Int2Float Int2FloatQ ; - typedef GetRC_Float2Int Float2IntQ ; - typedef GetRC_Float2Float Float2FloatQ ; - - typedef typename Traits::int_float_mixture int_float_mixture ; - - typedef typename for_int_float_mixture::type selector ; - - typedef typename selector::type type ; - } ; - - template - struct GetRC - { - typedef GetRC_BuiltIn2BuiltIn BuiltIn2BuiltInQ ; - - typedef dummy_range_checker Dummy ; - - typedef mpl::identity DummyQ ; - - typedef typename Traits::udt_builtin_mixture udt_builtin_mixture ; - - typedef typename for_udt_builtin_mixture::type selector ; - - typedef typename selector::type type ; - } ; - - - - -//-------------------------------------------------------------------------- -// Converter classes. -// -// The following classes are VISIBLE base classes of the user-level converter<> class. -// They supply the optimized 'nearbyint()' and 'convert()' static member functions -// visible in the user interface. -// -//-------------------------------------------------------------------------- - - // - // Trivial Converter : used when (cv-unqualified) T == (cv-unqualified) S - // - template - struct trivial_converter_impl : public dummy_range_checker - { - typedef Traits traits ; - - typedef typename Traits::source_type source_type ; - typedef typename Traits::argument_type argument_type ; - typedef typename Traits::result_type result_type ; - - static result_type low_level_convert ( argument_type s ) { return s ; } - static source_type nearbyint ( argument_type s ) { return s ; } - static result_type convert ( argument_type s ) { return s ; } - } ; - - - // - // Rounding Converter : used for float to integral conversions. - // - template - struct rounding_converter : public RangeChecker - ,public Float2IntRounder - ,public RawConverter - { - typedef RangeChecker RangeCheckerBase ; - typedef Float2IntRounder Float2IntRounderBase ; - typedef RawConverter RawConverterBase ; - - typedef Traits traits ; - - typedef typename Traits::source_type source_type ; - typedef typename Traits::argument_type argument_type ; - typedef typename Traits::result_type result_type ; - - static result_type convert ( argument_type s ) - { - RangeCheckerBase::validate_range(s); - source_type s1 = Float2IntRounderBase::nearbyint(s); - return RawConverterBase::low_level_convert(s1); - } - } ; - - - // - // Non-Rounding Converter : used for all other conversions. - // - template - struct non_rounding_converter : public RangeChecker - ,public RawConverter - { - typedef RangeChecker RangeCheckerBase ; - typedef RawConverter RawConverterBase ; - - typedef Traits traits ; - - typedef typename Traits::source_type source_type ; - typedef typename Traits::argument_type argument_type ; - typedef typename Traits::result_type result_type ; - - static source_type nearbyint ( argument_type s ) { return s ; } - - static result_type convert ( argument_type s ) - { - RangeCheckerBase::validate_range(s); - return RawConverterBase::low_level_convert(s); - } - } ; - - - - -//-------------------------------------------------------------------------- -// -// Selectors for the optimized Converter class. -// -//-------------------------------------------------------------------------- - - template - struct get_non_trivial_converter - { - typedef GetRC InternalRangeCheckerQ ; - - typedef is_same use_internal_RC ; - - typedef mpl::identity UserRangeCheckerQ ; - - typedef typename - mpl::eval_if::type - RangeChecker ; - - typedef non_rounding_converter NonRounding ; - typedef rounding_converter Rounding ; - - typedef mpl::identity NonRoundingQ ; - typedef mpl::identity RoundingQ ; - - typedef typename Traits::int_float_mixture int_float_mixture ; - - typedef typename - for_int_float_mixture::type - selector ; - - typedef typename selector::type type ; - } ; - - template< class Traits - ,class OverflowHandler - ,class Float2IntRounder - ,class RawConverter - ,class UserRangeChecker - > - struct get_converter_impl - { -#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x0561 ) ) - // bcc55 prefers sometimes template parameters to be explicit local types. - // (notice that is is illegal to reuse the names like this) - typedef Traits Traits ; - typedef OverflowHandler OverflowHandler ; - typedef Float2IntRounder Float2IntRounder ; - typedef RawConverter RawConverter ; - typedef UserRangeChecker UserRangeChecker ; -#endif - - typedef trivial_converter_impl Trivial ; - typedef mpl::identity TrivialQ ; - - typedef get_non_trivial_converter< Traits - ,OverflowHandler - ,Float2IntRounder - ,RawConverter - ,UserRangeChecker - > NonTrivialQ ; - - typedef typename Traits::trivial trivial ; - - typedef typename mpl::eval_if::type type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/int_float_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/int_float_mixture.hpp deleted file mode 100644 index 464e52753fe..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/int_float_mixture.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/config.hpp" -#include "boost/limits.hpp" - -#include "boost/numeric/conversion/int_float_mixture_enum.hpp" -#include "boost/numeric/conversion/detail/meta.hpp" - -#include "boost/mpl/integral_c.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - // Integral Constants for 'IntFloatMixture' - typedef mpl::integral_c int2int_c ; - typedef mpl::integral_c int2float_c ; - typedef mpl::integral_c float2int_c ; - typedef mpl::integral_c float2float_c ; - - // Metafunction: - // - // get_int_float_mixture::type - // - // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S. - // - template - struct get_int_float_mixture - { - typedef mpl::bool_< ::std::numeric_limits::is_integer > S_int ; - typedef mpl::bool_< ::std::numeric_limits::is_integer > T_int ; - - typedef typename - for_both::type - type ; - } ; - - // Metafunction: - // - // for_int_float_mixture::type - // - // {Mixture} is one of the Integral Constants for Mixture, declared above. - // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions) - // - // According to the value of 'IntFloatMixture', selects the corresponding type. - // - template - struct for_int_float_mixture - { - typedef typename - ct_switch4::type - type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/is_subranged.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/is_subranged.hpp deleted file mode 100644 index b5e7fe8f1e8..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/is_subranged.hpp +++ /dev/null @@ -1,234 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP - -#include "boost/config.hpp" -#include "boost/limits.hpp" - -#include "boost/mpl/int.hpp" -#include "boost/mpl/multiplies.hpp" -#include "boost/mpl/less.hpp" -#include "boost/mpl/equal_to.hpp" - -#include "boost/type_traits/is_same.hpp" - -#include "boost/numeric/conversion/detail/meta.hpp" -#include "boost/numeric/conversion/detail/int_float_mixture.hpp" -#include "boost/numeric/conversion/detail/sign_mixture.hpp" -#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - //--------------------------------------------------------------- - // Implementations of the compile time predicate "T is subranged" - //--------------------------------------------------------------- - - // for integral to integral conversions - template - struct subranged_Sig2Unsig - { - // Signed to unsigned conversions are 'subranged' because of possible loose - // of negative values. - typedef mpl::true_ type ; - } ; - - // for unsigned integral to signed integral conversions - template - struct subranged_Unsig2Sig - { - // IMPORTANT NOTE: - // - // This code assumes that signed/unsigned integral values are represented - // such that: - // - // numeric_limits::digits + 1 == numeric_limits::digits - // - // The '+1' is required since numeric_limits<>::digits gives 1 bit less for signed integral types. - // - // This fact is used by the following logic: - // - // if ( (numeric_limits::digits+1) < (2*numeric_limits::digits) ) - // then the conversion is subranged. - // - - typedef mpl::int_< ::std::numeric_limits::digits > S_digits ; - typedef mpl::int_< ::std::numeric_limits::digits > T_digits ; - - // T is signed, so take digits+1 - typedef typename T_digits::next u_T_digits ; - - typedef mpl::int_<2> Two ; - - typedef typename mpl::multiplies::type S_digits_times_2 ; - - typedef typename mpl::less::type type ; - } ; - - // for integral to integral conversions of the same sign. - template - struct subranged_SameSign - { - // An integral conversion of the same sign is subranged if digits(T) < digits(S). - - typedef mpl::int_< ::std::numeric_limits::digits > S_digits ; - typedef mpl::int_< ::std::numeric_limits::digits > T_digits ; - - typedef typename mpl::less::type type ; - } ; - - // for integral to float conversions - template - struct subranged_Int2Float - { - typedef mpl::false_ type ; - } ; - - // for float to integral conversions - template - struct subranged_Float2Int - { - typedef mpl::true_ type ; - } ; - - // for float to float conversions - template - struct subranged_Float2Float - { - // If both T and S are floats, - // compare exponent bits and if they match, mantisa bits. - - typedef mpl::int_< ::std::numeric_limits::digits > S_mantisa ; - typedef mpl::int_< ::std::numeric_limits::digits > T_mantisa ; - - typedef mpl::int_< ::std::numeric_limits::max_exponent > S_exponent ; - typedef mpl::int_< ::std::numeric_limits::max_exponent > T_exponent ; - - typedef typename mpl::less::type T_smaller_exponent ; - - typedef typename mpl::equal_to::type equal_exponents ; - - typedef mpl::less T_smaller_mantisa ; - - typedef mpl::eval_if not_bigger_exponent_case ; - - typedef typename - mpl::eval_if::type - type ; - } ; - - // for Udt to built-in conversions - template - struct subranged_Udt2BuiltIn - { - typedef mpl::true_ type ; - } ; - - // for built-in to Udt conversions - template - struct subranged_BuiltIn2Udt - { - typedef mpl::false_ type ; - } ; - - // for Udt to Udt conversions - template - struct subranged_Udt2Udt - { - typedef mpl::false_ type ; - } ; - - //------------------------------------------------------------------- - // Selectors for the implementations of the subranged predicate - //------------------------------------------------------------------- - - template - struct get_subranged_Int2Int - { - typedef subranged_SameSign Sig2Sig ; - typedef subranged_Sig2Unsig Sig2Unsig ; - typedef subranged_Unsig2Sig Unsig2Sig ; - typedef Sig2Sig Unsig2Unsig ; - - typedef typename get_sign_mixture::type sign_mixture ; - - typedef typename - for_sign_mixture::type - type ; - } ; - - template - struct get_subranged_BuiltIn2BuiltIn - { - typedef get_subranged_Int2Int Int2IntQ ; - - typedef subranged_Int2Float Int2Float ; - typedef subranged_Float2Int Float2Int ; - typedef subranged_Float2Float Float2Float ; - - typedef mpl::identity Int2FloatQ ; - typedef mpl::identity Float2IntQ ; - typedef mpl::identity Float2FloatQ ; - - typedef typename get_int_float_mixture::type int_float_mixture ; - - typedef for_int_float_mixture for_ ; - - typedef typename for_::type selected ; - - typedef typename selected::type type ; - } ; - - template - struct get_subranged - { - typedef get_subranged_BuiltIn2BuiltIn BuiltIn2BuiltInQ ; - - typedef subranged_BuiltIn2Udt BuiltIn2Udt ; - typedef subranged_Udt2BuiltIn Udt2BuiltIn ; - typedef subranged_Udt2Udt Udt2Udt ; - - typedef mpl::identity BuiltIn2UdtQ ; - typedef mpl::identity Udt2BuiltInQ ; - typedef mpl::identity Udt2UdtQ ; - - typedef typename get_udt_builtin_mixture::type udt_builtin_mixture ; - - typedef typename - for_udt_builtin_mixture::type - selected ; - - typedef typename selected::type selected2 ; - - typedef typename selected2::type type ; - } ; - - - //------------------------------------------------------------------- - // Top level implementation selector. - //------------------------------------------------------------------- - template - struct get_is_subranged - { - typedef get_subranged non_trivial_case ; - typedef mpl::identity trivial_case ; - - typedef is_same is_trivial ; - - typedef typename mpl::if_::type selected ; - - typedef typename selected::type type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/meta.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/meta.hpp deleted file mode 100644 index 246a1b4702d..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/meta.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP - -#include "boost/type_traits/remove_cv.hpp" - -#include "boost/mpl/if.hpp" -#include "boost/mpl/eval_if.hpp" -#include "boost/mpl/equal_to.hpp" -#include "boost/mpl/not.hpp" -#include "boost/mpl/and.hpp" -#include "boost/mpl/bool.hpp" -#include "boost/mpl/identity.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - template< class T1, class T2> - struct equal_to - { - #if !defined(__BORLANDC__) - - enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) }; - - BOOST_STATIC_CONSTANT(bool, value = x); - - typedef mpl::bool_ type; - - #else - - BOOST_STATIC_CONSTANT(bool, value = ( - BOOST_MPL_AUX_VALUE_WKND(T1)::value - == BOOST_MPL_AUX_VALUE_WKND(T2)::value - )); - - typedef mpl::bool_<( - BOOST_MPL_AUX_VALUE_WKND(T1)::value - == BOOST_MPL_AUX_VALUE_WKND(T2)::value - )> type; - #endif - }; - -// Metafunction: - // - // ct_switch4::type - // - // {Value,Case(X)Val} are Integral Constants (such as: mpl::int_<>) - // {Case(X)Type,DefaultType} are arbitrary types. (not metafunctions) - // - // Returns Case(X)Type if Val==Case(X)Val; DefaultType otherwise. - // - template - struct ct_switch4 - { - typedef mpl::identity Case0TypeQ ; - typedef mpl::identity Case1TypeQ ; - - typedef equal_to is_case0 ; - typedef equal_to is_case1 ; - typedef equal_to is_case2 ; - - typedef mpl::if_ choose_2_3Q ; - typedef mpl::eval_if choose_1_2_3Q ; - - typedef typename - mpl::eval_if::type - type ; - } ; - - - - - // Metafunction: - // - // for_both::type - // - // {exp0,expr1} are Boolean Integral Constants - // {TT,TF,FT,FF} are aribtrary types. (not metafunctions) - // - // According to the combined boolean value of 'expr0 && expr1', selects the corresponding type. - // - template - struct for_both - { - typedef mpl::identity TF_Q ; - typedef mpl::identity TT_Q ; - - typedef typename mpl::not_::type not_expr0 ; - typedef typename mpl::not_::type not_expr1 ; - - typedef typename mpl::and_::type caseTT ; - typedef typename mpl::and_::type caseTF ; - typedef typename mpl::and_::type caseFT ; - - typedef mpl::if_ choose_FT_FF_Q ; - typedef mpl::eval_if choose_TF_FT_FF_Q ; - - typedef typename mpl::eval_if::type type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp deleted file mode 100644 index 150490d935f..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp +++ /dev/null @@ -1,138 +0,0 @@ -// -//! Copyright (c) 2011-2012 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - -#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES) - - #include - - #if !defined(BOOST_NO_LONG_LONG) - #include - #endif - -#else -#if !BOOST_PP_IS_ITERATING - - #include - #include - #include - - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp") - #endif -// -//! Copyright (c) 2011-2012 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(preserve: 1) - #endif - - //! These are the assumed common built in fundamental types (not typedefs/macros.) - #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \ - (char) \ - (signed char) \ - (unsigned char) \ - (short) \ - (unsigned short) \ - (int) \ - (unsigned int) \ - (long) \ - (unsigned long) \ - (float) \ - (double) \ - (long double) \ - /***/ - - #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() - #define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() - -namespace boost { namespace numeric { - - #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) - #include BOOST_PP_ITERATE() - -}}//namespace boost::numeric; - - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(output: null) - #endif - - #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG) - - #undef BOOST_NUMERIC_CONVERSION_SEQ_A - #undef BOOST_NUMERIC_CONVERSION_SEQ_B - - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp") - #endif - -// -//! Copyright (c) 2011-2012 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(preserve: 1) - #endif - -namespace boost { namespace numeric { - - #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type) - #define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type) - - #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) - #include BOOST_PP_ITERATE() - -}}//namespace boost::numeric; - - #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) - #pragma wave option(output: null) - #endif - - #endif - - #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES - #undef BOOST_NUMERIC_CONVERSION_SEQ_A - #undef BOOST_NUMERIC_CONVERSION_SEQ_B - -#elif BOOST_PP_ITERATION_DEPTH() == 1 - - #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), )) - #include BOOST_PP_ITERATE() - -#elif BOOST_PP_ITERATION_DEPTH() == 2 - - //! Generate default traits for the specified source and target. - #define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1) - #define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2) - - template <> - struct numeric_cast_traits - < - BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A()) - , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B()) - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - #undef BOOST_NUMERIC_CONVERSION_A - #undef BOOST_NUMERIC_CONVERSION_B - -#endif//! Depth 2. -#endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp deleted file mode 100644 index 9901ed2ae34..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp +++ /dev/null @@ -1,308 +0,0 @@ -// boost cast.hpp header file ----------------------------------------------// - -// (C) Copyright Kevlin Henney and Dave Abrahams 1999. -// Distributed under the Boost -// Software License, Version 1.0. (See accompanying file -// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) - -// See http://www.boost.org/libs/conversion for Documentation. - -// Revision History -// 02 Jun 14 Remove VC6 workarounds. -// 16 Jul 11 Bugfixes for VC6. -// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header. -// Keeps this legacy version of numeric_cast<> for old compilers -// wich can't compile the new version in /boost/numeric/conversion/cast.hpp -// (Fernando Cacciola) -// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included -// instead (the workaround did not -// actually compile when BOOST_NO_LIMITS was defined in -// any case, so we loose nothing). (John Maddock) -// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never -// worked with stock GCC; trying to get it to do that broke -// vc-stlport. -// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp. -// Removed unused BOOST_EXPLICIT_TARGET macro. Moved -// boost::detail::type to boost/type.hpp. Made it compile with -// stock gcc again (Dave Abrahams) -// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal -// Review (Beman Dawes) -// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams) -// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC -// (Dave Abrahams) -// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams) -// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes) -// 27 Jun 00 More MSVC6 workarounds -// 15 Jun 00 Add workarounds for MSVC6 -// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov) -// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar) -// 29 Dec 99 Change using declarations so usages in other namespaces work -// correctly (Dave Abrahams) -// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors -// as suggested Darin Adler and improved by Valentin Bonnard. -// 2 Sep 99 Remove controversial asserts, simplify, rename. -// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast, -// place in nested namespace. -// 3 Aug 99 Initial version - -#ifndef BOOST_OLD_NUMERIC_CAST_HPP -#define BOOST_OLD_NUMERIC_CAST_HPP - -# include -# include -# include -# include -# include -# include - -namespace boost -{ - using numeric::bad_numeric_cast; - -// LEGACY numeric_cast [only for some old broken compilers] --------------------------------------// - -// Contributed by Kevlin Henney - -// numeric_cast ------------------------------------------------------------// - -#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS) - - namespace detail - { - template - struct signed_numeric_limits : std::numeric_limits - { - static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () - { - return (std::numeric_limits::min)() >= 0 - // unary minus causes integral promotion, thus the static_cast<> - ? static_cast(-(std::numeric_limits::max)()) - : (std::numeric_limits::min)(); - }; - }; - - // Move to namespace boost in utility.hpp? - template - struct fixed_numeric_limits_base - : public if_true< std::numeric_limits::is_signed > - ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits, - std::numeric_limits - >::type - {}; - - template - struct fixed_numeric_limits - : fixed_numeric_limits_base::is_specialized)> - {}; - -# ifdef BOOST_HAS_LONG_LONG - // cover implementations which supply no specialization for long - // long / unsigned long long. Not intended to be full - // numeric_limits replacements, but good enough for numeric_cast<> - template <> - struct fixed_numeric_limits_base< ::boost::long_long_type, false> - { - BOOST_STATIC_CONSTANT(bool, is_specialized = true); - BOOST_STATIC_CONSTANT(bool, is_signed = true); - static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION () - { -# ifdef LONGLONG_MAX - return LONGLONG_MAX; -# else - return 9223372036854775807LL; // hope this is portable -# endif - } - - static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () - { -# ifdef LONGLONG_MIN - return LONGLONG_MIN; -# else - return -( 9223372036854775807LL )-1; // hope this is portable -# endif - } - }; - - template <> - struct fixed_numeric_limits_base< ::boost::ulong_long_type, false> - { - BOOST_STATIC_CONSTANT(bool, is_specialized = true); - BOOST_STATIC_CONSTANT(bool, is_signed = false); - static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION () - { -# ifdef ULONGLONG_MAX - return ULONGLONG_MAX; -# else - return 0xffffffffffffffffULL; // hope this is portable -# endif - } - - static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } - }; -# endif - } // namespace detail - -// less_than_type_min - - // x_is_signed should be numeric_limits::is_signed - // y_is_signed should be numeric_limits::is_signed - // y_min should be numeric_limits::min() - // - // check(x, y_min) returns true iff x < y_min without invoking comparisons - // between signed and unsigned values. - // - // "poor man's partial specialization" is in use here. - template - struct less_than_type_min - { - template - static bool check(X x, Y y_min) - { return x < y_min; } - }; - - template <> - struct less_than_type_min - { - template - static bool check(X, Y) - { return false; } - }; - - template <> - struct less_than_type_min - { - template - static bool check(X x, Y) - { return x < 0; } - }; - - // greater_than_type_max - - // same_sign should be: - // numeric_limits::is_signed == numeric_limits::is_signed - // y_max should be numeric_limits::max() - // - // check(x, y_max) returns true iff x > y_max without invoking comparisons - // between signed and unsigned values. - // - // "poor man's partial specialization" is in use here. - template - struct greater_than_type_max; - - template<> - struct greater_than_type_max - { - template - static inline bool check(X x, Y y_max) - { return x > y_max; } - }; - - template <> - struct greater_than_type_max - { - // What does the standard say about this? I think it's right, and it - // will work with every compiler I know of. - template - static inline bool check(X x, Y) - { return x >= 0 && static_cast(static_cast(x)) != x; } - }; - - template<> - struct greater_than_type_max - { - template - static inline bool check(X x, Y y_max) - { return x > y_max; } - }; - - template <> - struct greater_than_type_max - { - // What does the standard say about this? I think it's right, and it - // will work with every compiler I know of. - template - static inline bool check(X x, Y) - { return static_cast(static_cast(x)) != x; } - }; - -#else // use #pragma hacks if available - - namespace detail - { -# if BOOST_MSVC -# pragma warning(push) -# pragma warning(disable : 4018) -# pragma warning(disable : 4146) -#elif defined(__BORLANDC__) -# pragma option push -w-8041 -# endif - - // Move to namespace boost in utility.hpp? - template - struct fixed_numeric_limits : public std::numeric_limits - { - static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () - { - return std::numeric_limits::is_signed && (std::numeric_limits::min)() >= 0 - ? T(-(std::numeric_limits::max)()) : (std::numeric_limits::min)(); - } - }; - -# if BOOST_MSVC -# pragma warning(pop) -#elif defined(__BORLANDC__) -# pragma option pop -# endif - } // namespace detail - -#endif - - template - inline Target numeric_cast(Source arg) - { - // typedefs abbreviating respective trait classes - typedef detail::fixed_numeric_limits arg_traits; - typedef detail::fixed_numeric_limits result_traits; - -#if defined(BOOST_STRICT_CONFIG) \ - || (!defined(__HP_aCC) || __HP_aCC > 33900) \ - && (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \ - || defined(BOOST_SGI_CPP_LIMITS)) - // typedefs that act as compile time assertions - // (to be replaced by boost compile time assertions - // as and when they become available and are stable) - typedef bool argument_must_be_numeric[arg_traits::is_specialized]; - typedef bool result_must_be_numeric[result_traits::is_specialized]; - - const bool arg_is_signed = arg_traits::is_signed; - const bool result_is_signed = result_traits::is_signed; - const bool same_sign = arg_is_signed == result_is_signed; - - if (less_than_type_min::check(arg, (result_traits::min)()) - || greater_than_type_max::check(arg, (result_traits::max)()) - ) - -#else // We need to use #pragma hacks if available - -# if BOOST_MSVC -# pragma warning(push) -# pragma warning(disable : 4018) -#elif defined(__BORLANDC__) -#pragma option push -w-8012 -# endif - if ((arg < 0 && !result_traits::is_signed) // loss of negative range - || (arg_traits::is_signed && arg < (result_traits::min)()) // underflow - || arg > (result_traits::max)()) // overflow -# if BOOST_MSVC -# pragma warning(pop) -#elif defined(__BORLANDC__) -#pragma option pop -# endif -#endif - { - throw bad_numeric_cast(); - } - return static_cast(arg); - } // numeric_cast - -} // namespace boost - -#endif // BOOST_OLD_NUMERIC_CAST_HPP diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp deleted file mode 100644 index 01dc9321b3c..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp +++ /dev/null @@ -1,1741 +0,0 @@ -// -//! Copyright (c) 2011-2012 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// - - - -namespace boost { namespace numeric { - - template <> - struct numeric_cast_traits - < - char - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , signed char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , unsigned char - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , unsigned short - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , unsigned int - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , unsigned long - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , float - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , long double - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; -}} diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp deleted file mode 100644 index b358b9c41f5..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp +++ /dev/null @@ -1,347 +0,0 @@ -// -//! Copyright (c) 2011-2012 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -namespace boost { namespace numeric { - - - template <> - struct numeric_cast_traits - < - char - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - char - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - signed char - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned char - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - short - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned short - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - int - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned int - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - unsigned long - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - float - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - double - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - long double - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - boost::long_long_type - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - boost::long_long_type - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - boost::ulong_long_type - , boost::long_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - - template <> - struct numeric_cast_traits - < - boost::ulong_long_type - , boost::ulong_long_type - > - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; -}} diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/sign_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/sign_mixture.hpp deleted file mode 100644 index c7f9e42afe8..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/sign_mixture.hpp +++ /dev/null @@ -1,72 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/config.hpp" -#include "boost/limits.hpp" - -#include "boost/numeric/conversion/sign_mixture_enum.hpp" -#include "boost/numeric/conversion/detail/meta.hpp" - -#include "boost/mpl/integral_c.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - // Integral Constants for 'SignMixture' - typedef mpl::integral_c unsig2unsig_c ; - typedef mpl::integral_c sig2sig_c ; - typedef mpl::integral_c sig2unsig_c ; - typedef mpl::integral_c unsig2sig_c ; - - // Metafunction: - // - // get_sign_mixture::type - // - // Selects the appropriate SignMixture Integral Constant for the combination T,S. - // - template - struct get_sign_mixture - { - typedef mpl::bool_< ::std::numeric_limits::is_signed > S_signed ; - typedef mpl::bool_< ::std::numeric_limits::is_signed > T_signed ; - - typedef typename - for_both::type - type ; - } ; - - // Metafunction: - // - // for_sign_mixture::type - // - // {SignMixture} is one of the Integral Constants for SignMixture, declared above. - // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions) - // - // According to the value of 'SignMixture', selects the corresponding type. - // - template - struct for_sign_mixture - { - typedef typename - ct_switch4::type - type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp deleted file mode 100644 index 36dbc491b5e..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp +++ /dev/null @@ -1,69 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/type_traits/is_arithmetic.hpp" - -#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" -#include "boost/numeric/conversion/detail/meta.hpp" - -#include "boost/mpl/integral_c.hpp" - -namespace boost { namespace numeric { namespace convdetail -{ - // Integral Constants for 'UdtMixture' - typedef mpl::integral_c builtin2builtin_c ; - typedef mpl::integral_c builtin2udt_c ; - typedef mpl::integral_c udt2builtin_c ; - typedef mpl::integral_c udt2udt_c ; - - // Metafunction: - // - // for_udt_mixture::type - // - // {UdtMixture} is one of the Integral Constants for UdMixture, declared above. - // {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions) - // - // According to the value of 'UdtMixture', selects the corresponding type. - // - template - struct for_udt_builtin_mixture - { - typedef typename - ct_switch4::type - type ; - } ; - - // Metafunction: - // - // get_udt_mixture::type - // - // Selects the appropriate UdtMixture Integral Constant for the combination T,S. - // - template - struct get_udt_builtin_mixture - { - typedef is_arithmetic S_builtin ; - typedef is_arithmetic T_builtin ; - - typedef typename - for_both::type - type ; - } ; - -} } } // namespace boost::numeric::convdetail - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture.hpp deleted file mode 100644 index d6dd5ab7c26..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/int_float_mixture.hpp" - -namespace boost { namespace numeric -{ - -template -struct int_float_mixture - : convdetail::get_int_float_mixture< BOOST_DEDUCED_TYPENAME remove_cv::type - ,BOOST_DEDUCED_TYPENAME remove_cv::type - >::type {} ; - -} } // namespace boost::numeric - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture_enum.hpp b/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture_enum.hpp deleted file mode 100644 index d0c2daacfc8..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/int_float_mixture_enum.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP - -namespace boost { namespace numeric -{ - enum int_float_mixture_enum - { - integral_to_integral - ,integral_to_float - ,float_to_integral - ,float_to_float - } ; - -} } // namespace boost::numeric - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/is_subranged.hpp b/contrib/restricted/boost/boost/numeric/conversion/is_subranged.hpp deleted file mode 100644 index c5fa0dd1032..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/is_subranged.hpp +++ /dev/null @@ -1,27 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_IS_SUBRANGED_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_IS_SUBRANGED_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/is_subranged.hpp" - -namespace boost { namespace numeric { - -template -struct is_subranged - : convdetail::get_is_subranged< BOOST_DEDUCED_TYPENAME remove_cv::type - ,BOOST_DEDUCED_TYPENAME remove_cv::type - >::type {} ; - -} } // namespace boost::numeric - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/numeric_cast_traits.hpp b/contrib/restricted/boost/boost/numeric/conversion/numeric_cast_traits.hpp deleted file mode 100644 index e24296bc7ec..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/numeric_cast_traits.hpp +++ /dev/null @@ -1,31 +0,0 @@ -// -//! Copyright (c) 2011 -//! Brandon Kohn -// -// Distributed under the Boost Software License, Version 1.0. (See -// accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) -// -#ifndef BOOST_NUMERIC_CAST_TRAITS_HPP -#define BOOST_NUMERIC_CAST_TRAITS_HPP - -#include - -namespace boost { namespace numeric { - - template - struct numeric_cast_traits - { - typedef def_overflow_handler overflow_policy; - typedef UseInternalRangeChecker range_checking_policy; - typedef Trunc rounding_policy; - }; - -}}//namespace boost::numeric; - -#if !defined( BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS ) -#include -#include -#endif//!defined BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS - -#endif//BOOST_NUMERIC_CAST_TRAITS_HPP diff --git a/contrib/restricted/boost/boost/numeric/conversion/sign_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/sign_mixture.hpp deleted file mode 100644 index 12018141c3a..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/sign_mixture.hpp +++ /dev/null @@ -1,30 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/sign_mixture.hpp" - -namespace boost { namespace numeric -{ - -template -struct sign_mixture - : convdetail::get_sign_mixture< BOOST_DEDUCED_TYPENAME remove_cv::type - ,BOOST_DEDUCED_TYPENAME remove_cv::type - >::type {} ; - -} } // namespace boost::numeric - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/sign_mixture_enum.hpp b/contrib/restricted/boost/boost/numeric/conversion/sign_mixture_enum.hpp deleted file mode 100644 index 1525f8d33ce..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/sign_mixture_enum.hpp +++ /dev/null @@ -1,29 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP - -namespace boost { namespace numeric -{ - enum sign_mixture_enum - { - unsigned_to_unsigned - ,signed_to_signed - ,signed_to_unsigned - ,unsigned_to_signed - } ; - -} } // namespace boost::numeric - -#endif -// -/////////////////////////////////////////////////////////////////////////////////////////////// - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture.hpp b/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture.hpp deleted file mode 100644 index a62e37d8e0a..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture.hpp +++ /dev/null @@ -1,28 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP - -#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp" - -namespace boost { namespace numeric -{ - -template -struct udt_builtin_mixture - : convdetail::get_udt_builtin_mixture< BOOST_DEDUCED_TYPENAME remove_cv::type - ,BOOST_DEDUCED_TYPENAME remove_cv::type - >::type {} ; - -} } // namespace boost::numeric - -#endif - - diff --git a/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp b/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp deleted file mode 100644 index 2540e806308..00000000000 --- a/contrib/restricted/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp +++ /dev/null @@ -1,26 +0,0 @@ -// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 -// Use, modification, and distribution is subject to the Boost Software -// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -// See library home page at http://www.boost.org/libs/numeric/conversion -// -// Contact the author at: fernando_cacciola@hotmail.com -// -#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP -#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP - -namespace boost { namespace numeric -{ - enum udt_builtin_mixture_enum - { - builtin_to_builtin - ,builtin_to_udt - ,udt_to_builtin - ,udt_to_udt - } ; - -} } // namespace boost::numeric - -#endif - diff --git a/contrib/restricted/boost/numeric_conversion/CMakeLists.txt b/contrib/restricted/boost/numeric_conversion/CMakeLists.txt new file mode 100644 index 00000000000..ffb9a1d127e --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/CMakeLists.txt @@ -0,0 +1,24 @@ + +# This file was gererated by the build system used internally in the Yandex monorepo. +# Only simple modifications are allowed (adding source-files to targets, adding simple properties +# like target_include_directories). These modifications will be ported to original +# ya.make files by maintainers. Any complex modifications which can't be ported back to the +# original buildsystem will not be accepted. + + + +add_library(restricted-boost-numeric_conversion INTERFACE) +target_include_directories(restricted-boost-numeric_conversion INTERFACE + ${CMAKE_SOURCE_DIR}/contrib/restricted/boost/numeric_conversion/include +) +target_link_libraries(restricted-boost-numeric_conversion INTERFACE + contrib-libs-cxxsupp + yutil + restricted-boost-config + restricted-boost-conversion + restricted-boost-core + restricted-boost-mpl + restricted-boost-preprocessor + restricted-boost-throw_exception + restricted-boost-type_traits +) diff --git a/contrib/restricted/boost/numeric_conversion/README.md b/contrib/restricted/boost/numeric_conversion/README.md new file mode 100644 index 00000000000..987f0ecf6bf --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/README.md @@ -0,0 +1,8 @@ +# Boost.NumericConversion + +The Boost Numeric Conversion library is a collection of tools to describe and perform conversions between values of different [numeric types][1]. + +The documentation for the library can be found [here][2] + +[1]: http://www.boost.org/doc/libs/release/libs/numeric/conversion/doc/html/boost_numericconversion/definitions.html#boost_numericconversion.definitions.numeric_types +[2]: http://www.boost.org/doc/libs/release/libs/numeric/conversion/doc/html/index.html#numeric_conversion.overview diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/cast.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/cast.hpp new file mode 100644 index 00000000000..ab452bdf163 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/cast.hpp @@ -0,0 +1,20 @@ +// boost cast.hpp header file +// +// (C) Copyright Antony Polukhin 2014. +// +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// See http://www.boost.org/libs/conversion for Documentation. + +// This is a DEPRECATED header file! +// Use or instead + +#ifndef BOOST_CAST_HPP +#define BOOST_CAST_HPP + +# include +# include + +#endif // BOOST_CAST_HPP diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/bounds.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/bounds.hpp new file mode 100644 index 00000000000..e4c7c7deee8 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/bounds.hpp @@ -0,0 +1,24 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP + +#include "boost/numeric/conversion/detail/bounds.hpp" + +namespace boost { namespace numeric +{ + +template +struct bounds : boundsdetail::get_impl::type +{} ; + +} } // namespace boost::numeric + +#endif diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/cast.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/cast.hpp new file mode 100644 index 00000000000..61286c13119 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/cast.hpp @@ -0,0 +1,61 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +// +// Revision History +// +// 19 Nov 2001 Syntatic changes as suggested by Darin Adler (Fernando Cacciola) +// 08 Nov 2001 Fixes to accommodate MSVC (Fernando Cacciola) +// 04 Nov 2001 Fixes to accommodate gcc2.92 (Fernando Cacciola) +// 30 Oct 2001 Some fixes suggested by Daryle Walker (Fernando Cacciola) +// 25 Oct 2001 Initial boostification (Fernando Cacciola) +// 23 Jan 2004 Inital add to cvs (post review)s +// 22 Jun 2011 Added support for specializing cast policies via numeric_cast_traits (Brandon Kohn). +// +#ifndef BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP +#define BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP + +#include + +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) + +# include + +#else + +#include +#include +#include + +namespace boost +{ + template + inline Target numeric_cast( Source arg ) + { + typedef numeric::conversion_traits conv_traits; + typedef numeric::numeric_cast_traits cast_traits; + typedef boost::numeric::converter + < + Target, + Source, + conv_traits, + typename cast_traits::overflow_policy, + typename cast_traits::rounding_policy, + boost::numeric::raw_converter< conv_traits >, + typename cast_traits::range_checking_policy + > converter; + return converter::convert(arg); + } + + using numeric::bad_numeric_cast; +} // namespace boost + +#endif + +#endif diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/conversion_traits.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/conversion_traits.hpp new file mode 100644 index 00000000000..23e0eb8c9ab --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/conversion_traits.hpp @@ -0,0 +1,32 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP + +#include "boost/numeric/conversion/detail/conversion_traits.hpp" +#include "boost/detail/workaround.hpp" +#include "boost/config.hpp" + +namespace boost { namespace numeric +{ + +template +struct conversion_traits + : convdetail::get_conversion_traits::type +{ +} ; + +} } // namespace boost::numeric + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter.hpp new file mode 100644 index 00000000000..331caddea54 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter.hpp @@ -0,0 +1,68 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP + +#include "boost/numeric/conversion/conversion_traits.hpp" +#include "boost/numeric/conversion/converter_policies.hpp" + +#include "boost/numeric/conversion/detail/converter.hpp" + +namespace boost { namespace numeric +{ + +template, + class OverflowHandler = def_overflow_handler, + class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type> , + class RawConverter = raw_converter, + class UserRangeChecker = UseInternalRangeChecker + > +struct converter : convdetail::get_converter_impl::type +{ + typedef Traits traits ; + + typedef typename Traits::argument_type argument_type ; + typedef typename Traits::result_type result_type ; + + result_type operator() ( argument_type s ) const { return this->convert(s) ; } +} ; + + + +template , + class UserRangeChecker = UseInternalRangeChecker + > +struct make_converter_from +{ + template, + class RawConverter = raw_converter + > + struct to + { + typedef converter type ; + } ; + +} ; + +} } // namespace boost::numeric + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter_policies.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter_policies.hpp new file mode 100644 index 00000000000..57a255d451c --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/converter_policies.hpp @@ -0,0 +1,194 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP + +#include // for std::bad_cast + +#include // for std::floor and std::ceil +#include + +#include + +#include "boost/type_traits/is_arithmetic.hpp" + +#include "boost/mpl/if.hpp" +#include "boost/mpl/integral_c.hpp" + +namespace boost { namespace numeric +{ + +template +struct Trunc +{ + typedef S source_type ; + + typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; + + static source_type nearbyint ( argument_type s ) + { +#if !defined(BOOST_NO_STDC_NAMESPACE) + using std::floor ; + using std::ceil ; +#endif + + return s < static_cast(0) ? ceil(s) : floor(s) ; + } + + typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ; +} ; + + + +template +struct Floor +{ + typedef S source_type ; + + typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; + + static source_type nearbyint ( argument_type s ) + { +#if !defined(BOOST_NO_STDC_NAMESPACE) + using std::floor ; +#endif + + return floor(s) ; + } + + typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ; +} ; + +template +struct Ceil +{ + typedef S source_type ; + + typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; + + static source_type nearbyint ( argument_type s ) + { +#if !defined(BOOST_NO_STDC_NAMESPACE) + using std::ceil ; +#endif + + return ceil(s) ; + } + + typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ; +} ; + +template +struct RoundEven +{ + typedef S source_type ; + + typedef typename mpl::if_< is_arithmetic,S,S const&>::type argument_type ; + + static source_type nearbyint ( argument_type s ) + { + // Algorithm contributed by Guillaume Melquiond + +#if !defined(BOOST_NO_STDC_NAMESPACE) + using std::floor ; + using std::ceil ; +#endif + + // only works inside the range not at the boundaries + S prev = floor(s); + S next = ceil(s); + + S rt = (s - prev) - (next - s); // remainder type + + S const zero(0.0); + S const two(2.0); + + if ( rt < zero ) + return prev; + else if ( rt > zero ) + return next; + else + { + bool is_prev_even = two * floor(prev / two) == prev ; + return ( is_prev_even ? prev : next ) ; + } + } + + typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ; +} ; + + +enum range_check_result +{ + cInRange = 0 , + cNegOverflow = 1 , + cPosOverflow = 2 +} ; + +class bad_numeric_cast : public std::bad_cast +{ + public: + + virtual const char * what() const noexcept + { return "bad numeric conversion: overflow"; } +}; + +class negative_overflow : public bad_numeric_cast +{ + public: + + virtual const char * what() const noexcept + { return "bad numeric conversion: negative overflow"; } +}; +class positive_overflow : public bad_numeric_cast +{ + public: + + virtual const char * what() const noexcept + { return "bad numeric conversion: positive overflow"; } +}; + +struct def_overflow_handler +{ + void operator() ( range_check_result r ) // + { +#ifndef BOOST_NO_EXCEPTIONS + if ( r == cNegOverflow ) + throw negative_overflow() ; + else if ( r == cPosOverflow ) + throw positive_overflow() ; +#else + if ( r == cNegOverflow ) + ::boost::throw_exception(negative_overflow()) ; + else if ( r == cPosOverflow ) + ::boost::throw_exception(positive_overflow()) ; +#endif + } +} ; + +struct silent_overflow_handler +{ + void operator() ( range_check_result ) {} // noexcept +} ; + +template +struct raw_converter +{ + typedef typename Traits::result_type result_type ; + typedef typename Traits::argument_type argument_type ; + + static result_type low_level_convert ( argument_type s ) { return static_cast(s) ; } +} ; + +struct UseInternalRangeChecker {} ; + +} } // namespace boost::numeric + +#endif diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/bounds.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/bounds.hpp new file mode 100644 index 00000000000..67342b8e570 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/bounds.hpp @@ -0,0 +1,58 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP + +#include "boost/limits.hpp" +#include "boost/config.hpp" +#include "boost/mpl/if.hpp" + +namespace boost { namespace numeric { namespace boundsdetail +{ + template + class Integral + { + typedef std::numeric_limits limits ; + + public : + + static N lowest () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); } + static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); } + static N smallest() { return static_cast(1); } + } ; + + template + class Float + { + typedef std::numeric_limits limits ; + + public : + + static N lowest () { return static_cast(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; } + static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); } + static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); } + } ; + + template + struct get_impl + { + typedef mpl::bool_< ::std::numeric_limits::is_integer > is_int ; + + typedef Integral impl_int ; + typedef Float impl_float ; + + typedef typename mpl::if_::type type ; + } ; + +} } } // namespace boost::numeric::boundsdetail. + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/conversion_traits.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/conversion_traits.hpp new file mode 100644 index 00000000000..ed25349c671 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/conversion_traits.hpp @@ -0,0 +1,97 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP + +#include "boost/type_traits/is_arithmetic.hpp" +#include "boost/type_traits/is_same.hpp" +#include "boost/type_traits/remove_cv.hpp" + +#include "boost/numeric/conversion/detail/meta.hpp" +#include "boost/numeric/conversion/detail/int_float_mixture.hpp" +#include "boost/numeric/conversion/detail/sign_mixture.hpp" +#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp" +#include "boost/numeric/conversion/detail/is_subranged.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + //------------------------------------------------------------------- + // Implementation of the Conversion Traits for T != S + // + // This is a VISIBLE base class of the user-level conversion_traits<> class. + //------------------------------------------------------------------- + template + struct non_trivial_traits_impl + { + typedef typename get_int_float_mixture ::type int_float_mixture ; + typedef typename get_sign_mixture ::type sign_mixture ; + typedef typename get_udt_builtin_mixture ::type udt_builtin_mixture ; + + typedef typename get_is_subranged::type subranged ; + + typedef mpl::false_ trivial ; + + typedef T target_type ; + typedef S source_type ; + typedef T result_type ; + + typedef typename mpl::if_< is_arithmetic, S, S const&>::type argument_type ; + + typedef typename mpl::if_::type supertype ; + typedef typename mpl::if_::type subtype ; + } ; + + //------------------------------------------------------------------- + // Implementation of the Conversion Traits for T == S + // + // This is a VISIBLE base class of the user-level conversion_traits<> class. + //------------------------------------------------------------------- + template + struct trivial_traits_impl + { + typedef typename get_int_float_mixture ::type int_float_mixture ; + typedef typename get_sign_mixture ::type sign_mixture ; + typedef typename get_udt_builtin_mixture::type udt_builtin_mixture ; + + typedef mpl::false_ subranged ; + typedef mpl::true_ trivial ; + + typedef N target_type ; + typedef N source_type ; + typedef N const& result_type ; + typedef N const& argument_type ; + + typedef N supertype ; + typedef N subtype ; + + } ; + + //------------------------------------------------------------------- + // Top level implementation selector. + //------------------------------------------------------------------- + template + struct get_conversion_traits + { + typedef typename remove_cv::type target_type ; + typedef typename remove_cv::type source_type ; + + typedef typename is_same::type is_trivial ; + + typedef trivial_traits_impl trivial_imp ; + typedef non_trivial_traits_impl non_trivial_imp ; + + typedef typename mpl::if_::type type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/converter.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/converter.hpp new file mode 100644 index 00000000000..f7bf7b4436a --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/converter.hpp @@ -0,0 +1,593 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP + +#include + +#include "boost/numeric/conversion/detail/meta.hpp" +#include "boost/numeric/conversion/detail/conversion_traits.hpp" +#include "boost/numeric/conversion/bounds.hpp" + +#include "boost/type_traits/is_same.hpp" + +#include "boost/mpl/integral_c.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + // Integral Constants representing rounding modes + typedef mpl::integral_c round2zero_c ; + typedef mpl::integral_c round2nearest_c ; + typedef mpl::integral_c round2inf_c ; + typedef mpl::integral_c round2neg_inf_c ; + + // Metafunction: + // + // for_round_style::type + // + // {RoundStyle} Integral Constant specifying a round style as declared above. + // {RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf} arbitrary types. + // + // Selects one of the 4 types according to the value of RoundStyle. + // + template + struct for_round_style + { + typedef ct_switch4 selector ; + + typedef typename selector::type type ; + } ; + + + + + + + + + + + + + + + + + + +//-------------------------------------------------------------------------- +// Range Checking Logic. +// +// The range checking logic is built up by combining 1 or 2 predicates. +// Each predicate is encapsulated in a template class and exposes +// the static member function 'apply'. +// +//-------------------------------------------------------------------------- + + + // Because a particular logic can combine either 1 or two predicates, the following + // tags are used to allow the predicate applier to receive 2 preds, but optimize away + // one of them if it is 'non-applicable' + struct non_applicable { typedef mpl::false_ do_apply ; } ; + struct applicable { typedef mpl::true_ do_apply ; } ; + + + //-------------------------------------------------------------------------- + // + // Range Checking Logic implementations. + // + // The following classes, collectivelly named 'Predicates', are instantiated within + // the corresponding range checkers. + // Their static member function 'apply' is called to perform the actual range checking logic. + //-------------------------------------------------------------------------- + + // s < Lowest(T) ? cNegOverflow : cInRange + // + template + struct LT_LoT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s < static_cast(bounds::lowest()) ? cNegOverflow : cInRange ; + } + } ; + + // s < 0 ? cNegOverflow : cInRange + // + template + struct LT_Zero : applicable + { + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s < static_cast(0) ? cNegOverflow : cInRange ; + } + } ; + + // s <= Lowest(T)-1 ? cNegOverflow : cInRange + // + template + struct LE_PrevLoT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s <= static_cast(bounds::lowest()) - static_cast(1.0) + ? cNegOverflow : cInRange ; + } + } ; + + // s < Lowest(T)-0.5 ? cNegOverflow : cInRange + // + template + struct LT_HalfPrevLoT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s < static_cast(bounds::lowest()) - static_cast(0.5) + ? cNegOverflow : cInRange ; + } + } ; + + // s > Highest(T) ? cPosOverflow : cInRange + // + template + struct GT_HiT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s > static_cast(bounds::highest()) + ? cPosOverflow : cInRange ; + } + } ; + + // s >= Lowest(T) + 1 ? cPosOverflow : cInRange + // + template + struct GE_SuccHiT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s >= static_cast(bounds::highest()) + static_cast(1.0) + ? cPosOverflow : cInRange ; + } + } ; + + // s >= Lowest(T) + 0.5 ? cPosgOverflow : cInRange + // + template + struct GT_HalfSuccHiT : applicable + { + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + typedef typename Traits::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + return s >= static_cast(bounds::highest()) + static_cast(0.5) + ? cPosOverflow : cInRange ; + } + } ; + + + //-------------------------------------------------------------------------- + // + // Predicate Combiner. + // + // This helper classes are used to possibly combine the range checking logic + // individually performed by the predicates + // + //-------------------------------------------------------------------------- + + + // Applies both predicates: first 'PredA', and if it equals 'cInRange', 'PredB' + template + struct applyBoth + { + typedef typename PredA::argument_type argument_type ; + + static range_check_result apply ( argument_type s ) + { + range_check_result r = PredA::apply(s) ; + if ( r == cInRange ) + r = PredB::apply(s); + return r ; + } + } ; + + template + struct combine + { + typedef applyBoth Both ; + typedef void NNone ; // 'None' is defined as a macro in (/usr/X11R6/include/X11/X.h) + + typedef typename PredA::do_apply do_applyA ; + typedef typename PredB::do_apply do_applyB ; + + typedef typename for_both::type type ; + } ; + + + + + + + + + + + + +//-------------------------------------------------------------------------- +// Range Checker classes. +// +// The following classes are VISIBLE base classes of the user-level converter<> class. +// They supply the optimized 'out_of_range()' and 'validate_range()' static member functions +// visible in the user interface. +// +//-------------------------------------------------------------------------- + + // Dummy range checker. + template + struct dummy_range_checker + { + typedef typename Traits::argument_type argument_type ; + + static range_check_result out_of_range ( argument_type ) { return cInRange ; } + static void validate_range ( argument_type ) {} + } ; + + // Generic range checker. + // + // All the range checking logic for all possible combinations of source and target + // can be arranged in terms of one or two predicates, which test overflow on both neg/pos 'sides' + // of the ranges. + // + // These predicates are given here as IsNegOverflow and IsPosOverflow. + // + template + struct generic_range_checker + { + typedef OverflowHandler overflow_handler ; + + typedef typename Traits::argument_type argument_type ; + + static range_check_result out_of_range ( argument_type s ) + { + typedef typename combine::type Predicate ; + + return Predicate::apply(s); + } + + static void validate_range ( argument_type s ) + { OverflowHandler()( out_of_range(s) ) ; } + } ; + + + +//-------------------------------------------------------------------------- +// +// Selectors for the optimized Range Checker class. +// +//-------------------------------------------------------------------------- + + template + struct GetRC_Sig2Sig_or_Unsig2Unsig + { + typedef dummy_range_checker Dummy ; + + typedef LT_LoT Pred1 ; + typedef GT_HiT Pred2 ; + + typedef generic_range_checker Normal ; + + typedef typename Traits::subranged subranged ; + + typedef typename mpl::if_::type type ; + } ; + + template + struct GetRC_Sig2Unsig + { + typedef LT_Zero Pred1 ; + typedef GT_HiT Pred2 ; + + typedef generic_range_checker ChoiceA ; + + typedef generic_range_checker ChoiceB ; + + typedef typename Traits::target_type T ; + typedef typename Traits::source_type S ; + + typedef typename subranged_Unsig2Sig::type oposite_subranged ; + + typedef typename mpl::not_::type positively_subranged ; + + typedef typename mpl::if_::type type ; + } ; + + template + struct GetRC_Unsig2Sig + { + typedef GT_HiT Pred1 ; + + typedef generic_range_checker type ; + } ; + + template + struct GetRC_Int2Int + { + typedef GetRC_Sig2Sig_or_Unsig2Unsig Sig2SigQ ; + typedef GetRC_Sig2Unsig Sig2UnsigQ ; + typedef GetRC_Unsig2Sig Unsig2SigQ ; + typedef Sig2SigQ Unsig2UnsigQ ; + + typedef typename Traits::sign_mixture sign_mixture ; + + typedef typename + for_sign_mixture::type + selector ; + + typedef typename selector::type type ; + } ; + + template + struct GetRC_Int2Float + { + typedef dummy_range_checker type ; + } ; + + template + struct GetRC_Float2Int + { + typedef LE_PrevLoT Pred1 ; + typedef GE_SuccHiT Pred2 ; + typedef LT_HalfPrevLoT Pred3 ; + typedef GT_HalfSuccHiT Pred4 ; + typedef GT_HiT Pred5 ; + typedef LT_LoT Pred6 ; + + typedef generic_range_checker ToZero ; + typedef generic_range_checker ToNearest ; + typedef generic_range_checker ToInf ; + typedef generic_range_checker ToNegInf ; + + typedef typename Float2IntRounder::round_style round_style ; + + typedef typename for_round_style::type type ; + } ; + + template + struct GetRC_Float2Float + { + typedef dummy_range_checker Dummy ; + + typedef LT_LoT Pred1 ; + typedef GT_HiT Pred2 ; + + typedef generic_range_checker Normal ; + + typedef typename Traits::subranged subranged ; + + typedef typename mpl::if_::type type ; + } ; + + template + struct GetRC_BuiltIn2BuiltIn + { + typedef GetRC_Int2Int Int2IntQ ; + typedef GetRC_Int2Float Int2FloatQ ; + typedef GetRC_Float2Int Float2IntQ ; + typedef GetRC_Float2Float Float2FloatQ ; + + typedef typename Traits::int_float_mixture int_float_mixture ; + + typedef typename for_int_float_mixture::type selector ; + + typedef typename selector::type type ; + } ; + + template + struct GetRC + { + typedef GetRC_BuiltIn2BuiltIn BuiltIn2BuiltInQ ; + + typedef dummy_range_checker Dummy ; + + typedef mpl::identity DummyQ ; + + typedef typename Traits::udt_builtin_mixture udt_builtin_mixture ; + + typedef typename for_udt_builtin_mixture::type selector ; + + typedef typename selector::type type ; + } ; + + + + +//-------------------------------------------------------------------------- +// Converter classes. +// +// The following classes are VISIBLE base classes of the user-level converter<> class. +// They supply the optimized 'nearbyint()' and 'convert()' static member functions +// visible in the user interface. +// +//-------------------------------------------------------------------------- + + // + // Trivial Converter : used when (cv-unqualified) T == (cv-unqualified) S + // + template + struct trivial_converter_impl : public dummy_range_checker + { + typedef Traits traits ; + + typedef typename Traits::source_type source_type ; + typedef typename Traits::argument_type argument_type ; + typedef typename Traits::result_type result_type ; + + static result_type low_level_convert ( argument_type s ) { return s ; } + static source_type nearbyint ( argument_type s ) { return s ; } + static result_type convert ( argument_type s ) { return s ; } + } ; + + + // + // Rounding Converter : used for float to integral conversions. + // + template + struct rounding_converter : public RangeChecker + ,public Float2IntRounder + ,public RawConverter + { + typedef RangeChecker RangeCheckerBase ; + typedef Float2IntRounder Float2IntRounderBase ; + typedef RawConverter RawConverterBase ; + + typedef Traits traits ; + + typedef typename Traits::source_type source_type ; + typedef typename Traits::argument_type argument_type ; + typedef typename Traits::result_type result_type ; + + static result_type convert ( argument_type s ) + { + RangeCheckerBase::validate_range(s); + source_type s1 = Float2IntRounderBase::nearbyint(s); + return RawConverterBase::low_level_convert(s1); + } + } ; + + + // + // Non-Rounding Converter : used for all other conversions. + // + template + struct non_rounding_converter : public RangeChecker + ,public RawConverter + { + typedef RangeChecker RangeCheckerBase ; + typedef RawConverter RawConverterBase ; + + typedef Traits traits ; + + typedef typename Traits::source_type source_type ; + typedef typename Traits::argument_type argument_type ; + typedef typename Traits::result_type result_type ; + + static source_type nearbyint ( argument_type s ) { return s ; } + + static result_type convert ( argument_type s ) + { + RangeCheckerBase::validate_range(s); + return RawConverterBase::low_level_convert(s); + } + } ; + + + + +//-------------------------------------------------------------------------- +// +// Selectors for the optimized Converter class. +// +//-------------------------------------------------------------------------- + + template + struct get_non_trivial_converter + { + typedef GetRC InternalRangeCheckerQ ; + + typedef is_same use_internal_RC ; + + typedef mpl::identity UserRangeCheckerQ ; + + typedef typename + mpl::eval_if::type + RangeChecker ; + + typedef non_rounding_converter NonRounding ; + typedef rounding_converter Rounding ; + + typedef mpl::identity NonRoundingQ ; + typedef mpl::identity RoundingQ ; + + typedef typename Traits::int_float_mixture int_float_mixture ; + + typedef typename + for_int_float_mixture::type + selector ; + + typedef typename selector::type type ; + } ; + + template< class Traits + ,class OverflowHandler + ,class Float2IntRounder + ,class RawConverter + ,class UserRangeChecker + > + struct get_converter_impl + { +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x0561 ) ) + // bcc55 prefers sometimes template parameters to be explicit local types. + // (notice that is is illegal to reuse the names like this) + typedef Traits Traits ; + typedef OverflowHandler OverflowHandler ; + typedef Float2IntRounder Float2IntRounder ; + typedef RawConverter RawConverter ; + typedef UserRangeChecker UserRangeChecker ; +#endif + + typedef trivial_converter_impl Trivial ; + typedef mpl::identity TrivialQ ; + + typedef get_non_trivial_converter< Traits + ,OverflowHandler + ,Float2IntRounder + ,RawConverter + ,UserRangeChecker + > NonTrivialQ ; + + typedef typename Traits::trivial trivial ; + + typedef typename mpl::eval_if::type type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/int_float_mixture.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/int_float_mixture.hpp new file mode 100644 index 00000000000..464e52753fe --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/int_float_mixture.hpp @@ -0,0 +1,72 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP + +#include "boost/config.hpp" +#include "boost/limits.hpp" + +#include "boost/numeric/conversion/int_float_mixture_enum.hpp" +#include "boost/numeric/conversion/detail/meta.hpp" + +#include "boost/mpl/integral_c.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + // Integral Constants for 'IntFloatMixture' + typedef mpl::integral_c int2int_c ; + typedef mpl::integral_c int2float_c ; + typedef mpl::integral_c float2int_c ; + typedef mpl::integral_c float2float_c ; + + // Metafunction: + // + // get_int_float_mixture::type + // + // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S. + // + template + struct get_int_float_mixture + { + typedef mpl::bool_< ::std::numeric_limits::is_integer > S_int ; + typedef mpl::bool_< ::std::numeric_limits::is_integer > T_int ; + + typedef typename + for_both::type + type ; + } ; + + // Metafunction: + // + // for_int_float_mixture::type + // + // {Mixture} is one of the Integral Constants for Mixture, declared above. + // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions) + // + // According to the value of 'IntFloatMixture', selects the corresponding type. + // + template + struct for_int_float_mixture + { + typedef typename + ct_switch4::type + type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/is_subranged.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/is_subranged.hpp new file mode 100644 index 00000000000..b5e7fe8f1e8 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/is_subranged.hpp @@ -0,0 +1,234 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP + +#include "boost/config.hpp" +#include "boost/limits.hpp" + +#include "boost/mpl/int.hpp" +#include "boost/mpl/multiplies.hpp" +#include "boost/mpl/less.hpp" +#include "boost/mpl/equal_to.hpp" + +#include "boost/type_traits/is_same.hpp" + +#include "boost/numeric/conversion/detail/meta.hpp" +#include "boost/numeric/conversion/detail/int_float_mixture.hpp" +#include "boost/numeric/conversion/detail/sign_mixture.hpp" +#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + //--------------------------------------------------------------- + // Implementations of the compile time predicate "T is subranged" + //--------------------------------------------------------------- + + // for integral to integral conversions + template + struct subranged_Sig2Unsig + { + // Signed to unsigned conversions are 'subranged' because of possible loose + // of negative values. + typedef mpl::true_ type ; + } ; + + // for unsigned integral to signed integral conversions + template + struct subranged_Unsig2Sig + { + // IMPORTANT NOTE: + // + // This code assumes that signed/unsigned integral values are represented + // such that: + // + // numeric_limits::digits + 1 == numeric_limits::digits + // + // The '+1' is required since numeric_limits<>::digits gives 1 bit less for signed integral types. + // + // This fact is used by the following logic: + // + // if ( (numeric_limits::digits+1) < (2*numeric_limits::digits) ) + // then the conversion is subranged. + // + + typedef mpl::int_< ::std::numeric_limits::digits > S_digits ; + typedef mpl::int_< ::std::numeric_limits::digits > T_digits ; + + // T is signed, so take digits+1 + typedef typename T_digits::next u_T_digits ; + + typedef mpl::int_<2> Two ; + + typedef typename mpl::multiplies::type S_digits_times_2 ; + + typedef typename mpl::less::type type ; + } ; + + // for integral to integral conversions of the same sign. + template + struct subranged_SameSign + { + // An integral conversion of the same sign is subranged if digits(T) < digits(S). + + typedef mpl::int_< ::std::numeric_limits::digits > S_digits ; + typedef mpl::int_< ::std::numeric_limits::digits > T_digits ; + + typedef typename mpl::less::type type ; + } ; + + // for integral to float conversions + template + struct subranged_Int2Float + { + typedef mpl::false_ type ; + } ; + + // for float to integral conversions + template + struct subranged_Float2Int + { + typedef mpl::true_ type ; + } ; + + // for float to float conversions + template + struct subranged_Float2Float + { + // If both T and S are floats, + // compare exponent bits and if they match, mantisa bits. + + typedef mpl::int_< ::std::numeric_limits::digits > S_mantisa ; + typedef mpl::int_< ::std::numeric_limits::digits > T_mantisa ; + + typedef mpl::int_< ::std::numeric_limits::max_exponent > S_exponent ; + typedef mpl::int_< ::std::numeric_limits::max_exponent > T_exponent ; + + typedef typename mpl::less::type T_smaller_exponent ; + + typedef typename mpl::equal_to::type equal_exponents ; + + typedef mpl::less T_smaller_mantisa ; + + typedef mpl::eval_if not_bigger_exponent_case ; + + typedef typename + mpl::eval_if::type + type ; + } ; + + // for Udt to built-in conversions + template + struct subranged_Udt2BuiltIn + { + typedef mpl::true_ type ; + } ; + + // for built-in to Udt conversions + template + struct subranged_BuiltIn2Udt + { + typedef mpl::false_ type ; + } ; + + // for Udt to Udt conversions + template + struct subranged_Udt2Udt + { + typedef mpl::false_ type ; + } ; + + //------------------------------------------------------------------- + // Selectors for the implementations of the subranged predicate + //------------------------------------------------------------------- + + template + struct get_subranged_Int2Int + { + typedef subranged_SameSign Sig2Sig ; + typedef subranged_Sig2Unsig Sig2Unsig ; + typedef subranged_Unsig2Sig Unsig2Sig ; + typedef Sig2Sig Unsig2Unsig ; + + typedef typename get_sign_mixture::type sign_mixture ; + + typedef typename + for_sign_mixture::type + type ; + } ; + + template + struct get_subranged_BuiltIn2BuiltIn + { + typedef get_subranged_Int2Int Int2IntQ ; + + typedef subranged_Int2Float Int2Float ; + typedef subranged_Float2Int Float2Int ; + typedef subranged_Float2Float Float2Float ; + + typedef mpl::identity Int2FloatQ ; + typedef mpl::identity Float2IntQ ; + typedef mpl::identity Float2FloatQ ; + + typedef typename get_int_float_mixture::type int_float_mixture ; + + typedef for_int_float_mixture for_ ; + + typedef typename for_::type selected ; + + typedef typename selected::type type ; + } ; + + template + struct get_subranged + { + typedef get_subranged_BuiltIn2BuiltIn BuiltIn2BuiltInQ ; + + typedef subranged_BuiltIn2Udt BuiltIn2Udt ; + typedef subranged_Udt2BuiltIn Udt2BuiltIn ; + typedef subranged_Udt2Udt Udt2Udt ; + + typedef mpl::identity BuiltIn2UdtQ ; + typedef mpl::identity Udt2BuiltInQ ; + typedef mpl::identity Udt2UdtQ ; + + typedef typename get_udt_builtin_mixture::type udt_builtin_mixture ; + + typedef typename + for_udt_builtin_mixture::type + selected ; + + typedef typename selected::type selected2 ; + + typedef typename selected2::type type ; + } ; + + + //------------------------------------------------------------------- + // Top level implementation selector. + //------------------------------------------------------------------- + template + struct get_is_subranged + { + typedef get_subranged non_trivial_case ; + typedef mpl::identity trivial_case ; + + typedef is_same is_trivial ; + + typedef typename mpl::if_::type selected ; + + typedef typename selected::type type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/meta.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/meta.hpp new file mode 100644 index 00000000000..246a1b4702d --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/meta.hpp @@ -0,0 +1,120 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP + +#include "boost/type_traits/remove_cv.hpp" + +#include "boost/mpl/if.hpp" +#include "boost/mpl/eval_if.hpp" +#include "boost/mpl/equal_to.hpp" +#include "boost/mpl/not.hpp" +#include "boost/mpl/and.hpp" +#include "boost/mpl/bool.hpp" +#include "boost/mpl/identity.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + template< class T1, class T2> + struct equal_to + { + #if !defined(__BORLANDC__) + + enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) }; + + BOOST_STATIC_CONSTANT(bool, value = x); + + typedef mpl::bool_ type; + + #else + + BOOST_STATIC_CONSTANT(bool, value = ( + BOOST_MPL_AUX_VALUE_WKND(T1)::value + == BOOST_MPL_AUX_VALUE_WKND(T2)::value + )); + + typedef mpl::bool_<( + BOOST_MPL_AUX_VALUE_WKND(T1)::value + == BOOST_MPL_AUX_VALUE_WKND(T2)::value + )> type; + #endif + }; + +// Metafunction: + // + // ct_switch4::type + // + // {Value,Case(X)Val} are Integral Constants (such as: mpl::int_<>) + // {Case(X)Type,DefaultType} are arbitrary types. (not metafunctions) + // + // Returns Case(X)Type if Val==Case(X)Val; DefaultType otherwise. + // + template + struct ct_switch4 + { + typedef mpl::identity Case0TypeQ ; + typedef mpl::identity Case1TypeQ ; + + typedef equal_to is_case0 ; + typedef equal_to is_case1 ; + typedef equal_to is_case2 ; + + typedef mpl::if_ choose_2_3Q ; + typedef mpl::eval_if choose_1_2_3Q ; + + typedef typename + mpl::eval_if::type + type ; + } ; + + + + + // Metafunction: + // + // for_both::type + // + // {exp0,expr1} are Boolean Integral Constants + // {TT,TF,FT,FF} are aribtrary types. (not metafunctions) + // + // According to the combined boolean value of 'expr0 && expr1', selects the corresponding type. + // + template + struct for_both + { + typedef mpl::identity TF_Q ; + typedef mpl::identity TT_Q ; + + typedef typename mpl::not_::type not_expr0 ; + typedef typename mpl::not_::type not_expr1 ; + + typedef typename mpl::and_::type caseTT ; + typedef typename mpl::and_::type caseTF ; + typedef typename mpl::and_::type caseFT ; + + typedef mpl::if_ choose_FT_FF_Q ; + typedef mpl::eval_if choose_TF_FT_FF_Q ; + + typedef typename mpl::eval_if::type type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/numeric_cast_traits.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/numeric_cast_traits.hpp new file mode 100644 index 00000000000..150490d935f --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/numeric_cast_traits.hpp @@ -0,0 +1,138 @@ +// +//! Copyright (c) 2011-2012 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + +#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES) + + #include + + #if !defined(BOOST_NO_LONG_LONG) + #include + #endif + +#else +#if !BOOST_PP_IS_ITERATING + + #include + #include + #include + + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_common.hpp") + #endif +// +//! Copyright (c) 2011-2012 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(preserve: 1) + #endif + + //! These are the assumed common built in fundamental types (not typedefs/macros.) + #define BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() \ + (char) \ + (signed char) \ + (unsigned char) \ + (short) \ + (unsigned short) \ + (int) \ + (unsigned int) \ + (long) \ + (unsigned long) \ + (float) \ + (double) \ + (long double) \ + /***/ + + #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() + #define BOOST_NUMERIC_CONVERSION_SEQ_B() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES() + +namespace boost { namespace numeric { + + #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) + #include BOOST_PP_ITERATE() + +}}//namespace boost::numeric; + + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(output: null) + #endif + + #if ( defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) ) || !defined(BOOST_NO_LONG_LONG) + + #undef BOOST_NUMERIC_CONVERSION_SEQ_A + #undef BOOST_NUMERIC_CONVERSION_SEQ_B + + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(preserve: 2, line: 0, output: "preprocessed/numeric_cast_traits_long_long.hpp") + #endif + +// +//! Copyright (c) 2011-2012 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(preserve: 1) + #endif + +namespace boost { namespace numeric { + + #define BOOST_NUMERIC_CONVERSION_SEQ_A() BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES()(boost::long_long_type)(boost::ulong_long_type) + #define BOOST_NUMERIC_CONVERSION_SEQ_B() (boost::long_long_type)(boost::ulong_long_type) + + #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_A())), )) + #include BOOST_PP_ITERATE() + +}}//namespace boost::numeric; + + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(output: null) + #endif + + #endif + + #undef BOOST_NUMERIC_CONVERSION_BASE_BUILTIN_TYPES + #undef BOOST_NUMERIC_CONVERSION_SEQ_A + #undef BOOST_NUMERIC_CONVERSION_SEQ_B + +#elif BOOST_PP_ITERATION_DEPTH() == 1 + + #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_SEQ_B())), )) + #include BOOST_PP_ITERATE() + +#elif BOOST_PP_ITERATION_DEPTH() == 2 + + //! Generate default traits for the specified source and target. + #define BOOST_NUMERIC_CONVERSION_A BOOST_PP_FRAME_ITERATION(1) + #define BOOST_NUMERIC_CONVERSION_B BOOST_PP_FRAME_ITERATION(2) + + template <> + struct numeric_cast_traits + < + BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_A, BOOST_NUMERIC_CONVERSION_SEQ_A()) + , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_SEQ_B()) + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + #undef BOOST_NUMERIC_CONVERSION_A + #undef BOOST_NUMERIC_CONVERSION_B + +#endif//! Depth 2. +#endif// BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/old_numeric_cast.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/old_numeric_cast.hpp new file mode 100644 index 00000000000..9901ed2ae34 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/old_numeric_cast.hpp @@ -0,0 +1,308 @@ +// boost cast.hpp header file ----------------------------------------------// + +// (C) Copyright Kevlin Henney and Dave Abrahams 1999. +// Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org/libs/conversion for Documentation. + +// Revision History +// 02 Jun 14 Remove VC6 workarounds. +// 16 Jul 11 Bugfixes for VC6. +// 23 JUN 05 Code extracted from /boost/cast.hpp into this new header. +// Keeps this legacy version of numeric_cast<> for old compilers +// wich can't compile the new version in /boost/numeric/conversion/cast.hpp +// (Fernando Cacciola) +// 02 Apr 01 Removed BOOST_NO_LIMITS workarounds and included +// instead (the workaround did not +// actually compile when BOOST_NO_LIMITS was defined in +// any case, so we loose nothing). (John Maddock) +// 21 Jan 01 Undid a bug I introduced yesterday. numeric_cast<> never +// worked with stock GCC; trying to get it to do that broke +// vc-stlport. +// 20 Jan 01 Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp. +// Removed unused BOOST_EXPLICIT_TARGET macro. Moved +// boost::detail::type to boost/type.hpp. Made it compile with +// stock gcc again (Dave Abrahams) +// 29 Nov 00 Remove nested namespace cast, cleanup spacing before Formal +// Review (Beman Dawes) +// 19 Oct 00 Fix numeric_cast for floating-point types (Dave Abrahams) +// 15 Jul 00 Suppress numeric_cast warnings for GCC, Borland and MSVC +// (Dave Abrahams) +// 30 Jun 00 More MSVC6 wordarounds. See comments below. (Dave Abrahams) +// 28 Jun 00 Removed implicit_cast<>. See comment below. (Beman Dawes) +// 27 Jun 00 More MSVC6 workarounds +// 15 Jun 00 Add workarounds for MSVC6 +// 2 Feb 00 Remove bad_numeric_cast ";" syntax error (Doncho Angelov) +// 26 Jan 00 Add missing throw() to bad_numeric_cast::what(0 (Adam Levar) +// 29 Dec 99 Change using declarations so usages in other namespaces work +// correctly (Dave Abrahams) +// 23 Sep 99 Change polymorphic_downcast assert to also detect M.I. errors +// as suggested Darin Adler and improved by Valentin Bonnard. +// 2 Sep 99 Remove controversial asserts, simplify, rename. +// 30 Aug 99 Move to cast.hpp, replace value_cast with numeric_cast, +// place in nested namespace. +// 3 Aug 99 Initial version + +#ifndef BOOST_OLD_NUMERIC_CAST_HPP +#define BOOST_OLD_NUMERIC_CAST_HPP + +# include +# include +# include +# include +# include +# include + +namespace boost +{ + using numeric::bad_numeric_cast; + +// LEGACY numeric_cast [only for some old broken compilers] --------------------------------------// + +// Contributed by Kevlin Henney + +// numeric_cast ------------------------------------------------------------// + +#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS) + + namespace detail + { + template + struct signed_numeric_limits : std::numeric_limits + { + static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () + { + return (std::numeric_limits::min)() >= 0 + // unary minus causes integral promotion, thus the static_cast<> + ? static_cast(-(std::numeric_limits::max)()) + : (std::numeric_limits::min)(); + }; + }; + + // Move to namespace boost in utility.hpp? + template + struct fixed_numeric_limits_base + : public if_true< std::numeric_limits::is_signed > + ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits, + std::numeric_limits + >::type + {}; + + template + struct fixed_numeric_limits + : fixed_numeric_limits_base::is_specialized)> + {}; + +# ifdef BOOST_HAS_LONG_LONG + // cover implementations which supply no specialization for long + // long / unsigned long long. Not intended to be full + // numeric_limits replacements, but good enough for numeric_cast<> + template <> + struct fixed_numeric_limits_base< ::boost::long_long_type, false> + { + BOOST_STATIC_CONSTANT(bool, is_specialized = true); + BOOST_STATIC_CONSTANT(bool, is_signed = true); + static ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION () + { +# ifdef LONGLONG_MAX + return LONGLONG_MAX; +# else + return 9223372036854775807LL; // hope this is portable +# endif + } + + static ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () + { +# ifdef LONGLONG_MIN + return LONGLONG_MIN; +# else + return -( 9223372036854775807LL )-1; // hope this is portable +# endif + } + }; + + template <> + struct fixed_numeric_limits_base< ::boost::ulong_long_type, false> + { + BOOST_STATIC_CONSTANT(bool, is_specialized = true); + BOOST_STATIC_CONSTANT(bool, is_signed = false); + static ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION () + { +# ifdef ULONGLONG_MAX + return ULONGLONG_MAX; +# else + return 0xffffffffffffffffULL; // hope this is portable +# endif + } + + static ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; } + }; +# endif + } // namespace detail + +// less_than_type_min - + // x_is_signed should be numeric_limits::is_signed + // y_is_signed should be numeric_limits::is_signed + // y_min should be numeric_limits::min() + // + // check(x, y_min) returns true iff x < y_min without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct less_than_type_min + { + template + static bool check(X x, Y y_min) + { return x < y_min; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X, Y) + { return false; } + }; + + template <> + struct less_than_type_min + { + template + static bool check(X x, Y) + { return x < 0; } + }; + + // greater_than_type_max - + // same_sign should be: + // numeric_limits::is_signed == numeric_limits::is_signed + // y_max should be numeric_limits::max() + // + // check(x, y_max) returns true iff x > y_max without invoking comparisons + // between signed and unsigned values. + // + // "poor man's partial specialization" is in use here. + template + struct greater_than_type_max; + + template<> + struct greater_than_type_max + { + template + static inline bool check(X x, Y y_max) + { return x > y_max; } + }; + + template <> + struct greater_than_type_max + { + // What does the standard say about this? I think it's right, and it + // will work with every compiler I know of. + template + static inline bool check(X x, Y) + { return x >= 0 && static_cast(static_cast(x)) != x; } + }; + + template<> + struct greater_than_type_max + { + template + static inline bool check(X x, Y y_max) + { return x > y_max; } + }; + + template <> + struct greater_than_type_max + { + // What does the standard say about this? I think it's right, and it + // will work with every compiler I know of. + template + static inline bool check(X x, Y) + { return static_cast(static_cast(x)) != x; } + }; + +#else // use #pragma hacks if available + + namespace detail + { +# if BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4018) +# pragma warning(disable : 4146) +#elif defined(__BORLANDC__) +# pragma option push -w-8041 +# endif + + // Move to namespace boost in utility.hpp? + template + struct fixed_numeric_limits : public std::numeric_limits + { + static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION () + { + return std::numeric_limits::is_signed && (std::numeric_limits::min)() >= 0 + ? T(-(std::numeric_limits::max)()) : (std::numeric_limits::min)(); + } + }; + +# if BOOST_MSVC +# pragma warning(pop) +#elif defined(__BORLANDC__) +# pragma option pop +# endif + } // namespace detail + +#endif + + template + inline Target numeric_cast(Source arg) + { + // typedefs abbreviating respective trait classes + typedef detail::fixed_numeric_limits arg_traits; + typedef detail::fixed_numeric_limits result_traits; + +#if defined(BOOST_STRICT_CONFIG) \ + || (!defined(__HP_aCC) || __HP_aCC > 33900) \ + && (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \ + || defined(BOOST_SGI_CPP_LIMITS)) + // typedefs that act as compile time assertions + // (to be replaced by boost compile time assertions + // as and when they become available and are stable) + typedef bool argument_must_be_numeric[arg_traits::is_specialized]; + typedef bool result_must_be_numeric[result_traits::is_specialized]; + + const bool arg_is_signed = arg_traits::is_signed; + const bool result_is_signed = result_traits::is_signed; + const bool same_sign = arg_is_signed == result_is_signed; + + if (less_than_type_min::check(arg, (result_traits::min)()) + || greater_than_type_max::check(arg, (result_traits::max)()) + ) + +#else // We need to use #pragma hacks if available + +# if BOOST_MSVC +# pragma warning(push) +# pragma warning(disable : 4018) +#elif defined(__BORLANDC__) +#pragma option push -w-8012 +# endif + if ((arg < 0 && !result_traits::is_signed) // loss of negative range + || (arg_traits::is_signed && arg < (result_traits::min)()) // underflow + || arg > (result_traits::max)()) // overflow +# if BOOST_MSVC +# pragma warning(pop) +#elif defined(__BORLANDC__) +#pragma option pop +# endif +#endif + { + throw bad_numeric_cast(); + } + return static_cast(arg); + } // numeric_cast + +} // namespace boost + +#endif // BOOST_OLD_NUMERIC_CAST_HPP diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp new file mode 100644 index 00000000000..01dc9321b3c --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_common.hpp @@ -0,0 +1,1741 @@ +// +//! Copyright (c) 2011-2012 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// + + + +namespace boost { namespace numeric { + + template <> + struct numeric_cast_traits + < + char + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , signed char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , unsigned char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , unsigned short + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , unsigned int + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , unsigned long + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; +}} diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp new file mode 100644 index 00000000000..b358b9c41f5 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits_long_long.hpp @@ -0,0 +1,347 @@ +// +//! Copyright (c) 2011-2012 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +namespace boost { namespace numeric { + + + template <> + struct numeric_cast_traits + < + char + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + signed char + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned char + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + short + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned short + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + int + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned int + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + unsigned long + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::long_long_type + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::long_long_type + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::ulong_long_type + , boost::long_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::ulong_long_type + , boost::ulong_long_type + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; +}} diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/sign_mixture.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/sign_mixture.hpp new file mode 100644 index 00000000000..c7f9e42afe8 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/sign_mixture.hpp @@ -0,0 +1,72 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP + +#include "boost/config.hpp" +#include "boost/limits.hpp" + +#include "boost/numeric/conversion/sign_mixture_enum.hpp" +#include "boost/numeric/conversion/detail/meta.hpp" + +#include "boost/mpl/integral_c.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + // Integral Constants for 'SignMixture' + typedef mpl::integral_c unsig2unsig_c ; + typedef mpl::integral_c sig2sig_c ; + typedef mpl::integral_c sig2unsig_c ; + typedef mpl::integral_c unsig2sig_c ; + + // Metafunction: + // + // get_sign_mixture::type + // + // Selects the appropriate SignMixture Integral Constant for the combination T,S. + // + template + struct get_sign_mixture + { + typedef mpl::bool_< ::std::numeric_limits::is_signed > S_signed ; + typedef mpl::bool_< ::std::numeric_limits::is_signed > T_signed ; + + typedef typename + for_both::type + type ; + } ; + + // Metafunction: + // + // for_sign_mixture::type + // + // {SignMixture} is one of the Integral Constants for SignMixture, declared above. + // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions) + // + // According to the value of 'SignMixture', selects the corresponding type. + // + template + struct for_sign_mixture + { + typedef typename + ct_switch4::type + type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp new file mode 100644 index 00000000000..36dbc491b5e --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/detail/udt_builtin_mixture.hpp @@ -0,0 +1,69 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP + +#include "boost/type_traits/is_arithmetic.hpp" + +#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp" +#include "boost/numeric/conversion/detail/meta.hpp" + +#include "boost/mpl/integral_c.hpp" + +namespace boost { namespace numeric { namespace convdetail +{ + // Integral Constants for 'UdtMixture' + typedef mpl::integral_c builtin2builtin_c ; + typedef mpl::integral_c builtin2udt_c ; + typedef mpl::integral_c udt2builtin_c ; + typedef mpl::integral_c udt2udt_c ; + + // Metafunction: + // + // for_udt_mixture::type + // + // {UdtMixture} is one of the Integral Constants for UdMixture, declared above. + // {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions) + // + // According to the value of 'UdtMixture', selects the corresponding type. + // + template + struct for_udt_builtin_mixture + { + typedef typename + ct_switch4::type + type ; + } ; + + // Metafunction: + // + // get_udt_mixture::type + // + // Selects the appropriate UdtMixture Integral Constant for the combination T,S. + // + template + struct get_udt_builtin_mixture + { + typedef is_arithmetic S_builtin ; + typedef is_arithmetic T_builtin ; + + typedef typename + for_both::type + type ; + } ; + +} } } // namespace boost::numeric::convdetail + +#endif + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/int_float_mixture_enum.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/int_float_mixture_enum.hpp new file mode 100644 index 00000000000..d0c2daacfc8 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/int_float_mixture_enum.hpp @@ -0,0 +1,29 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP + +namespace boost { namespace numeric +{ + enum int_float_mixture_enum + { + integral_to_integral + ,integral_to_float + ,float_to_integral + ,float_to_float + } ; + +} } // namespace boost::numeric + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/numeric_cast_traits.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/numeric_cast_traits.hpp new file mode 100644 index 00000000000..e24296bc7ec --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/numeric_cast_traits.hpp @@ -0,0 +1,31 @@ +// +//! Copyright (c) 2011 +//! Brandon Kohn +// +// Distributed under the Boost Software License, Version 1.0. (See +// accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) +// +#ifndef BOOST_NUMERIC_CAST_TRAITS_HPP +#define BOOST_NUMERIC_CAST_TRAITS_HPP + +#include + +namespace boost { namespace numeric { + + template + struct numeric_cast_traits + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + +}}//namespace boost::numeric; + +#if !defined( BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS ) +#include +#include +#endif//!defined BOOST_NUMERIC_CONVERSION_RELAX_BUILT_IN_CAST_TRAITS + +#endif//BOOST_NUMERIC_CAST_TRAITS_HPP diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/sign_mixture_enum.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/sign_mixture_enum.hpp new file mode 100644 index 00000000000..1525f8d33ce --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/sign_mixture_enum.hpp @@ -0,0 +1,29 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP + +namespace boost { namespace numeric +{ + enum sign_mixture_enum + { + unsigned_to_unsigned + ,signed_to_signed + ,signed_to_unsigned + ,unsigned_to_signed + } ; + +} } // namespace boost::numeric + +#endif +// +/////////////////////////////////////////////////////////////////////////////////////////////// + + diff --git a/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/udt_builtin_mixture_enum.hpp b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/udt_builtin_mixture_enum.hpp new file mode 100644 index 00000000000..2540e806308 --- /dev/null +++ b/contrib/restricted/boost/numeric_conversion/include/boost/numeric/conversion/udt_builtin_mixture_enum.hpp @@ -0,0 +1,26 @@ +// (c) Copyright Fernando Luis Cacciola Carballal 2000-2004 +// Use, modification, and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See library home page at http://www.boost.org/libs/numeric/conversion +// +// Contact the author at: fernando_cacciola@hotmail.com +// +#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP +#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP + +namespace boost { namespace numeric +{ + enum udt_builtin_mixture_enum + { + builtin_to_builtin + ,builtin_to_udt + ,udt_to_builtin + ,udt_to_udt + } ; + +} } // namespace boost::numeric + +#endif + -- cgit v1.3