From 0f2eab3665c1a49a5095eef05865341aec01291c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20K=C3=BCmmel?= Date: Sun, 20 Nov 2011 18:58:15 +0000 Subject: [PATCH] update boost to version 1.48 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40230 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/boost/config/auto_link.hpp | 2 +- boost/boost/config/compiler/borland.hpp | 1 + boost/boost/config/compiler/clang.hpp | 1 + boost/boost/config/compiler/common_edg.hpp | 1 + boost/boost/config/compiler/cray.hpp | 61 + boost/boost/config/compiler/digitalmars.hpp | 1 + boost/boost/config/compiler/gcc.hpp | 4 + boost/boost/config/compiler/gcc_xml.hpp | 1 + boost/boost/config/compiler/hp_acc.hpp | 1 + boost/boost/config/compiler/intel.hpp | 7 +- boost/boost/config/compiler/metrowerks.hpp | 1 + boost/boost/config/compiler/mpw.hpp | 1 + boost/boost/config/compiler/pathscale.hpp | 1 + boost/boost/config/compiler/pgi.hpp | 1 + boost/boost/config/compiler/sunpro_cc.hpp | 1 + boost/boost/config/compiler/vacpp.hpp | 1 + boost/boost/config/compiler/visualc.hpp | 1 + boost/boost/config/platform/cray.hpp | 18 + boost/boost/config/platform/win32.hpp | 2 + boost/boost/config/select_compiler_config.hpp | 4 + boost/boost/config/select_platform_config.hpp | 6 +- boost/boost/config/suffix.hpp | 7 + boost/boost/current_function.hpp | 3 +- boost/boost/detail/container_fwd.hpp | 97 +- boost/boost/detail/fenv.hpp | 73 + boost/boost/function/function_template.hpp | 2 +- boost/boost/integer_traits.hpp | 2 +- boost/boost/lexical_cast.hpp | 2059 +++++++++-------- boost/boost/math/policies/policy.hpp | 959 ++++++++ .../special_functions/detail/fp_traits.hpp | 570 +++++ .../special_functions/detail/round_fwd.hpp | 80 + .../math/special_functions/fpclassify.hpp | 533 +++++ .../boost/math/special_functions/math_fwd.hpp | 1070 +++++++++ boost/boost/math/special_functions/sign.hpp | 145 ++ boost/boost/math/tools/config.hpp | 310 +++ boost/boost/math/tools/promotion.hpp | 150 ++ boost/boost/math/tools/real_cast.hpp | 29 + boost/boost/math/tools/user.hpp | 97 + boost/boost/mpl/comparison.hpp | 24 + boost/boost/mpl/greater.hpp | 21 + boost/boost/mpl/greater_equal.hpp | 21 + boost/boost/mpl/less_equal.hpp | 21 + boost/boost/mpl/limits/list.hpp | 21 + boost/boost/mpl/list.hpp | 57 + boost/boost/mpl/list/aux_/O1_size.hpp | 33 + boost/boost/mpl/list/aux_/begin_end.hpp | 44 + boost/boost/mpl/list/aux_/clear.hpp | 34 + boost/boost/mpl/list/aux_/empty.hpp | 34 + boost/boost/mpl/list/aux_/front.hpp | 33 + .../mpl/list/aux_/include_preprocessed.hpp | 35 + boost/boost/mpl/list/aux_/item.hpp | 55 + boost/boost/mpl/list/aux_/iterator.hpp | 76 + boost/boost/mpl/list/aux_/numbered.hpp | 68 + boost/boost/mpl/list/aux_/numbered_c.hpp | 71 + boost/boost/mpl/list/aux_/pop_front.hpp | 34 + .../list/aux_/preprocessed/plain/list10.hpp | 149 ++ .../list/aux_/preprocessed/plain/list10_c.hpp | 164 ++ .../list/aux_/preprocessed/plain/list20.hpp | 169 ++ .../list/aux_/preprocessed/plain/list20_c.hpp | 173 ++ .../list/aux_/preprocessed/plain/list30.hpp | 189 ++ .../list/aux_/preprocessed/plain/list30_c.hpp | 183 ++ .../list/aux_/preprocessed/plain/list40.hpp | 209 ++ .../list/aux_/preprocessed/plain/list40_c.hpp | 193 ++ .../list/aux_/preprocessed/plain/list50.hpp | 229 ++ .../list/aux_/preprocessed/plain/list50_c.hpp | 203 ++ boost/boost/mpl/list/aux_/push_back.hpp | 36 + boost/boost/mpl/list/aux_/push_front.hpp | 39 + boost/boost/mpl/list/aux_/size.hpp | 33 + boost/boost/mpl/list/aux_/tag.hpp | 24 + boost/boost/mpl/list/list0.hpp | 42 + boost/boost/mpl/list/list0_c.hpp | 31 + boost/boost/mpl/list/list10.hpp | 43 + boost/boost/mpl/list/list10_c.hpp | 43 + boost/boost/mpl/list/list20.hpp | 43 + boost/boost/mpl/list/list20_c.hpp | 43 + boost/boost/mpl/list/list30.hpp | 43 + boost/boost/mpl/list/list30_c.hpp | 43 + boost/boost/mpl/list/list40.hpp | 43 + boost/boost/mpl/list/list40_c.hpp | 43 + boost/boost/mpl/list/list50.hpp | 43 + boost/boost/mpl/list/list50_c.hpp | 43 + boost/boost/mpl/not_equal_to.hpp | 21 + boost/boost/mpl/remove_if.hpp | 83 + boost/boost/numeric/conversion/cast.hpp | 32 +- .../conversion/detail/numeric_cast_traits.hpp | 105 + .../preprocessed/numeric_cast_traits.hpp | 1751 ++++++++++++++ .../conversion/numeric_cast_traits.hpp | 31 + boost/boost/regex/icu.hpp | 26 +- .../boost/regex/pending/unicode_iterator.hpp | 71 +- boost/boost/regex/v4/basic_regex.hpp | 2 +- boost/boost/regex/v4/basic_regex_creator.hpp | 25 +- boost/boost/regex/v4/basic_regex_parser.hpp | 6 +- boost/boost/regex/v4/regex_format.hpp | 10 +- .../detail/sp_counted_base_gcc_mips.hpp | 9 + boost/boost/smart_ptr/detail/sp_has_sync.hpp | 4 + boost/boost/smart_ptr/shared_array.hpp | 20 +- boost/boost/smart_ptr/shared_ptr.hpp | 12 +- boost/boost/smart_ptr/weak_ptr.hpp | 18 +- boost/boost/type_traits.hpp | 7 +- .../type_traits/add_rvalue_reference.hpp | 6 +- .../type_traits/detail/bool_trait_def.hpp | 16 +- .../type_traits/detail/bool_trait_undef.hpp | 5 +- .../detail/has_binary_operator.hpp | 229 ++ .../detail/has_postfix_operator.hpp | 202 ++ .../detail/has_prefix_operator.hpp | 210 ++ boost/boost/type_traits/has_bit_and.hpp | 49 + .../boost/type_traits/has_bit_and_assign.hpp | 55 + boost/boost/type_traits/has_bit_or.hpp | 49 + boost/boost/type_traits/has_bit_or_assign.hpp | 55 + boost/boost/type_traits/has_bit_xor.hpp | 49 + .../boost/type_traits/has_bit_xor_assign.hpp | 55 + boost/boost/type_traits/has_complement.hpp | 32 + boost/boost/type_traits/has_dereference.hpp | 31 + boost/boost/type_traits/has_divides.hpp | 40 + .../boost/type_traits/has_divides_assign.hpp | 47 + boost/boost/type_traits/has_equal_to.hpp | 49 + boost/boost/type_traits/has_greater.hpp | 49 + boost/boost/type_traits/has_greater_equal.hpp | 49 + boost/boost/type_traits/has_left_shift.hpp | 49 + .../type_traits/has_left_shift_assign.hpp | 55 + boost/boost/type_traits/has_less.hpp | 49 + boost/boost/type_traits/has_less_equal.hpp | 49 + boost/boost/type_traits/has_logical_and.hpp | 40 + boost/boost/type_traits/has_logical_not.hpp | 23 + boost/boost/type_traits/has_logical_or.hpp | 40 + boost/boost/type_traits/has_minus.hpp | 60 + boost/boost/type_traits/has_minus_assign.hpp | 65 + boost/boost/type_traits/has_modulus.hpp | 49 + .../boost/type_traits/has_modulus_assign.hpp | 55 + boost/boost/type_traits/has_multiplies.hpp | 40 + .../type_traits/has_multiplies_assign.hpp | 47 + boost/boost/type_traits/has_negate.hpp | 25 + boost/boost/type_traits/has_not_equal_to.hpp | 49 + boost/boost/type_traits/has_operator.hpp | 51 + boost/boost/type_traits/has_plus.hpp | 54 + boost/boost/type_traits/has_plus_assign.hpp | 66 + .../boost/type_traits/has_post_decrement.hpp | 40 + .../boost/type_traits/has_post_increment.hpp | 40 + boost/boost/type_traits/has_pre_decrement.hpp | 40 + boost/boost/type_traits/has_pre_increment.hpp | 40 + boost/boost/type_traits/has_right_shift.hpp | 49 + .../type_traits/has_right_shift_assign.hpp | 55 + boost/boost/type_traits/has_unary_minus.hpp | 25 + boost/boost/type_traits/has_unary_plus.hpp | 23 + boost/boost/type_traits/intrinsics.hpp | 70 +- boost/boost/type_traits/is_unsigned.hpp | 2 +- boost/boost/type_traits/remove_cv.hpp | 3 +- boost/boost/typeof/typeof.hpp | 17 +- boost/boost/version.hpp | 4 +- boost/libs/regex/src/c_regex_traits.cpp | 21 +- boost/libs/regex/src/cregex.cpp | 17 +- boost/libs/regex/src/fileiter.cpp | 10 +- boost/libs/regex/src/internals.hpp | 35 + boost/libs/regex/src/posix_api.cpp | 10 +- boost/libs/regex/src/wc_regex_traits.cpp | 21 +- boost/libs/regex/src/wide_posix_api.cpp | 16 +- 156 files changed, 13301 insertions(+), 1094 deletions(-) create mode 100644 boost/boost/config/compiler/cray.hpp create mode 100644 boost/boost/config/platform/cray.hpp create mode 100644 boost/boost/detail/fenv.hpp create mode 100644 boost/boost/math/policies/policy.hpp create mode 100644 boost/boost/math/special_functions/detail/fp_traits.hpp create mode 100644 boost/boost/math/special_functions/detail/round_fwd.hpp create mode 100644 boost/boost/math/special_functions/fpclassify.hpp create mode 100644 boost/boost/math/special_functions/math_fwd.hpp create mode 100644 boost/boost/math/special_functions/sign.hpp create mode 100644 boost/boost/math/tools/config.hpp create mode 100644 boost/boost/math/tools/promotion.hpp create mode 100644 boost/boost/math/tools/real_cast.hpp create mode 100644 boost/boost/math/tools/user.hpp create mode 100644 boost/boost/mpl/comparison.hpp create mode 100644 boost/boost/mpl/greater.hpp create mode 100644 boost/boost/mpl/greater_equal.hpp create mode 100644 boost/boost/mpl/less_equal.hpp create mode 100644 boost/boost/mpl/limits/list.hpp create mode 100644 boost/boost/mpl/list.hpp create mode 100644 boost/boost/mpl/list/aux_/O1_size.hpp create mode 100644 boost/boost/mpl/list/aux_/begin_end.hpp create mode 100644 boost/boost/mpl/list/aux_/clear.hpp create mode 100644 boost/boost/mpl/list/aux_/empty.hpp create mode 100644 boost/boost/mpl/list/aux_/front.hpp create mode 100644 boost/boost/mpl/list/aux_/include_preprocessed.hpp create mode 100644 boost/boost/mpl/list/aux_/item.hpp create mode 100644 boost/boost/mpl/list/aux_/iterator.hpp create mode 100644 boost/boost/mpl/list/aux_/numbered.hpp create mode 100644 boost/boost/mpl/list/aux_/numbered_c.hpp create mode 100644 boost/boost/mpl/list/aux_/pop_front.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list10.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list10_c.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list20.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list20_c.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list30.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list30_c.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list40.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list40_c.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list50.hpp create mode 100644 boost/boost/mpl/list/aux_/preprocessed/plain/list50_c.hpp create mode 100644 boost/boost/mpl/list/aux_/push_back.hpp create mode 100644 boost/boost/mpl/list/aux_/push_front.hpp create mode 100644 boost/boost/mpl/list/aux_/size.hpp create mode 100644 boost/boost/mpl/list/aux_/tag.hpp create mode 100644 boost/boost/mpl/list/list0.hpp create mode 100644 boost/boost/mpl/list/list0_c.hpp create mode 100644 boost/boost/mpl/list/list10.hpp create mode 100644 boost/boost/mpl/list/list10_c.hpp create mode 100644 boost/boost/mpl/list/list20.hpp create mode 100644 boost/boost/mpl/list/list20_c.hpp create mode 100644 boost/boost/mpl/list/list30.hpp create mode 100644 boost/boost/mpl/list/list30_c.hpp create mode 100644 boost/boost/mpl/list/list40.hpp create mode 100644 boost/boost/mpl/list/list40_c.hpp create mode 100644 boost/boost/mpl/list/list50.hpp create mode 100644 boost/boost/mpl/list/list50_c.hpp create mode 100644 boost/boost/mpl/not_equal_to.hpp create mode 100644 boost/boost/mpl/remove_if.hpp create mode 100644 boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp create mode 100644 boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp create mode 100644 boost/boost/numeric/conversion/numeric_cast_traits.hpp create mode 100644 boost/boost/type_traits/detail/has_binary_operator.hpp create mode 100644 boost/boost/type_traits/detail/has_postfix_operator.hpp create mode 100644 boost/boost/type_traits/detail/has_prefix_operator.hpp create mode 100644 boost/boost/type_traits/has_bit_and.hpp create mode 100644 boost/boost/type_traits/has_bit_and_assign.hpp create mode 100644 boost/boost/type_traits/has_bit_or.hpp create mode 100644 boost/boost/type_traits/has_bit_or_assign.hpp create mode 100644 boost/boost/type_traits/has_bit_xor.hpp create mode 100644 boost/boost/type_traits/has_bit_xor_assign.hpp create mode 100644 boost/boost/type_traits/has_complement.hpp create mode 100644 boost/boost/type_traits/has_dereference.hpp create mode 100644 boost/boost/type_traits/has_divides.hpp create mode 100644 boost/boost/type_traits/has_divides_assign.hpp create mode 100644 boost/boost/type_traits/has_equal_to.hpp create mode 100644 boost/boost/type_traits/has_greater.hpp create mode 100644 boost/boost/type_traits/has_greater_equal.hpp create mode 100644 boost/boost/type_traits/has_left_shift.hpp create mode 100644 boost/boost/type_traits/has_left_shift_assign.hpp create mode 100644 boost/boost/type_traits/has_less.hpp create mode 100644 boost/boost/type_traits/has_less_equal.hpp create mode 100644 boost/boost/type_traits/has_logical_and.hpp create mode 100644 boost/boost/type_traits/has_logical_not.hpp create mode 100644 boost/boost/type_traits/has_logical_or.hpp create mode 100644 boost/boost/type_traits/has_minus.hpp create mode 100644 boost/boost/type_traits/has_minus_assign.hpp create mode 100644 boost/boost/type_traits/has_modulus.hpp create mode 100644 boost/boost/type_traits/has_modulus_assign.hpp create mode 100644 boost/boost/type_traits/has_multiplies.hpp create mode 100644 boost/boost/type_traits/has_multiplies_assign.hpp create mode 100644 boost/boost/type_traits/has_negate.hpp create mode 100644 boost/boost/type_traits/has_not_equal_to.hpp create mode 100644 boost/boost/type_traits/has_operator.hpp create mode 100644 boost/boost/type_traits/has_plus.hpp create mode 100644 boost/boost/type_traits/has_plus_assign.hpp create mode 100644 boost/boost/type_traits/has_post_decrement.hpp create mode 100644 boost/boost/type_traits/has_post_increment.hpp create mode 100644 boost/boost/type_traits/has_pre_decrement.hpp create mode 100644 boost/boost/type_traits/has_pre_increment.hpp create mode 100644 boost/boost/type_traits/has_right_shift.hpp create mode 100644 boost/boost/type_traits/has_right_shift_assign.hpp create mode 100644 boost/boost/type_traits/has_unary_minus.hpp create mode 100644 boost/boost/type_traits/has_unary_plus.hpp create mode 100644 boost/libs/regex/src/internals.hpp diff --git a/boost/boost/config/auto_link.hpp b/boost/boost/config/auto_link.hpp index f5a0a007b4..05b47fb430 100644 --- a/boost/boost/config/auto_link.hpp +++ b/boost/boost/config/auto_link.hpp @@ -364,7 +364,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. #ifdef BOOST_AUTO_LINK_TAGGED # pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") # ifdef BOOST_LIB_DIAGNOSTIC -# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") +# pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") # endif #elif defined(BOOST_AUTO_LINK_NOMANGLE) # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") diff --git a/boost/boost/config/compiler/borland.hpp b/boost/boost/config/compiler/borland.hpp index 60f5505547..680e87bde8 100644 --- a/boost/boost/config/compiler/borland.hpp +++ b/boost/boost/config/compiler/borland.hpp @@ -172,6 +172,7 @@ #define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_CONSTEXPR +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS diff --git a/boost/boost/config/compiler/clang.hpp b/boost/boost/config/compiler/clang.hpp index 623452cd23..9f4adf8234 100644 --- a/boost/boost/config/compiler/clang.hpp +++ b/boost/boost/config/compiler/clang.hpp @@ -35,6 +35,7 @@ # define BOOST_NO_DECLTYPE #endif +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #if !__has_feature(cxx_deleted_functions) diff --git a/boost/boost/config/compiler/common_edg.hpp b/boost/boost/config/compiler/common_edg.hpp index c98c4751eb..10333ad2d3 100644 --- a/boost/boost/config/compiler/common_edg.hpp +++ b/boost/boost/config/compiler/common_edg.hpp @@ -76,6 +76,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/cray.hpp b/boost/boost/config/compiler/cray.hpp new file mode 100644 index 0000000000..ad2eeaf55b --- /dev/null +++ b/boost/boost/config/compiler/cray.hpp @@ -0,0 +1,61 @@ +// (C) Copyright John Maddock 2011. +// Use, modification and distribution are 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 http://www.boost.org for most recent version. + +// Greenhills C compiler setup: + +#define BOOST_COMPILER "Cray C version " BOOST_STRINGIZE(_RELEASE) + +#if _RELEASE < 7 +# error "Boost is not configured for Cray compilers prior to version 7, please try the configure script." +#endif + +// +// Check this is a recent EDG based compiler, otherwise we don't support it here: +// +#ifndef __EDG_VERSION__ +# error "Unsupported Cray compiler, please try running the configure script." +#endif + +#include "boost/config/compiler/common_edg.hpp" + +// +// Cray peculiarities, probably version 7 specific: +// +#undef BOOST_NO_AUTO_DECLARATIONS +#undef BOOST_NO_AUTO_MULTIDECLARATIONS +#define BOOST_HAS_NRVO +#define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX +#define BOOST_NO_UNICODE_LITERALS +#define BOOST_NO_TWO_PHASE_NAME_LOOKUP +#define BOOST_HAS_NRVO +#define BOOST_NO_TEMPLATE_ALIASES +#define BOOST_NO_STATIC_ASSERT +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_SCOPED_ENUMS +#define BOOST_NO_RVALUE_REFERENCES +#define BOOST_NO_RAW_LITERALS +#define BOOST_NO_NULLPTR +#define BOOST_NO_NOEXCEPT +#define BOOST_NO_LAMBDAS +#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS +#define BOOST_NO_DELETED_FUNCTIONS +#define BOOST_NO_DEFAULTED_FUNCTIONS +#define BOOST_NO_DECLTYPE_N3276 +#define BOOST_NO_DECLTYPE +#define BOOST_NO_CONSTEXPR +#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION +#define BOOST_NO_CHAR32_T +#define BOOST_NO_CHAR16_T +//#define BOOST_BCB_PARTIAL_SPECIALIZATION_BUG +#define BOOST_MATH_DISABLE_STD_FPCLASSIFY +//#define BOOST_HAS_FPCLASSIFY + +#define BOOST_SP_USE_PTHREADS +#define BOOST_AC_USE_PTHREADS + diff --git a/boost/boost/config/compiler/digitalmars.hpp b/boost/boost/config/compiler/digitalmars.hpp index 27d6b8e498..ed92306fb1 100644 --- a/boost/boost/config/compiler/digitalmars.hpp +++ b/boost/boost/config/compiler/digitalmars.hpp @@ -66,6 +66,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/gcc.hpp b/boost/boost/config/compiler/gcc.hpp index 90db8c56df..5a69cb4931 100644 --- a/boost/boost/config/compiler/gcc.hpp +++ b/boost/boost/config/compiler/gcc.hpp @@ -217,6 +217,10 @@ #define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX #endif +// C++0x features not supported at all yet +// +#define BOOST_NO_DECLTYPE_N3276 + #ifndef BOOST_COMPILER # define BOOST_COMPILER "GNU C++ version " __VERSION__ #endif diff --git a/boost/boost/config/compiler/gcc_xml.hpp b/boost/boost/config/compiler/gcc_xml.hpp index 54a9ae1bc6..61dcedcc6f 100644 --- a/boost/boost/config/compiler/gcc_xml.hpp +++ b/boost/boost/config/compiler/gcc_xml.hpp @@ -31,6 +31,7 @@ # define BOOST_NO_NULLPTR # define BOOST_NO_TEMPLATE_ALIASES # define BOOST_NO_DECLTYPE +# define BOOST_NO_DECLTYPE_N3276 # define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS # define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_STATIC_ASSERT diff --git a/boost/boost/config/compiler/hp_acc.hpp b/boost/boost/config/compiler/hp_acc.hpp index cc0c0af5bc..0d73b28752 100644 --- a/boost/boost/config/compiler/hp_acc.hpp +++ b/boost/boost/config/compiler/hp_acc.hpp @@ -98,6 +98,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/intel.hpp b/boost/boost/config/compiler/intel.hpp index faa080fc6b..eb4d81404e 100644 --- a/boost/boost/config/compiler/intel.hpp +++ b/boost/boost/config/compiler/intel.hpp @@ -27,7 +27,7 @@ #endif // Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x' -#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && __STDC_HOSTED__) || defined(__GXX_EXPERIMENTAL_CPP0X__) +#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && (__STDC_HOSTED__ && (BOOST_INTEL_CXX_VERSION <= 1200))) || defined(__GXX_EXPERIMENTAL_CPP0X__) # define BOOST_INTEL_STDCXX0X #endif #if defined(_MSC_VER) && (_MSC_VER >= 1600) @@ -179,8 +179,9 @@ template<> struct assert_intrinsic_wchar_t {}; // intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some // cases when it should be value-initialized. // (Niels Dekker, LKEB, May 2010) +// Apparently Intel 12.1 (compiler version number 9999 !!) has the same issue (compiler regression). #if defined(__INTEL_COMPILER) -# if __INTEL_COMPILER <= 1110 +# if (__INTEL_COMPILER <= 1110) || (__INTEL_COMPILER == 9999) # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION # endif #endif @@ -210,7 +211,7 @@ template<> struct assert_intrinsic_wchar_t {}; #endif #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200) -# undef BOOST_NO_RVALUE_REFERENCES +//# undef BOOST_NO_RVALUE_REFERENCES // Enabling this breaks Filesystem and Exception libraries //# undef BOOST_NO_SCOPED_ENUMS // doesn't really work!! # undef BOOST_NO_DELETED_FUNCTIONS # undef BOOST_NO_DEFAULTED_FUNCTIONS diff --git a/boost/boost/config/compiler/metrowerks.hpp b/boost/boost/config/compiler/metrowerks.hpp index fb0401fea4..02baecddee 100644 --- a/boost/boost/config/compiler/metrowerks.hpp +++ b/boost/boost/config/compiler/metrowerks.hpp @@ -98,6 +98,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/mpw.hpp b/boost/boost/config/compiler/mpw.hpp index e372f093ce..45e1aa45c6 100644 --- a/boost/boost/config/compiler/mpw.hpp +++ b/boost/boost/config/compiler/mpw.hpp @@ -46,6 +46,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/pathscale.hpp b/boost/boost/config/compiler/pathscale.hpp index 5f9444c477..94e44726f1 100644 --- a/boost/boost/config/compiler/pathscale.hpp +++ b/boost/boost/config/compiler/pathscale.hpp @@ -52,6 +52,7 @@ # define BOOST_NO_DELETED_FUNCTIONS # define BOOST_NO_DEFAULTED_FUNCTIONS # define BOOST_NO_DECLTYPE +# define BOOST_NO_DECLTYPE_N3276 # define BOOST_NO_CONSTEXPR # define BOOST_NO_COMPLETE_VALUE_INITIALIZATION # define BOOST_NO_CHAR32_T diff --git a/boost/boost/config/compiler/pgi.hpp b/boost/boost/config/compiler/pgi.hpp index 3c80313344..6da0e0f4bf 100644 --- a/boost/boost/config/compiler/pgi.hpp +++ b/boost/boost/config/compiler/pgi.hpp @@ -53,6 +53,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/sunpro_cc.hpp b/boost/boost/config/compiler/sunpro_cc.hpp index 206b53f0fd..eaf6c741c7 100644 --- a/boost/boost/config/compiler/sunpro_cc.hpp +++ b/boost/boost/config/compiler/sunpro_cc.hpp @@ -105,6 +105,7 @@ #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR #define BOOST_NO_DECLTYPE +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/vacpp.hpp b/boost/boost/config/compiler/vacpp.hpp index 52500202b4..b0407aab71 100644 --- a/boost/boost/config/compiler/vacpp.hpp +++ b/boost/boost/config/compiler/vacpp.hpp @@ -84,6 +84,7 @@ #else # define BOOST_HAS_DECLTYPE #endif +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/compiler/visualc.hpp b/boost/boost/config/compiler/visualc.hpp index d2dfa7ef0a..b9c81757ac 100644 --- a/boost/boost/config/compiler/visualc.hpp +++ b/boost/boost/config/compiler/visualc.hpp @@ -194,6 +194,7 @@ #define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR32_T #define BOOST_NO_CONSTEXPR +#define BOOST_NO_DECLTYPE_N3276 #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS diff --git a/boost/boost/config/platform/cray.hpp b/boost/boost/config/platform/cray.hpp new file mode 100644 index 0000000000..5c476e4160 --- /dev/null +++ b/boost/boost/config/platform/cray.hpp @@ -0,0 +1,18 @@ +// (C) Copyright John Maddock 2011. +// Use, modification and distribution are 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 http://www.boost.org for most recent version. + +// SGI Irix specific config options: + +#define BOOST_PLATFORM "Cray" + +// boilerplate code: +#define BOOST_HAS_UNISTD_H +#include + + + diff --git a/boost/boost/config/platform/win32.hpp b/boost/boost/config/platform/win32.hpp index 72c3dcebdc..39220127b2 100644 --- a/boost/boost/config/platform/win32.hpp +++ b/boost/boost/config/platform/win32.hpp @@ -55,6 +55,8 @@ #ifdef _WIN32_WCE # define BOOST_NO_ANSI_APIS +#else +# define BOOST_HAS_GETSYSTEMTIMEASFILETIME #endif #ifndef BOOST_HAS_PTHREADS diff --git a/boost/boost/config/select_compiler_config.hpp b/boost/boost/config/select_compiler_config.hpp index 34a4da5889..0d47b25424 100644 --- a/boost/boost/config/select_compiler_config.hpp +++ b/boost/boost/config/select_compiler_config.hpp @@ -17,6 +17,10 @@ // GCC-XML emulates other compilers, it has to appear first here! # define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp" +#elif defined(_CRAYC) +// EDG based Cray compiler: +# define BOOST_COMPILER_CONFIG "boost/config/compiler/cray.hpp" + #elif defined __CUDACC__ // NVIDIA CUDA C++ compiler for GPU # define BOOST_COMPILER_CONFIG "boost/config/compiler/nvcc.hpp" diff --git a/boost/boost/config/select_platform_config.hpp b/boost/boost/config/select_platform_config.hpp index bc1ffaf69f..2af61d2d46 100644 --- a/boost/boost/config/select_platform_config.hpp +++ b/boost/boost/config/select_platform_config.hpp @@ -13,7 +13,7 @@ // in order to prevent macro expansion within the header // name (for example "linux" is a macro on linux systems). -#if defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__) +#if (defined(linux) || defined(__linux) || defined(__linux__) || defined(__GNU__) || defined(__GLIBC__)) && !defined(_CRAYC) // linux, also other platforms (Hurd etc) that use GLIBC, should these really have their own config headers though? # define BOOST_PLATFORM_CONFIG "boost/config/platform/linux.hpp" @@ -69,6 +69,10 @@ // Symbian: # define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp" +#elif defined(_CRAYC) +// Cray: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/cray.hpp" + #elif defined(__VMS) // VMS: # define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp" diff --git a/boost/boost/config/suffix.hpp b/boost/boost/config/suffix.hpp index 30622872bc..7e5d4d4dd2 100644 --- a/boost/boost/config/suffix.hpp +++ b/boost/boost/config/suffix.hpp @@ -359,6 +359,13 @@ #define BOOST_HAS_VARIADIC_TMPL #endif +// +// Set BOOST_NO_DECLTYPE_N3276 when BOOST_NO_DECLTYPE is defined +// +#if !defined(BOOST_NO_DECLTYPE_N3276) && defined(BOOST_NO_DECLTYPE) +#define BOOST_NO_DECLTYPE_N3276 +#endif + // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: diff --git a/boost/boost/current_function.hpp b/boost/boost/current_function.hpp index aa5756e0a5..cb36e35c36 100644 --- a/boost/boost/current_function.hpp +++ b/boost/boost/current_function.hpp @@ -28,7 +28,7 @@ namespace detail inline void current_function_helper() { -#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) +#if defined(__GNUC__) || (defined(__MWERKS__) && (__MWERKS__ >= 0x3000)) || (defined(__ICC) && (__ICC >= 600)) || defined(__ghs__) # define BOOST_CURRENT_FUNCTION __PRETTY_FUNCTION__ @@ -65,3 +65,4 @@ inline void current_function_helper() } // namespace boost #endif // #ifndef BOOST_CURRENT_FUNCTION_HPP_INCLUDED + diff --git a/boost/boost/detail/container_fwd.hpp b/boost/boost/detail/container_fwd.hpp index 1a58935a7e..5e4e047588 100644 --- a/boost/boost/detail/container_fwd.hpp +++ b/boost/boost/detail/container_fwd.hpp @@ -1,25 +1,84 @@ -// Copyright 2005-2008 Daniel James. +// Copyright 2005-2011 Daniel James. // 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) +// Note: if you change this include guard, you also need to change +// container_fwd_compile_fail.cpp #if !defined(BOOST_DETAIL_CONTAINER_FWD_HPP) #define BOOST_DETAIL_CONTAINER_FWD_HPP -#if defined(_MSC_VER) && (_MSC_VER >= 1020) +#if defined(_MSC_VER) && (_MSC_VER >= 1020) && \ + !defined(BOOST_DETAIL_TEST_CONFIG_ONLY) # pragma once #endif #include #include -#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \ - || ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \ - && (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \ - || BOOST_WORKAROUND(__BORLANDC__, > 0x551) \ - || BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \ - || (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) \ - || (defined(_LIBCPP_VERSION)) +//////////////////////////////////////////////////////////////////////////////// +// // +// Define BOOST_DETAIL_NO_CONTAINER_FWD if you don't want this header to // +// forward declare standard containers. // +// // +//////////////////////////////////////////////////////////////////////////////// + +#if !defined(BOOST_DETAIL_NO_CONTAINER_FWD) +# if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) + // STLport +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__LIBCOMO__) + // Comeau STL: +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER) + // Rogue Wave library: +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(_LIBCPP_VERSION) + // libc++ +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__GLIBCPP__) || defined(__GLIBCXX__) + // GNU libstdc++ 3 +# if defined(_GLIBCXX_DEBUG) \ + || defined(_GLIBCXX_PARALLEL) \ + || defined(_GLIBCXX_PROFILE) +# define BOOST_DETAIL_NO_CONTAINER_FWD +# endif +# elif defined(__STL_CONFIG_H) + // generic SGI STL + // + // Forward declaration seems to be okay, but it has a couple of odd + // implementations. +# define BOOST_CONTAINER_FWD_BAD_BITSET +# if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) +# define BOOST_CONTAINER_FWD_BAD_DEQUE +# endif +# elif defined(__MSL_CPP__) + // MSL standard lib: +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif defined(__IBMCPP__) + // The default VACPP std lib, forward declaration seems to be fine. +# elif defined(MSIPL_COMPILE_H) + // Modena C++ standard library +# define BOOST_DETAIL_NO_CONTAINER_FWD +# elif (defined(_YVALS) && !defined(__IBMCPP__)) || defined(_CPPLIB_VER) + // Dinkumware Library (this has to appear after any possible replacement + // libraries) + // + // Works fine. +# else +# define BOOST_DETAIL_NO_CONTAINER_FWD +# endif +#endif + +// BOOST_DETAIL_TEST_* macros are for testing only +// and shouldn't be relied upon. But you can use +// BOOST_DETAIL_NO_CONTAINER_FWD to prevent forward +// declaration of containers. + +#if !defined(BOOST_DETAIL_TEST_CONFIG_ONLY) + +#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) && \ + !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD) #include #include @@ -34,17 +93,6 @@ #include -#if !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && \ - defined(__STL_CONFIG_H) - -#define BOOST_CONTAINER_FWD_BAD_BITSET - -#if !defined(__STL_NON_TYPE_TMPL_PARAM_BUG) -#define BOOST_CONTAINER_FWD_BAD_DEQUE -#endif - -#endif - #if defined(BOOST_CONTAINER_FWD_BAD_DEQUE) #include #endif @@ -74,11 +122,7 @@ namespace std #else template class complex; #endif -} -// gcc 3.4 and greater -namespace std -{ #if !defined(BOOST_CONTAINER_FWD_BAD_DEQUE) template class deque; #endif @@ -101,6 +145,9 @@ namespace std #pragma warning(pop) #endif -#endif +#endif // BOOST_DETAIL_NO_CONTAINER_FWD && + // !defined(BOOST_DETAIL_TEST_FORCE_CONTAINER_FWD) + +#endif // BOOST_DETAIL_TEST_CONFIG_ONLY #endif diff --git a/boost/boost/detail/fenv.hpp b/boost/boost/detail/fenv.hpp new file mode 100644 index 0000000000..1ba883370f --- /dev/null +++ b/boost/boost/detail/fenv.hpp @@ -0,0 +1,73 @@ +/*============================================================================= + Copyright (c) 2010 Bryce Lelbach + + 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) +=============================================================================*/ + +#include + +#if defined(BOOST_NO_FENV_H) + #error This platform does not have a floating point environment +#endif + +#if !defined(BOOST_DETAIL_FENV_HPP) +#define BOOST_DETAIL_FENV_HPP + +/* If we're using clang + glibc, we have to get hacky. + * See http://llvm.org/bugs/show_bug.cgi?id=6907 */ +#if defined(__clang__) && \ + defined(__GNU_LIBRARY__) && /* up to version 5 */ \ + defined(__GLIBC__) /* version 6 + */ + #define _FENV_H + + #include + #include + + extern "C" { + extern int fegetexceptflag (fexcept_t*, int) __THROW; + extern int fesetexceptflag (__const fexcept_t*, int) __THROW; + extern int feclearexcept (int) __THROW; + extern int feraiseexcept (int) __THROW; + extern int fetestexcept (int) __THROW; + extern int fegetround (void) __THROW; + extern int fesetround (int) __THROW; + extern int fegetenv (fenv_t*) __THROW; + extern int fesetenv (__const fenv_t*) __THROW; + extern int feupdateenv (__const fenv_t*) __THROW; + extern int feholdexcept (fenv_t*) __THROW; + + #ifdef __USE_GNU + extern int feenableexcept (int) __THROW; + extern int fedisableexcept (int) __THROW; + extern int fegetexcept (void) __THROW; + #endif + } + + namespace std { namespace tr1 { + using ::fenv_t; + using ::fexcept_t; + using ::fegetexceptflag; + using ::fesetexceptflag; + using ::feclearexcept; + using ::feraiseexcept; + using ::fetestexcept; + using ::fegetround; + using ::fesetround; + using ::fegetenv; + using ::fesetenv; + using ::feupdateenv; + using ::feholdexcept; + } } + +#else /* if we're not using GNU's C stdlib, fenv.h should work with clang */ + #if defined(__SUNPRO_CC) /* lol suncc */ + #include + #endif + + #include + +#endif + +#endif /* BOOST_DETAIL_FENV_HPP */ + diff --git a/boost/boost/function/function_template.hpp b/boost/boost/function/function_template.hpp index 3514e28821..bf139a0957 100644 --- a/boost/boost/function/function_template.hpp +++ b/boost/boost/function/function_template.hpp @@ -858,7 +858,7 @@ namespace boost { #else private: struct dummy { - void nonnull() {}; + void nonnull() {} }; typedef void (dummy::*safe_bool)(); diff --git a/boost/boost/integer_traits.hpp b/boost/boost/integer_traits.hpp index 774d058875..aec1028087 100644 --- a/boost/boost/integer_traits.hpp +++ b/boost/boost/integer_traits.hpp @@ -5,7 +5,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * - * $Id: integer_traits.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $ + * $Id: integer_traits.hpp 75471 2011-11-13 06:10:55Z jewillco $ * * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers */ diff --git a/boost/boost/lexical_cast.hpp b/boost/boost/lexical_cast.hpp index ddd7398093..0004461731 100644 --- a/boost/boost/lexical_cast.hpp +++ b/boost/boost/lexical_cast.hpp @@ -1,6 +1,12 @@ #ifndef BOOST_LEXICAL_CAST_INCLUDED #define BOOST_LEXICAL_CAST_INCLUDED +// MS compatible compilers support #pragma once + +#if defined(_MSC_VER) && (_MSC_VER >= 1020) +# pragma once +#endif + // Boost lexical_cast.hpp header -------------------------------------------// // // See http://www.boost.org/libs/conversion for documentation. @@ -18,6 +24,8 @@ #include #include #include +#include +#include #include #include #include @@ -28,17 +36,26 @@ #include #include #include +#include #include #include #include #include -#include +#include +#include #include #include #include +#include + #ifndef BOOST_NO_STD_LOCALE -#include +# include +#else +# ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE +# warning "Unable to use header. boost::lexical_cast will use the 'C' locale." +# define BOOST_LEXICAL_CAST_ASSUME_C_LOCALE +# endif #endif #ifdef BOOST_NO_STRINGSTREAM @@ -116,60 +133,102 @@ namespace boost namespace detail // selectors for choosing stream character type { - template - struct stream_char - { - typedef char type; - }; + template + struct stream_char + { + typedef char type; + }; #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template - struct stream_char< std::basic_string > - { - typedef CharT type; - }; + template + struct stream_char< std::basic_string > + { + typedef CharT type; + }; #endif #ifndef BOOST_LCAST_NO_WCHAR_T #ifndef BOOST_NO_INTRINSIC_WCHAR_T - template<> - struct stream_char - { - typedef wchar_t type; - }; + template<> + struct stream_char + { + typedef wchar_t type; + }; #endif - template<> - struct stream_char - { - typedef wchar_t type; - }; + template<> + struct stream_char + { + typedef wchar_t type; + }; - template<> - struct stream_char - { - typedef wchar_t type; - }; + template<> + struct stream_char + { + typedef wchar_t type; + }; #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template<> - struct stream_char - { - typedef wchar_t type; - }; + template<> + struct stream_char + { + typedef wchar_t type; + }; #endif #endif + +#ifndef BOOST_NO_CHAR16_T + + template<> + struct stream_char + { + typedef char16_t type; + }; + + template<> + struct stream_char + { + typedef char16_t type; + }; + + template<> + struct stream_char + { + typedef char16_t type; + }; + +#endif + +#ifndef BOOST_NO_CHAR32_T + + template<> + struct stream_char + { + typedef char32_t type; + }; + + template<> + struct stream_char + { + typedef char32_t type; + }; + + template<> + struct stream_char + { + typedef char32_t type; + }; + +#endif + template struct widest_char { - typedef TargetChar type; - }; - - template<> - struct widest_char - { - typedef wchar_t type; + typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c< + (sizeof(TargetChar) > sizeof(SourceChar)) + , TargetChar + , SourceChar >::type type; }; } @@ -214,156 +273,16 @@ namespace boost namespace detail // lcast_src_length { // Return max. length of string representation of Source; - // 0 if unlimited (with exceptions for some types, see below). - // Values with limited string representation are placed to - // the buffer locally defined in lexical_cast function. - // 1 is returned for few types such as CharT const* or - // std::basic_string that already have an internal - // buffer ready to be reused by lexical_stream_limited_src. - // Each specialization should have a correspondent operator<< - // defined in lexical_stream_limited_src. - template< class CharT // A result of widest_char transformation. - , class Source // Source type of lexical_cast. + template< class Source // Source type of lexical_cast. > struct lcast_src_length { - BOOST_STATIC_CONSTANT(std::size_t, value = 0); + BOOST_STATIC_CONSTANT(std::size_t, value = 1); // To check coverage, build the test with // bjam --v2 profile optimization=off static void check_coverage() {} }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - -#ifndef BOOST_LCAST_NO_WCHAR_T - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - -#ifndef BOOST_NO_INTRINSIC_WCHAR_T - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; -#endif -#endif - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - -#ifndef BOOST_LCAST_NO_WCHAR_T - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; -#endif - -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template - struct lcast_src_length< CharT, std::basic_string > - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; -#else - template<> - struct lcast_src_length< char, std::basic_string > - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; - -#ifndef BOOST_LCAST_NO_WCHAR_T - template<> - struct lcast_src_length< wchar_t, std::basic_string > - { - BOOST_STATIC_CONSTANT(std::size_t, value = 1); - static void check_coverage() {} - }; -#endif -#endif - // Helper for integral types. // Notes on length calculation: // Max length for 32bit int with grouping "\1" and thousands_sep ',': @@ -383,7 +302,7 @@ namespace boost #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS BOOST_STATIC_CONSTANT(std::size_t, value = std::numeric_limits::is_signed + - std::numeric_limits::is_specialized + // == 1 + std::numeric_limits::is_specialized + /* == 1 */ std::numeric_limits::digits10 * 2 ); #else @@ -391,20 +310,12 @@ namespace boost BOOST_STATIC_ASSERT(sizeof(Source) * CHAR_BIT <= 256); #endif }; - -#define BOOST_LCAST_DEF1(CharT, T) \ - template<> struct lcast_src_length \ +// TODO: FIX for char16_t, char32_t, we can ignore CharT +#define BOOST_LCAST_DEF(T) \ + template<> struct lcast_src_length \ : lcast_src_length_integral \ { static void check_coverage() {} }; -#ifdef BOOST_LCAST_NO_WCHAR_T -#define BOOST_LCAST_DEF(T) BOOST_LCAST_DEF1(char, T) -#else -#define BOOST_LCAST_DEF(T) \ - BOOST_LCAST_DEF1(char, T) \ - BOOST_LCAST_DEF1(wchar_t, T) -#endif - BOOST_LCAST_DEF(short) BOOST_LCAST_DEF(unsigned short) BOOST_LCAST_DEF(int) @@ -420,7 +331,6 @@ namespace boost #endif #undef BOOST_LCAST_DEF -#undef BOOST_LCAST_DEF1 #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION // Helper for floating point types. @@ -446,49 +356,26 @@ namespace boost }; template<> - struct lcast_src_length + struct lcast_src_length : lcast_src_length_floating { static void check_coverage() {} }; template<> - struct lcast_src_length + struct lcast_src_length : lcast_src_length_floating { static void check_coverage() {} }; template<> - struct lcast_src_length + struct lcast_src_length : lcast_src_length_floating { static void check_coverage() {} }; -#ifndef BOOST_LCAST_NO_WCHAR_T - template<> - struct lcast_src_length - : lcast_src_length_floating - { - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - : lcast_src_length_floating - { - static void check_coverage() {} - }; - - template<> - struct lcast_src_length - : lcast_src_length_floating - { - static void check_coverage() {} - }; - -#endif // #ifndef BOOST_LCAST_NO_WCHAR_T #endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION } @@ -502,6 +389,9 @@ namespace boost BOOST_STATIC_CONSTANT(char, zero = '0'); BOOST_STATIC_CONSTANT(char, minus = '-'); BOOST_STATIC_CONSTANT(char, plus = '+'); + BOOST_STATIC_CONSTANT(char, lowercase_e = 'e'); + BOOST_STATIC_CONSTANT(char, capital_e = 'E'); + BOOST_STATIC_CONSTANT(char, c_decimal_separator = '.'); }; #ifndef BOOST_LCAST_NO_WCHAR_T @@ -511,15 +401,37 @@ namespace boost BOOST_STATIC_CONSTANT(wchar_t, zero = L'0'); BOOST_STATIC_CONSTANT(wchar_t, minus = L'-'); BOOST_STATIC_CONSTANT(wchar_t, plus = L'+'); + BOOST_STATIC_CONSTANT(wchar_t, lowercase_e = L'e'); + BOOST_STATIC_CONSTANT(wchar_t, capital_e = L'E'); + BOOST_STATIC_CONSTANT(wchar_t, c_decimal_separator = L'.'); }; #endif - } - namespace detail // lexical_streambuf_fake - { - struct lexical_streambuf_fake +#ifndef BOOST_NO_CHAR16_T + template<> + struct lcast_char_constants { + BOOST_STATIC_CONSTANT(char16_t, zero = u'0'); + BOOST_STATIC_CONSTANT(char16_t, minus = u'-'); + BOOST_STATIC_CONSTANT(char16_t, plus = u'+'); + BOOST_STATIC_CONSTANT(char16_t, lowercase_e = u'e'); + BOOST_STATIC_CONSTANT(char16_t, capital_e = u'E'); + BOOST_STATIC_CONSTANT(char16_t, c_decimal_separator = u'.'); }; +#endif + +#ifndef BOOST_NO_CHAR32_T + template<> + struct lcast_char_constants + { + BOOST_STATIC_CONSTANT(char32_t, zero = U'0'); + BOOST_STATIC_CONSTANT(char32_t, minus = U'-'); + BOOST_STATIC_CONSTANT(char32_t, plus = U'+'); + BOOST_STATIC_CONSTANT(char32_t, lowercase_e = U'e'); + BOOST_STATIC_CONSTANT(char32_t, capital_e = U'E'); + BOOST_STATIC_CONSTANT(char32_t, c_decimal_separator = U'.'); + }; +#endif } namespace detail // lcast_to_unsigned @@ -549,7 +461,7 @@ namespace boost namespace detail // lcast_put_unsigned { template - CharT* lcast_put_unsigned(T n, CharT* finish) + CharT* lcast_put_unsigned(const T n_param, CharT* finish) { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS BOOST_STATIC_ASSERT(!std::numeric_limits::is_signed); @@ -558,52 +470,58 @@ namespace boost typedef typename Traits::int_type int_type; CharT const czero = lcast_char_constants::zero; int_type const zero = Traits::to_int_type(czero); + BOOST_DEDUCED_TYPENAME boost::mpl::if_c< + (sizeof(int_type) > sizeof(T)) + , int_type + , T + >::type n = n_param; #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE - // TODO: use BOOST_NO_STD_LOCALE std::locale loc; - typedef std::numpunct numpunct; - numpunct const& np = BOOST_USE_FACET(numpunct, loc); - std::string const& grouping = np.grouping(); - std::string::size_type const grouping_size = grouping.size(); + if (loc != std::locale::classic()) { + typedef std::numpunct numpunct; + numpunct const& np = BOOST_USE_FACET(numpunct, loc); + std::string const grouping = np.grouping(); + std::string::size_type const grouping_size = grouping.size(); - if ( grouping_size && grouping[0] > 0 ) - { + if ( grouping_size && grouping[0] > 0 ) + { #ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS - // Check that ulimited group is unreachable: - BOOST_STATIC_ASSERT(std::numeric_limits::digits10 < CHAR_MAX); + // Check that ulimited group is unreachable: + BOOST_STATIC_ASSERT(std::numeric_limits::digits10 < CHAR_MAX); #endif - CharT thousands_sep = np.thousands_sep(); - std::string::size_type group = 0; // current group number - char last_grp_size = grouping[0]; - char left = last_grp_size; + CharT thousands_sep = np.thousands_sep(); + std::string::size_type group = 0; // current group number + char last_grp_size = grouping[0]; + char left = last_grp_size; - do - { - if(left == 0) + do { - ++group; - if(group < grouping_size) + if(left == 0) { - char const grp_size = grouping[group]; - last_grp_size = grp_size <= 0 ? CHAR_MAX : grp_size; + ++group; + if(group < grouping_size) + { + char const grp_size = grouping[group]; + last_grp_size = grp_size <= 0 ? CHAR_MAX : grp_size; + } + + left = last_grp_size; + --finish; + Traits::assign(*finish, thousands_sep); } - left = last_grp_size; + --left; + --finish; - Traits::assign(*finish, thousands_sep); - } - - --left; - - --finish; - int_type const digit = static_cast(n % 10U); - Traits::assign(*finish, Traits::to_char_type(zero + digit)); - n /= 10; - } while(n); - - } else + int_type const digit = static_cast(n % 10U); + Traits::assign(*finish, Traits::to_char_type(zero + digit)); + n /= 10; + } while(n); + return finish; + } + } #endif { do @@ -639,63 +557,64 @@ namespace boost T multiplier = 1; #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE - // TODO: use BOOST_NO_STD_LOCALE std::locale loc; - typedef std::numpunct numpunct; - numpunct const& np = BOOST_USE_FACET(numpunct, loc); - std::string const& grouping = np.grouping(); - std::string::size_type const grouping_size = grouping.size(); + if (loc != std::locale::classic()) { + typedef std::numpunct numpunct; + numpunct const& np = BOOST_USE_FACET(numpunct, loc); + std::string const& grouping = np.grouping(); + std::string::size_type const grouping_size = grouping.size(); - /* According to [22.2.2.1.2] of Programming languages - C++ - * we MUST check for correct grouping - */ - if (grouping_size && grouping[0] > 0) - { - unsigned char current_grouping = 0; - CharT const thousands_sep = np.thousands_sep(); - char remained = grouping[current_grouping] - 1; - bool shall_we_return = true; - - for(;end>=begin; --end) + /* According to Programming languages - C++ + * we MUST check for correct grouping + */ + if (grouping_size && grouping[0] > 0) { - if (remained) { - T const new_sub_value = multiplier * 10 * (*end - czero); + unsigned char current_grouping = 0; + CharT const thousands_sep = np.thousands_sep(); + char remained = grouping[current_grouping] - 1; + bool shall_we_return = true; - if (*end < czero || *end >= czero + 10 - /* detecting overflow */ - || new_sub_value/10 != multiplier * (*end - czero) - || static_cast((std::numeric_limits::max)()-new_sub_value) < value - ) - return false; + for(;end>=begin; --end) + { + if (remained) { + T const new_sub_value = multiplier * 10 * (*end - czero); - value += new_sub_value; - multiplier *= 10; - --remained; - } else { - if ( !Traits::eq(*end, thousands_sep) ) //|| begin == end ) return false; - { - /* - * According to Programming languages - C++ - * Digit grouping is checked. That is, the positions of discarded - * separators is examined for consistency with - * use_facet >(loc ).grouping() - * - * BUT what if there is no separators at all and grouping() - * is not empty? Well, we have no extraced separators, so we - * won`t check them for consistency. This will allow us to - * work with "C" locale from other locales - */ - shall_we_return = false; - break; + if (*end < czero || *end >= czero + 10 + /* detecting overflow */ + || new_sub_value/10 != multiplier * (*end - czero) + || static_cast((std::numeric_limits::max)()-new_sub_value) < value + ) + return false; + + value += new_sub_value; + multiplier *= 10; + --remained; } else { - if ( begin == end ) return false; - if (current_grouping < grouping_size-1 ) ++current_grouping; - remained = grouping[current_grouping]; + if ( !Traits::eq(*end, thousands_sep) ) //|| begin == end ) return false; + { + /* + * According to Programming languages - C++ + * Digit grouping is checked. That is, the positions of discarded + * separators is examined for consistency with + * use_facet >(loc ).grouping() + * + * BUT what if there is no separators at all and grouping() + * is not empty? Well, we have no extraced separators, so we + * won`t check them for consistency. This will allow us to + * work with "C" locale from other locales + */ + shall_we_return = false; + break; + } else { + if ( begin == end ) return false; + if (current_grouping < grouping_size-1 ) ++current_grouping; + remained = grouping[current_grouping]; + } } } - } - if (shall_we_return) return true; + if (shall_we_return) return true; + } } #endif { @@ -719,158 +638,617 @@ namespace boost } } - namespace detail // stream wrapper for handling lexical conversions + namespace detail { - template - class lexical_stream + /* Returns true and sets the correct value if found NaN or Inf. */ + template + inline bool parse_inf_nan_impl(const CharT* begin, const CharT* end, T& value + , const CharT* lc_NAN, const CharT* lc_nan + , const CharT* lc_INFINITY, const CharT* lc_infinity + , const CharT opening_brace, const CharT closing_brace) { - private: - typedef typename widest_char< - typename stream_char::type, - typename stream_char::type>::type char_type; + using namespace std; + const wchar_t minus = lcast_char_constants::minus; + const wchar_t plus = lcast_char_constants::plus; + const int inifinity_size = 8; - typedef Traits traits_type; + bool has_minus = false; + /* Parsing +/- */ + if( *begin == minus) + { + ++ begin; + has_minus = true; + } + else if( *begin == plus ) ++begin; - public: - lexical_stream(char_type* = 0, char_type* = 0) + if( end-begin < 3 ) return false; + if( !memcmp(begin, lc_nan, 3*sizeof(CharT)) || !memcmp(begin, lc_NAN, 3*sizeof(CharT)) ) { - stream.unsetf(std::ios::skipws); - lcast_set_precision(stream, static_cast(0), static_cast(0) ); + begin += 3; + if (end != begin) /* It is 'nan(...)' or some bad input*/ + { + if(end-begin<2) return false; // bad input + -- end; + if( *begin != opening_brace || *end != closing_brace) return false; // bad input + } + + if( !has_minus ) value = std::numeric_limits::quiet_NaN(); + else value = (boost::math::changesign) (std::numeric_limits::quiet_NaN()); + return true; + } else + if (( /* 'INF' or 'inf' */ + end-begin==3 + && + (!memcmp(begin, lc_infinity, 3*sizeof(CharT)) || !memcmp(begin, lc_INFINITY, 3*sizeof(CharT))) + ) + || + ( /* 'INFINITY' or 'infinity' */ + end-begin==inifinity_size + && + (!memcmp(begin, lc_infinity, inifinity_size)|| !memcmp(begin, lc_INFINITY, inifinity_size)) + ) + ) + { + if( !has_minus ) value = std::numeric_limits::infinity(); + else value = (boost::math::changesign) (std::numeric_limits::infinity()); + return true; } - ~lexical_stream() - { - #if defined(BOOST_NO_STRINGSTREAM) - stream.freeze(false); - #endif - } - bool operator<<(const Source &input) - { - return !(stream << input).fail(); - } - template - bool operator>>(InputStreamable &output) - { - return !is_pointer::value && - stream >> output && - stream.get() == -#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING) -// GCC 2.9x lacks std::char_traits<>::eof(). -// We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3 -// configurations, which do provide std::char_traits<>::eof(). - - EOF; -#else - traits_type::eof(); + + return false; + } + +#ifndef BOOST_LCAST_NO_WCHAR_T + template + bool parse_inf_nan(const wchar_t* begin, const wchar_t* end, T& value) + { + return parse_inf_nan_impl(begin, end, value + , L"NAN", L"nan" + , L"INFINITY", L"infinity" + , L'(', L')'); + } #endif - } -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - - bool operator>>(std::string &output) + template + bool parse_inf_nan(const CharT* begin, const CharT* end, T& value) + { + return parse_inf_nan_impl(begin, end, value + , "NAN", "nan" + , "INFINITY", "infinity" + , '(', ')'); + } +#ifndef BOOST_LCAST_NO_WCHAR_T + template + bool put_inf_nan(wchar_t* begin, wchar_t*& end, const T& value) + { + using namespace std; + if ( (boost::math::isnan)(value) ) { - #if defined(BOOST_NO_STRINGSTREAM) - stream << '\0'; - #endif - stream.str().swap(output); + if ( (boost::math::signbit)(value) ) + { + memcpy(begin,L"-nan", sizeof(L"-nan")); + end = begin + 4; + } else + { + memcpy(begin,L"nan", sizeof(L"nan")); + end = begin + 3; + } return true; - } - #ifndef BOOST_LCAST_NO_WCHAR_T - bool operator>>(std::wstring &output) + } else if ( (boost::math::isinf)(value) ) { - stream.str().swap(output); - return true; - } - #endif - -#else - bool operator>>(std::basic_string& output) - { - stream.str().swap(output); + if ( (boost::math::signbit)(value) ) + { + memcpy(begin,L"-inf", sizeof(L"-inf")); + end = begin + 4; + } else + { + memcpy(begin,L"inf", sizeof(L"inf")); + end = begin + 3; + } return true; } - template - bool operator>>(std::basic_string& out) - { - std::basic_string str(stream.str()); - out.assign(str.begin(), str.end()); - return true; - } + return false; + } #endif - private: - #if defined(BOOST_NO_STRINGSTREAM) - std::strstream stream; - #elif defined(BOOST_NO_STD_LOCALE) - std::stringstream stream; - #else - std::basic_stringstream stream; - #endif + template + bool put_inf_nan(CharT* begin, CharT*& end, const T& value) + { + using namespace std; + if ( (boost::math::isnan)(value) ) + { + if ( (boost::math::signbit)(value) ) + { + memcpy(begin,"-nan", sizeof("-nan")); + end = begin + 4; + } else + { + memcpy(begin,"nan", sizeof("nan")); + end = begin + 3; + } + return true; + } else if ( (boost::math::isinf)(value) ) + { + if ( (boost::math::signbit)(value) ) + { + memcpy(begin,"-inf", sizeof("-inf")); + end = begin + 4; + } else + { + memcpy(begin,"inf", sizeof("inf")); + end = begin + 3; + } + return true; + } + + return false; + } + + } + + + namespace detail // lcast_ret_float + { + template + struct mantissa_holder_type + { + /* Can not be used with this type */ }; + + template <> + struct mantissa_holder_type + { + typedef unsigned int type; + }; + + template <> + struct mantissa_holder_type + { +#if defined(BOOST_HAS_LONG_LONG) + typedef boost::ulong_long_type type; +#elif defined(BOOST_HAS_MS_INT64) + typedef unsigned __int64 type; +#endif + }; + + template + inline bool lcast_ret_float(T& value, const CharT* begin, const CharT* end) + { + +#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE + std::locale loc; + typedef std::numpunct numpunct; + numpunct const& np = BOOST_USE_FACET(numpunct, loc); + std::string const grouping( + (loc == std::locale::classic()) + ? std::string() + : np.grouping() + ); + std::string::size_type const grouping_size = grouping.size(); + CharT const thousands_sep = grouping_size ? np.thousands_sep() : 0; + CharT const decimal_point = np.decimal_point(); + bool found_grouping = false; + unsigned int last_grouping_pos = grouping_size - 1; +#else + CharT const decimal_point = lcast_char_constants::c_decimal_separator; +#endif + + CharT const czero = lcast_char_constants::zero; + CharT const minus = lcast_char_constants::minus; + CharT const plus = lcast_char_constants::plus; + CharT const capital_e = lcast_char_constants::capital_e; + CharT const lowercase_e = lcast_char_constants::lowercase_e; + + value = 0.0; + + if (parse_inf_nan(begin, end, value)) return true; + + typedef typename Traits::int_type int_type; + typedef BOOST_DEDUCED_TYPENAME mantissa_holder_type::type mantissa_type; + int_type const zero = Traits::to_int_type(czero); + if (begin == end) return false; + + /* Getting the plus/minus sign */ + bool has_minus = false; + if ( *begin == minus ) { + ++ begin; + has_minus = true; + if (begin == end) return false; + } else if ( *begin == plus ) { + ++begin; + if (begin == end) return false; + } + + bool found_decimal = false; + bool found_number_before_exp = false; + int pow_of_10 = 0; + mantissa_type mantissa=0; + bool is_mantissa_full = false; + + char length_since_last_delim = 0; + + while ( begin != end ) + { + if (found_decimal) { + /* We allow no thousand_separators after decimal point */ + + mantissa_type tmp_mantissa = mantissa * 10u; + if ( *begin == lowercase_e || *begin == capital_e ) break; + if ( *begin < czero || *begin >= czero + 10 ) return false; + if ( is_mantissa_full + || tmp_mantissa / 10u != mantissa + || (std::numeric_limits::max)()-(*begin - zero) < tmp_mantissa + ) { + is_mantissa_full = true; + ++ begin; + continue; + } + + -- pow_of_10; + mantissa = tmp_mantissa; + mantissa += *begin - zero; + + found_number_before_exp = true; + } else { + + if (*begin >= czero && *begin < czero + 10) { + + /* Checking for mantissa overflow. If overflow will + * occur, them we only increase multiplyer + */ + mantissa_type tmp_mantissa = mantissa * 10u; + if( !is_mantissa_full + && tmp_mantissa / 10u == mantissa + && (std::numeric_limits::max)()-(*begin - zero) >= tmp_mantissa + ) + { + mantissa = tmp_mantissa; + mantissa += *begin - zero; + } else + { + is_mantissa_full = true; + ++ pow_of_10; + } + + found_number_before_exp = true; + ++ length_since_last_delim; + } else if ( *begin == decimal_point || *begin == lowercase_e || *begin == capital_e) { +#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE + /* If ( we need to check grouping + * and ( grouping missmatches + * or grouping position is incorrect + * or we are using the grouping position 0 twice + * ) + * ) then return error + */ + if( grouping_size && found_grouping + && ( + length_since_last_delim != grouping[0] + || last_grouping_pos>1 + || (last_grouping_pos==0 && grouping_size>1) + ) + ) return false; +#endif + + if(*begin == decimal_point){ + ++ begin; + found_decimal = true; + continue; + }else { + if (!found_number_before_exp) return false; + break; + } + } +#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE + else if (grouping_size && *begin == thousands_sep){ + if(found_grouping) + { + /* It is not he first time, when we find thousands separator, + * so we need to chek, is the distance between two groupings + * equal to grouping[last_grouping_pos] */ + + if (length_since_last_delim != grouping[last_grouping_pos] ) + { + if (!last_grouping_pos) return false; + else + { + -- last_grouping_pos; + if (length_since_last_delim != grouping[last_grouping_pos]) return false; + } + } else + /* We are calling the grouping[0] twice, when grouping size is more than 1 */ + if (grouping_size>1u && last_grouping_pos+1 grouping[last_grouping_pos] ) return false; + } + + length_since_last_delim = 0; + ++ begin; + + /* Delimiter at the end '100,' */ + if (begin == end) return false; + continue; + } +#endif + else return false; + } + + ++begin; + } + + // Exponent found + if ( begin != end && ( *begin == lowercase_e || *begin == capital_e ) ) { + ++ begin; + if ( begin == end ) return false; + + bool exp_has_minus = false; + if( *begin == minus ) { + exp_has_minus = true; + ++ begin; + if ( begin == end ) return false; + } else if (*begin == plus ) { + ++ begin; + if ( begin == end ) return false; + } + + int exp_pow_of_10 = 0; + while ( begin != end ) + { + if ( *begin < czero + || *begin >= czero + 10 + || exp_pow_of_10 * 10 < exp_pow_of_10) /* Overflows are checked lower more precisely*/ + return false; + + exp_pow_of_10 *= 10; + exp_pow_of_10 += *begin - zero; + ++ begin; + }; + + if ( exp_pow_of_10 ) { + /* Overflows are checked lower */ + if ( exp_has_minus ) { + pow_of_10 -= exp_pow_of_10; + } else { + pow_of_10 += exp_pow_of_10; + } + } + } + + /* We need a more accurate algorithm... We can not use current algorithm + * with long doubles (and with doubles if sizeof(double)==sizeof(long double)). + */ + long double result = std::pow(10.0L, pow_of_10) * mantissa; + value = static_cast( has_minus ? (boost::math::changesign)(result) : result); + + if ( (boost::math::isinf)(value) || (boost::math::isnan)(value) ) return false; + + return true; + } + } + + namespace detail // stl_buf_unlocker + { + template< class BufferType, class CharT > + class stl_buf_unlocker: public BufferType{ + public: + typedef BufferType base_class; +#ifndef BOOST_NO_USING_TEMPLATE + using base_class::pptr; + using base_class::pbase; + using base_class::setg; + using base_class::setp; +#else + CharT* pptr() const { return base_class::pptr(); } + CharT* pbase() const { return base_class::pbase(); } + void setg(CharT* gbeg, CharT* gnext, CharT* gend){ return base_class::setg(gbeg, gnext, gend); } + void setp(CharT* pbeg, CharT* pend) { return setp(pbeg, pend); } +#endif + }; + } + + namespace detail + { + struct do_not_construct_stringbuffer_t{}; } namespace detail // optimized stream wrapper { // String representation of Source has an upper limit. template< class CharT // a result of widest_char transformation - , class Base // lexical_streambuf_fake or basic_streambuf , class Traits // usually char_traits + , bool RequiresStringbuffer > - class lexical_stream_limited_src : public Base + class lexical_stream_limited_src { + typedef stl_buf_unlocker, CharT > local_streambuffer_t; + +#if defined(BOOST_NO_STRINGSTREAM) + typedef stl_buf_unlocker local_stringbuffer_t; +#elif defined(BOOST_NO_STD_LOCALE) + typedef stl_buf_unlocker local_stringbuffer_t; +#else + typedef stl_buf_unlocker, CharT > local_stringbuffer_t; +#endif + typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c< + RequiresStringbuffer, + local_stringbuffer_t, + do_not_construct_stringbuffer_t + >::type deduced_stringbuffer_t; + // A string representation of Source is written to [start, finish). - // Currently, it is assumed that [start, finish) is big enough - // to hold a string representation of any Source value. CharT* start; CharT* finish; - - private: - - static void widen_and_assign(char*p, char ch) - { - Traits::assign(*p, ch); - } - -#ifndef BOOST_LCAST_NO_WCHAR_T - static void widen_and_assign(wchar_t* p, char ch) - { - // TODO: use BOOST_NO_STD_LOCALE - std::locale loc; - wchar_t w = BOOST_USE_FACET(std::ctype, loc).widen(ch); - Traits::assign(*p, w); - } - - static void widen_and_assign(wchar_t* p, wchar_t ch) - { - Traits::assign(*p, ch); - } - - static void widen_and_assign(char*, wchar_t ch); // undefined -#endif - - template - bool lcast_put(const OutputStreamable& input) - { - this->setp(start, finish); - std::basic_ostream stream(static_cast(this)); - lcast_set_precision(stream, static_cast(0)); - bool const result = !(stream << input).fail(); - finish = this->pptr(); - return result; - } - - // Undefined: - lexical_stream_limited_src(lexical_stream_limited_src const&); - void operator=(lexical_stream_limited_src const&); + deduced_stringbuffer_t stringbuffer; public: - lexical_stream_limited_src(CharT* sta, CharT* fin) : start(sta) , finish(fin) {} - public: // output + private: + // Undefined: + lexical_stream_limited_src(lexical_stream_limited_src const&); + void operator=(lexical_stream_limited_src const&); +/************************************ HELPER FUNCTIONS FOR OPERATORS << ( ... ) ********************************/ + bool shl_char(CharT ch) + { + Traits::assign(*start, ch); + finish = start + 1; + return true; + } + +#ifndef BOOST_LCAST_NO_WCHAR_T + template + bool shl_char(T ch) + { + BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)) , + "boost::lexical_cast does not support conversions from whar_t to char types." + "Use boost::locale instead" ); +#ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE + std::locale loc; + wchar_t w = BOOST_USE_FACET(std::ctype, loc).widen(ch); +#else + wchar_t w = ch; +#endif + Traits::assign(*start, w); + finish = start + 1; + return true; + } +#endif + + bool shl_char_array(CharT const* str) + { + start = const_cast(str); + finish = start + Traits::length(str); + return true; + } + +#ifndef BOOST_LCAST_NO_WCHAR_T + template + bool shl_char_array(T const* str) + { + BOOST_STATIC_ASSERT_MSG(( sizeof(T) <= sizeof(CharT)), + "boost::lexical_cast does not support conversions from wchar_t to char types." + "Use boost::locale instead" ); + return shl_input_streamable(str); + } +#endif + + template + bool shl_input_streamable(InputStreamable& input) + { + std::basic_ostream stream(&stringbuffer); + bool const result = !(stream << input).fail(); + start = stringbuffer.pbase(); + finish = stringbuffer.pptr(); + return result && (start != finish); + } + + template + inline bool shl_signed(T n) + { + start = lcast_put_unsigned(lcast_to_unsigned(n), finish); + if(n < 0) + { + --start; + CharT const minus = lcast_char_constants::minus; + Traits::assign(*start, minus); + } + return true; + } + +#if (defined _MSC_VER) +# pragma warning( push ) +// C4996: This function or variable may be unsafe. Consider using sprintf_s instead +# pragma warning( disable : 4996 ) +#endif + + template + bool shl_float(float val,T* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + finish = start + sprintf(out,"%.*g", static_cast(boost::detail::lcast_get_precision()), val ); + return finish > start; + } + + template + bool shl_double(double val,T* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + finish = start + sprintf(out,"%.*lg", static_cast(boost::detail::lcast_get_precision()), val ); + return finish > start; + } +#ifndef __MINGW32__ + template + bool shl_long_double(long double val,T* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + finish = start + sprintf(out,"%.*Lg", static_cast(boost::detail::lcast_get_precision()), val ); + return finish > start; + } +#endif + +#if (defined _MSC_VER) +# pragma warning( pop ) +#endif + + +#ifndef BOOST_LCAST_NO_WCHAR_T + bool shl_float(float val,wchar_t* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + finish = start + swprintf(out, +#if !defined(__MINGW32__) && !defined(UNDER_CE) + finish-start, +#endif + L"%.*g", static_cast(boost::detail::lcast_get_precision()), val ); + + return finish > start; + } + + + bool shl_double(double val,wchar_t* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + /* __MINGW32__ is defined for both mingw.org and for mingw-w64. + * For mingw-w64, __MINGW64__ is defined, too, when targetting + * 64 bits. + * + * swprintf realization in MinGW and under WinCE does not conform + * to the ISO C + * Standard. + */ + finish = start + swprintf(out, +#if !defined(__MINGW32__) && !defined(UNDER_CE) + finish-start, +#endif + L"%.*lg", static_cast(boost::detail::lcast_get_precision()), val ); + return finish > start; + } + +#ifndef __MINGW32__ + bool shl_long_double(long double val,wchar_t* out) + { using namespace std; + if (put_inf_nan(start,finish,val)) return true; + finish = start + swprintf(out, +#if !defined(UNDER_CE) + finish-start, +#endif + L"%.*Lg", static_cast(boost::detail::lcast_get_precision()), val ); + return finish > start; + } +#endif + +#endif + +/************************************ OPERATORS << ( ... ) ********************************/ + public: template bool operator<<(std::basic_string const& str) { @@ -879,39 +1257,61 @@ namespace boost return true; } - bool operator<<(bool); - bool operator<<(char); - bool operator<<(unsigned char); - bool operator<<(signed char); -#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) - bool operator<<(wchar_t); + bool operator<<(bool value) + { + CharT const czero = lcast_char_constants::zero; + Traits::assign(*start, Traits::to_char_type(czero + value)); + finish = start + 1; + return true; + } + + bool operator<<(char ch) { return shl_char(ch); } + bool operator<<(unsigned char ch) { return ((*this) << static_cast(ch)); } + bool operator<<(signed char ch) { return ((*this) << static_cast(ch)); } +#if !defined(BOOST_LCAST_NO_WCHAR_T) + bool operator<<(wchar_t const* str) { return shl_char_array(str); } + bool operator<<(wchar_t * str) { return shl_char_array(str); } +#ifndef BOOST_NO_INTRINSIC_WCHAR_T + bool operator<<(wchar_t ch) { return shl_char(ch); } #endif - bool operator<<(unsigned char const*); - bool operator<<(signed char const*); - bool operator<<(CharT const*); - bool operator<<(short); - bool operator<<(int); - bool operator<<(long); - bool operator<<(unsigned short); - bool operator<<(unsigned int); - bool operator<<(unsigned long); +#endif + bool operator<<(unsigned char const* ch) { return ((*this) << reinterpret_cast(ch)); } + bool operator<<(unsigned char * ch) { return ((*this) << reinterpret_cast(ch)); } + bool operator<<(signed char const* ch) { return ((*this) << reinterpret_cast(ch)); } + bool operator<<(signed char * ch) { return ((*this) << reinterpret_cast(ch)); } + bool operator<<(char const* str) { return shl_char_array(str); } + bool operator<<(char* str) { return shl_char_array(str); } + bool operator<<(short n) { return shl_signed(n); } + bool operator<<(int n) { return shl_signed(n); } + bool operator<<(long n) { return shl_signed(n); } + bool operator<<(unsigned short n) { start = lcast_put_unsigned(n, finish); return true; } + bool operator<<(unsigned int n) { start = lcast_put_unsigned(n, finish); return true; } + bool operator<<(unsigned long n) { start = lcast_put_unsigned(n, finish); return true; } + #if defined(BOOST_HAS_LONG_LONG) - bool operator<<(boost::ulong_long_type); - bool operator<<(boost::long_long_type ); + bool operator<<(boost::ulong_long_type n) { start = lcast_put_unsigned(n, finish); return true; } + bool operator<<(boost::long_long_type n) { return shl_signed(n); } #elif defined(BOOST_HAS_MS_INT64) - bool operator<<(unsigned __int64); - bool operator<<( __int64); + bool operator<<(unsigned __int64 n) { start = lcast_put_unsigned(n, finish); return true; } + bool operator<<( __int64 n) { return shl_signed(n); } #endif - // These three operators use ostream and streambuf. - // lcast_streambuf_for_source::value is true. - bool operator<<(float); - bool operator<<(double); - bool operator<<(long double); + bool operator<<(float val) { return shl_float(val,start); } + bool operator<<(double val) { return shl_double(val,start); } + bool operator<<(long double val) { +#ifndef __MINGW32__ + return shl_long_double(val,start); +#else + return shl_double(val,start); +#endif + } + template + bool operator<<(const InStreamable& input) { return shl_input_streamable(input); } + +/************************************ HELPER FUNCTIONS FOR OPERATORS >> ( ... ) ********************************/ private: - template - bool input_operator_helper_unsigned(Type& output) + bool shr_unsigned(Type& output) { CharT const minus = lcast_char_constants::minus; CharT const plus = lcast_char_constants::plus; @@ -945,7 +1345,7 @@ namespace boost } template - bool input_operator_helper_signed(Type& output) + bool shr_signed(Type& output) { CharT const minus = lcast_char_constants::minus; CharT const plus = lcast_char_constants::plus; @@ -988,63 +1388,81 @@ namespace boost return succeed; } - public: // input - - bool operator>>(unsigned short& output) + template + bool shr_using_base_class(InputStreamable& output) { - return input_operator_helper_unsigned(output); +#if (defined _MSC_VER) +# pragma warning( push ) + // conditional expression is constant +# pragma warning( disable : 4127 ) +#endif + if(is_pointer::value) + return false; + + local_streambuffer_t bb; + bb.setg(start, start, finish); + std::basic_istream stream(&bb); + stream.unsetf(std::ios::skipws); + lcast_set_precision(stream, static_cast(0)); +#if (defined _MSC_VER) +# pragma warning( pop ) +#endif + return stream >> output && + stream.get() == +#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING) + // GCC 2.9x lacks std::char_traits<>::eof(). + // We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3 + // configurations, which do provide std::char_traits<>::eof(). + + EOF; +#else + Traits::eof(); +#endif } - bool operator>>(unsigned int& output) + template + inline bool shr_xchar(T& output) { - return input_operator_helper_unsigned(output); + BOOST_STATIC_ASSERT_MSG(( sizeof(CharT) == sizeof(T) ), + "boost::lexical_cast does not support conversions from whar_t to char types." + "Use boost::locale instead" ); + bool const ok = (finish - start == 1); + if(ok) { + CharT out; + Traits::assign(out, *start); + output = static_cast(out); + } + return ok; } - bool operator>>(unsigned long int& output) - { - return input_operator_helper_unsigned(output); - } - - bool operator>>(short& output) - { - return input_operator_helper_signed(output); - } - - bool operator>>(int& output) - { - return input_operator_helper_signed(output); - } - - bool operator>>(long int& output) - { - return input_operator_helper_signed(output); - } - - +/************************************ OPERATORS >> ( ... ) ********************************/ + public: + bool operator>>(unsigned short& output) { return shr_unsigned(output); } + bool operator>>(unsigned int& output) { return shr_unsigned(output); } + bool operator>>(unsigned long int& output) { return shr_unsigned(output); } + bool operator>>(short& output) { return shr_signed(output); } + bool operator>>(int& output) { return shr_signed(output); } + bool operator>>(long int& output) { return shr_signed(output); } #if defined(BOOST_HAS_LONG_LONG) - bool operator>>( boost::ulong_long_type& output) - { - return input_operator_helper_unsigned(output); - } - - bool operator>>(boost::long_long_type& output) - { - return input_operator_helper_signed(output); - } - + bool operator>>(boost::ulong_long_type& output) { return shr_unsigned(output); } + bool operator>>(boost::long_long_type& output) { return shr_signed(output); } #elif defined(BOOST_HAS_MS_INT64) - bool operator>>(unsigned __int64& output) - { - return input_operator_helper_unsigned(output); - } - - bool operator>>(__int64& output) - { - return input_operator_helper_signed(output); - } + bool operator>>(unsigned __int64& output) { return shr_unsigned(output); } + bool operator>>(__int64& output) { return shr_signed(output); } #endif - + bool operator>>(CharT& output) { return shr_xchar(output); } + bool operator>>(unsigned char& output) { return shr_xchar(output); } + bool operator>>(signed char& output) { return shr_xchar(output); } +#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + bool operator>>(std::string& str) { str.assign(start, finish); return true; } +# ifndef BOOST_LCAST_NO_WCHAR_T + bool operator>>(std::wstring& str) { str.assign(start, finish); return true; } +# endif +#else + template + bool operator>>(std::basic_string& str) { str.assign(start, finish); return true; } +#endif /* * case "-0" || "0" || "+0" : output = false; return true; * case "1" || "+1": output = true; return true; @@ -1079,401 +1497,78 @@ namespace boost } } + bool operator>>(float& output) { return lcast_ret_float(output,start,finish); } + + private: + // Not optimised converter + template + bool float_types_converter_internal(T& output, int /*tag*/) { + if (parse_inf_nan(start, finish, output)) return true; + bool return_value = shr_using_base_class(output); + + /* Some compilers and libraries successfully + * parse 'inf', 'INFINITY', '1.0E', '1.0E-'... + * We are trying to provide a unified behaviour, + * so we just forbid such conversions (as some + * of the most popular compilers/libraries do) + * */ + CharT const minus = lcast_char_constants::minus; + CharT const plus = lcast_char_constants::plus; + CharT const capital_e = lcast_char_constants::capital_e; + CharT const lowercase_e = lcast_char_constants::lowercase_e; + if ( return_value && + ( + *(finish-1) == lowercase_e // 1.0e + || *(finish-1) == capital_e // 1.0E + || *(finish-1) == minus // 1.0e- or 1.0E- + || *(finish-1) == plus // 1.0e+ or 1.0E+ + ) + ) return false; + + return return_value; + } + + // Optimised converter + bool float_types_converter_internal(double& output,char /*tag*/) { + return lcast_ret_float(output,start,finish); + } + public: + + bool operator>>(double& output) + { + /* + * Some compilers implement long double as double. In that case these types have + * same size, same precision, same max and min values... And it means, + * that current implementation of lcast_ret_float cannot be used for type + * double, because it will give a big precision loss. + * */ + boost::mpl::if_c< +#if defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64) + ::boost::type_traits::ice_eq< sizeof(double), sizeof(long double) >::value, +#else + 0 +#endif + int, + char + >::type tag = 0; + + return float_types_converter_internal(output, tag); + } + + bool operator>>(long double& output) + { + int tag = 0; + return float_types_converter_internal(output, tag); + } // Generic istream-based algorithm. // lcast_streambuf_for_target::value is true. template - bool operator>>(InputStreamable& output) - { -#if (defined _MSC_VER) -# pragma warning( push ) - // conditional expression is constant -# pragma warning( disable : 4127 ) -#endif - if(is_pointer::value) - return false; - - this->setg(start, start, finish); - std::basic_istream stream(static_cast(this)); - stream.unsetf(std::ios::skipws); - lcast_set_precision(stream, static_cast(0)); -#if (defined _MSC_VER) -# pragma warning( pop ) -#endif - return stream >> output && - stream.get() == -#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING) - // GCC 2.9x lacks std::char_traits<>::eof(). - // We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3 - // configurations, which do provide std::char_traits<>::eof(). - - EOF; -#else - Traits::eof(); -#endif - } - - bool operator>>(CharT&); - bool operator>>(unsigned char&); - bool operator>>(signed char&); - -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION -// This #if is in sync with lcast_streambuf_for_target - - bool operator>>(std::string&); - -#ifndef BOOST_LCAST_NO_WCHAR_T - bool operator>>(std::wstring&); -#endif - -#else - template - bool operator>>(std::basic_string& str) - { - str.assign(start, finish); - return true; - } -#endif - }; - - template - inline bool lexical_stream_limited_src::operator<<( - bool value) - { - typedef typename Traits::int_type int_type; - CharT const czero = lcast_char_constants::zero; - int_type const zero = Traits::to_int_type(czero); - Traits::assign(*start, Traits::to_char_type(zero + value)); - finish = start + 1; - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - char ch) - { - widen_and_assign(start, ch); - finish = start + 1; - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - unsigned char ch) - { - return ((*this) << static_cast(ch)); - } - - template - inline bool lexical_stream_limited_src::operator<<( - signed char ch) - { - return ((*this) << static_cast(ch)); - } - - template - inline bool lexical_stream_limited_src::operator<<( - unsigned char const* ch) - { - return ((*this) << reinterpret_cast(ch)); - } - - template - inline bool lexical_stream_limited_src::operator<<( - signed char const* ch) - { - return ((*this) << reinterpret_cast(ch)); - } - -#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) - template - inline bool lexical_stream_limited_src::operator<<( - wchar_t ch) - { - widen_and_assign(start, ch); - finish = start + 1; - return true; - } -#endif - - template - inline bool lexical_stream_limited_src::operator<<( - short n) - { - start = lcast_put_unsigned(lcast_to_unsigned(n), finish); - if(n < 0) - { - --start; - CharT const minus = lcast_char_constants::minus; - Traits::assign(*start, minus); - } - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - int n) - { - start = lcast_put_unsigned(lcast_to_unsigned(n), finish); - if(n < 0) - { - --start; - CharT const minus = lcast_char_constants::minus; - Traits::assign(*start, minus); - } - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - long n) - { - start = lcast_put_unsigned(lcast_to_unsigned(n), finish); - if(n < 0) - { - --start; - CharT const minus = lcast_char_constants::minus; - Traits::assign(*start, minus); - } - return true; - } - -#if defined(BOOST_HAS_LONG_LONG) - template - inline bool lexical_stream_limited_src::operator<<( - boost::long_long_type n) - { - start = lcast_put_unsigned(lcast_to_unsigned(n), finish); - if(n < 0) - { - --start; - CharT const minus = lcast_char_constants::minus; - Traits::assign(*start, minus); - } - return true; - } -#elif defined(BOOST_HAS_MS_INT64) - template - inline bool lexical_stream_limited_src::operator<<( - __int64 n) - { - start = lcast_put_unsigned(lcast_to_unsigned(n), finish); - if(n < 0) - { - --start; - CharT const minus = lcast_char_constants::minus; - Traits::assign(*start, minus); - } - return true; - } -#endif - - template - inline bool lexical_stream_limited_src::operator<<( - unsigned short n) - { - start = lcast_put_unsigned(n, finish); - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - unsigned int n) - { - start = lcast_put_unsigned(n, finish); - return true; - } - - template - inline bool lexical_stream_limited_src::operator<<( - unsigned long n) - { - start = lcast_put_unsigned(n, finish); - return true; - } - -#if defined(BOOST_HAS_LONG_LONG) - template - inline bool lexical_stream_limited_src::operator<<( - boost::ulong_long_type n) - { - start = lcast_put_unsigned(n, finish); - return true; - } -#elif defined(BOOST_HAS_MS_INT64) - template - inline bool lexical_stream_limited_src::operator<<( - unsigned __int64 n) - { - start = lcast_put_unsigned(n, finish); - return true; - } -#endif - - template - inline bool lexical_stream_limited_src::operator<<( - float val) - { - return this->lcast_put(val); - } - - template - inline bool lexical_stream_limited_src::operator<<( - double val) - { - return this->lcast_put(val); - } - - template - inline bool lexical_stream_limited_src::operator<<( - long double val) - { - return this->lcast_put(val); - } - - template - inline bool lexical_stream_limited_src::operator<<( - CharT const* str) - { - start = const_cast(str); - finish = start + Traits::length(str); - return true; - } - - template - inline bool lexical_stream_limited_src::operator>>( - CharT& output) - { - bool const ok = (finish - start == 1); - if(ok) - Traits::assign(output, *start); - return ok; - } - - template - inline bool lexical_stream_limited_src::operator>>( - unsigned char& output) - { - BOOST_STATIC_ASSERT( sizeof(CharT) == sizeof(unsigned char) ); - bool const ok = (finish - start == 1); - if(ok) { - CharT out; - Traits::assign(out, *start); - output = static_cast(out); - } - return ok; - } - - template - inline bool lexical_stream_limited_src::operator>>( - signed char& output) - { - BOOST_STATIC_ASSERT( sizeof(CharT) == sizeof(signed char) ); - bool const ok = (finish - start == 1); - if(ok) { - CharT out; - Traits::assign(out, *start); - output = static_cast(out); - } - return ok; - } - -#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template - inline bool lexical_stream_limited_src::operator>>( - std::string& str) - { - str.assign(start, finish); - return true; - } - -#ifndef BOOST_LCAST_NO_WCHAR_T - template - inline bool lexical_stream_limited_src::operator>>( - std::wstring& str) - { - str.assign(start, finish); - return true; - } -#endif -#endif - } - - namespace detail // lcast_streambuf_for_source - { - // Returns true if optimized stream wrapper needs ostream for writing. - template - struct lcast_streambuf_for_source - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - - template<> - struct lcast_streambuf_for_source - { - BOOST_STATIC_CONSTANT(bool, value = true); - }; - - template<> - struct lcast_streambuf_for_source - { - BOOST_STATIC_CONSTANT(bool, value = true); - }; - - template<> - struct lcast_streambuf_for_source - { - BOOST_STATIC_CONSTANT(bool, value = true); + bool operator>>(InputStreamable& output) { return shr_using_base_class(output); } }; } - namespace detail // lcast_streambuf_for_target - { - // Returns true if optimized stream wrapper needs istream for reading. - template - struct lcast_streambuf_for_target - { - BOOST_STATIC_CONSTANT(bool, value = - ( - ::boost::type_traits::ice_not< is_integral::value >::value - ) - ); - }; - #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION - template - struct lcast_streambuf_for_target< - std::basic_string > - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - -#ifndef BOOST_LCAST_NO_WCHAR_T - template - struct lcast_streambuf_for_target< - std::basic_string > - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; -#endif -#else - template<> - struct lcast_streambuf_for_target - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; - -#ifndef BOOST_LCAST_NO_WCHAR_T - template<> - struct lcast_streambuf_for_target - { - BOOST_STATIC_CONSTANT(bool, value = false); - }; -#endif -#endif - } - - #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // call-by-const reference version @@ -1491,47 +1586,6 @@ namespace boost typedef const T * type; }; -#if (defined _MSC_VER) -# pragma warning( push ) -# pragma warning( disable : 4701 ) // possible use of ... before initialization -# pragma warning( disable : 4702 ) // unreachable code -# pragma warning( disable : 4267 ) // conversion from 'size_t' to 'unsigned int' -#endif - - template< typename Target - , typename Source - , bool Unlimited // string representation of Source is unlimited - , typename CharT - > - Target lexical_cast( - BOOST_DEDUCED_TYPENAME boost::call_traits::param_type arg, - CharT* buf, std::size_t src_len) - { - typedef BOOST_DEDUCED_TYPENAME - deduce_char_traits::type traits; - - typedef BOOST_DEDUCED_TYPENAME boost::mpl::if_c< - lcast_streambuf_for_target::value || - lcast_streambuf_for_source::value - , std::basic_streambuf - , lexical_streambuf_fake - >::type base; - - BOOST_DEDUCED_TYPENAME boost::mpl::if_c< - Unlimited - , detail::lexical_stream - , detail::lexical_stream_limited_src - >::type interpreter(buf, buf + src_len); - - Target result; - if(!(interpreter << arg && interpreter >> result)) - BOOST_LCAST_THROW_BAD_CAST(Source, Target); - return result; - } -#if (defined _MSC_VER) -# pragma warning( pop ) -#endif - template struct is_stdstring { @@ -1547,28 +1601,38 @@ namespace boost template struct is_char_or_wchar { + private: #ifndef BOOST_LCAST_NO_WCHAR_T - BOOST_STATIC_CONSTANT(bool, value = - ( - ::boost::type_traits::ice_or< - is_same< T, char >::value, - is_same< T, wchar_t >::value, - is_same< T, unsigned char >::value, - is_same< T, signed char >::value - >::value - ) - ); + typedef wchar_t wchar_t_if_supported; #else + typedef char wchar_t_if_supported; +#endif + +#ifndef BOOST_NO_CHAR16_T + typedef char16_t char16_t_if_supported; +#else + typedef char char16_t_if_supported; +#endif + +#ifndef BOOST_NO_CHAR32_T + typedef char32_t char32_t_if_supported; +#else + typedef char char32_t_if_supported; +#endif + public: + BOOST_STATIC_CONSTANT(bool, value = ( ::boost::type_traits::ice_or< is_same< T, char >::value, + is_same< T, wchar_t_if_supported >::value, + is_same< T, char16_t_if_supported >::value, + is_same< T, char32_t_if_supported >::value, is_same< T, unsigned char >::value, is_same< T, signed char >::value >::value ) ); -#endif }; template @@ -1634,25 +1698,62 @@ namespace boost BOOST_STATIC_CONSTANT(bool, value = true ); }; +#if (defined _MSC_VER) +# pragma warning( push ) +# pragma warning( disable : 4701 ) // possible use of ... before initialization +# pragma warning( disable : 4702 ) // unreachable code +# pragma warning( disable : 4267 ) // conversion from 'size_t' to 'unsigned int' +#endif template struct lexical_cast_do_cast { - static inline Target lexical_cast_impl(const Source &arg) + static inline Target lexical_cast_impl(const Source& arg) { - typedef typename detail::array_to_pointer_decay::type src; + typedef BOOST_DEDUCED_TYPENAME detail::array_to_pointer_decay::type src; - typedef typename detail::widest_char< - typename detail::stream_char::type - , typename detail::stream_char::type + typedef BOOST_DEDUCED_TYPENAME detail::widest_char< + BOOST_DEDUCED_TYPENAME detail::stream_char::type + , BOOST_DEDUCED_TYPENAME detail::stream_char::type >::type char_type; - typedef detail::lcast_src_length lcast_src_length; + typedef detail::lcast_src_length lcast_src_length; std::size_t const src_len = lcast_src_length::value; char_type buf[src_len + 1]; lcast_src_length::check_coverage(); - return detail::lexical_cast(arg, buf, src_len); + + typedef BOOST_DEDUCED_TYPENAME + deduce_char_traits::type traits; + + typedef BOOST_DEDUCED_TYPENAME remove_pointer::type removed_ptr_t; + const bool requires_stringbuf = + !( + ::boost::type_traits::ice_or< + is_stdstring::value, + is_arithmetic::value, + ::boost::type_traits::ice_and< + is_pointer::value, + is_char_or_wchar::value, + ::boost::type_traits::ice_eq< + sizeof(char_type), + sizeof(removed_ptr_t) + >::value + >::value + >::value + ); + + detail::lexical_stream_limited_src + interpreter(buf, buf + src_len); + + Target result; + // Disabling ADL, by directly specifying operators. + if(!(interpreter.operator <<(arg) && interpreter.operator >>(result))) + BOOST_LCAST_THROW_BAD_CAST(Source, Target); + return result; } }; +#if (defined _MSC_VER) +# pragma warning( pop ) +#endif template struct lexical_cast_copy @@ -1708,6 +1809,7 @@ namespace boost } catch( ::boost::numeric::bad_numeric_cast const& ) { BOOST_LCAST_THROW_BAD_CAST(Source, Target); } + BOOST_UNREACHABLE_RETURN(static_cast(0)); } }; @@ -1734,6 +1836,7 @@ namespace boost } catch( ::boost::numeric::bad_numeric_cast const& ) { BOOST_LCAST_THROW_BAD_CAST(Source, Target); } + BOOST_UNREACHABLE_RETURN(static_cast(0)); } }; @@ -1815,6 +1918,78 @@ namespace boost #else + namespace detail // stream wrapper for handling lexical conversions + { + template + class lexical_stream + { + private: + typedef typename widest_char< + typename stream_char::type, + typename stream_char::type>::type char_type; + + typedef Traits traits_type; + + public: + lexical_stream(char_type* = 0, char_type* = 0) + { + stream.unsetf(std::ios::skipws); + lcast_set_precision(stream, static_cast(0), static_cast(0) ); + } + ~lexical_stream() + { + #if defined(BOOST_NO_STRINGSTREAM) + stream.freeze(false); + #endif + } + bool operator<<(const Source &input) + { + return !(stream << input).fail(); + } + template + bool operator>>(InputStreamable &output) + { + return !is_pointer::value && + stream >> output && + stream.get() == +#if defined(__GNUC__) && (__GNUC__<3) && defined(BOOST_NO_STD_WSTRING) +// GCC 2.9x lacks std::char_traits<>::eof(). +// We use BOOST_NO_STD_WSTRING to filter out STLport and libstdc++-v3 +// configurations, which do provide std::char_traits<>::eof(). + + EOF; +#else + traits_type::eof(); +#endif + } + + bool operator>>(std::string &output) + { + #if defined(BOOST_NO_STRINGSTREAM) + stream << '\0'; + #endif + stream.str().swap(output); + return true; + } + #ifndef BOOST_LCAST_NO_WCHAR_T + bool operator>>(std::wstring &output) + { + stream.str().swap(output); + return true; + } + #endif + + private: + #if defined(BOOST_NO_STRINGSTREAM) + std::strstream stream; + #elif defined(BOOST_NO_STD_LOCALE) + std::stringstream stream; + #else + std::basic_stringstream stream; + #endif + }; + } + // call-by-value fallback version (deprecated) template diff --git a/boost/boost/math/policies/policy.hpp b/boost/boost/math/policies/policy.hpp new file mode 100644 index 0000000000..355bf18fd9 --- /dev/null +++ b/boost/boost/math/policies/policy.hpp @@ -0,0 +1,959 @@ +// Copyright John Maddock 2007. +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_POLICY_HPP +#define BOOST_MATH_POLICY_HPP + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +// Sadly we do need the .h versions of these to be sure of getting +// FLT_MANT_DIG etc. +#include +#include +#include +#include + +namespace boost{ namespace math{ + +namespace tools{ + +template +int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)); +template +T epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)); + +} + +namespace policies{ + +// +// Define macros for our default policies, if they're not defined already: +// +#ifndef BOOST_MATH_DOMAIN_ERROR_POLICY +#define BOOST_MATH_DOMAIN_ERROR_POLICY throw_on_error +#endif +#ifndef BOOST_MATH_POLE_ERROR_POLICY +#define BOOST_MATH_POLE_ERROR_POLICY throw_on_error +#endif +#ifndef BOOST_MATH_OVERFLOW_ERROR_POLICY +#define BOOST_MATH_OVERFLOW_ERROR_POLICY throw_on_error +#endif +#ifndef BOOST_MATH_EVALUATION_ERROR_POLICY +#define BOOST_MATH_EVALUATION_ERROR_POLICY throw_on_error +#endif +#ifndef BOOST_MATH_ROUNDING_ERROR_POLICY +#define BOOST_MATH_ROUNDING_ERROR_POLICY throw_on_error +#endif +#ifndef BOOST_MATH_UNDERFLOW_ERROR_POLICY +#define BOOST_MATH_UNDERFLOW_ERROR_POLICY ignore_error +#endif +#ifndef BOOST_MATH_DENORM_ERROR_POLICY +#define BOOST_MATH_DENORM_ERROR_POLICY ignore_error +#endif +#ifndef BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY +#define BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY ignore_error +#endif +#ifndef BOOST_MATH_DIGITS10_POLICY +#define BOOST_MATH_DIGITS10_POLICY 0 +#endif +#ifndef BOOST_MATH_PROMOTE_FLOAT_POLICY +#define BOOST_MATH_PROMOTE_FLOAT_POLICY true +#endif +#ifndef BOOST_MATH_PROMOTE_DOUBLE_POLICY +#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#define BOOST_MATH_PROMOTE_DOUBLE_POLICY false +#else +#define BOOST_MATH_PROMOTE_DOUBLE_POLICY true +#endif +#endif +#ifndef BOOST_MATH_DISCRETE_QUANTILE_POLICY +#define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_outwards +#endif +#ifndef BOOST_MATH_ASSERT_UNDEFINED_POLICY +#define BOOST_MATH_ASSERT_UNDEFINED_POLICY true +#endif +#ifndef BOOST_MATH_MAX_SERIES_ITERATION_POLICY +#define BOOST_MATH_MAX_SERIES_ITERATION_POLICY 1000000 +#endif +#ifndef BOOST_MATH_MAX_ROOT_ITERATION_POLICY +#define BOOST_MATH_MAX_ROOT_ITERATION_POLICY 200 +#endif + +#if !defined(__BORLANDC__) \ + && !(defined(__GNUC__) && (__GNUC__ == 3) && (__GNUC_MINOR__ <= 2)) +#define BOOST_MATH_META_INT(type, name, Default)\ + template struct name : public boost::mpl::int_{};\ + namespace detail{\ + template \ + char test_is_valid_arg(const name*);\ + char test_is_default_arg(const name*);\ + template struct is_##name##_imp\ + {\ + template static char test(const name*);\ + static double test(...);\ + BOOST_STATIC_CONSTANT(bool, value = sizeof(test(static_cast(0))) == 1);\ + };\ + }\ + template struct is_##name : public boost::mpl::bool_< ::boost::math::policies::detail::is_##name##_imp::value>{}; + +#define BOOST_MATH_META_BOOL(name, Default)\ + template struct name : public boost::mpl::bool_{};\ + namespace detail{\ + template \ + char test_is_valid_arg(const name*);\ + char test_is_default_arg(const name*);\ + template struct is_##name##_imp\ + {\ + template static char test(const name*);\ + static double test(...);\ + BOOST_STATIC_CONSTANT(bool, value = sizeof(test(static_cast(0))) == 1);\ + };\ + }\ + template struct is_##name : public boost::mpl::bool_< ::boost::math::policies::detail::is_##name##_imp::value>{}; +#else +#define BOOST_MATH_META_INT(Type, name, Default)\ + template struct name : public boost::mpl::int_{};\ + namespace detail{\ + template \ + char test_is_valid_arg(const name*);\ + char test_is_default_arg(const name*);\ + template struct is_##name##_tester\ + {\ + template static char test(const name&);\ + static double test(...);\ + };\ + template struct is_##name##_imp\ + {\ + static T inst;\ + BOOST_STATIC_CONSTANT(bool, value = sizeof( ::boost::math::policies::detail::is_##name##_tester::test(inst)) == 1);\ + };\ + }\ + template struct is_##name : public boost::mpl::bool_< ::boost::math::policies::detail::is_##name##_imp::value>\ + {\ + template struct apply{ typedef is_##name type; };\ + }; + +#define BOOST_MATH_META_BOOL(name, Default)\ + template struct name : public boost::mpl::bool_{};\ + namespace detail{\ + template \ + char test_is_valid_arg(const name*);\ + char test_is_default_arg(const name*);\ + template struct is_##name##_tester\ + {\ + template static char test(const name&);\ + static double test(...);\ + };\ + template struct is_##name##_imp\ + {\ + static T inst;\ + BOOST_STATIC_CONSTANT(bool, value = sizeof( ::boost::math::policies::detail::is_##name##_tester::test(inst)) == 1);\ + };\ + }\ + template struct is_##name : public boost::mpl::bool_< ::boost::math::policies::detail::is_##name##_imp::value>\ + {\ + template struct apply{ typedef is_##name type; };\ + }; +#endif +// +// Begin by defining policy types for error handling: +// +enum error_policy_type +{ + throw_on_error = 0, + errno_on_error = 1, + ignore_error = 2, + user_error = 3 +}; + +BOOST_MATH_META_INT(error_policy_type, domain_error, BOOST_MATH_DOMAIN_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, pole_error, BOOST_MATH_POLE_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, overflow_error, BOOST_MATH_OVERFLOW_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, underflow_error, BOOST_MATH_UNDERFLOW_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, denorm_error, BOOST_MATH_DENORM_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, evaluation_error, BOOST_MATH_EVALUATION_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, rounding_error, BOOST_MATH_ROUNDING_ERROR_POLICY) +BOOST_MATH_META_INT(error_policy_type, indeterminate_result_error, BOOST_MATH_INDETERMINATE_RESULT_ERROR_POLICY) + +// +// Policy types for internal promotion: +// +BOOST_MATH_META_BOOL(promote_float, BOOST_MATH_PROMOTE_FLOAT_POLICY) +BOOST_MATH_META_BOOL(promote_double, BOOST_MATH_PROMOTE_DOUBLE_POLICY) +BOOST_MATH_META_BOOL(assert_undefined, BOOST_MATH_ASSERT_UNDEFINED_POLICY) +// +// Policy types for discrete quantiles: +// +enum discrete_quantile_policy_type +{ + real, + integer_round_outwards, + integer_round_inwards, + integer_round_down, + integer_round_up, + integer_round_nearest +}; + +BOOST_MATH_META_INT(discrete_quantile_policy_type, discrete_quantile, BOOST_MATH_DISCRETE_QUANTILE_POLICY) +// +// Precision: +// +BOOST_MATH_META_INT(int, digits10, BOOST_MATH_DIGITS10_POLICY) +BOOST_MATH_META_INT(int, digits2, 0) +// +// Iterations: +// +BOOST_MATH_META_INT(unsigned long, max_series_iterations, BOOST_MATH_MAX_SERIES_ITERATION_POLICY) +BOOST_MATH_META_INT(unsigned long, max_root_iterations, BOOST_MATH_MAX_ROOT_ITERATION_POLICY) +// +// Define the names for each possible policy: +// +#define BOOST_MATH_PARAMETER(name)\ + BOOST_PARAMETER_TEMPLATE_KEYWORD(name##_name)\ + BOOST_PARAMETER_NAME(name##_name) + +struct default_policy{}; + +namespace detail{ +// +// Trait to work out bits precision from digits10 and digits2: +// +template +struct precision +{ + // + // Now work out the precision: + // + typedef typename mpl::if_c< + (Digits10::value == 0), + digits2<0>, + digits2<((Digits10::value + 1) * 1000L) / 301L> + >::type digits2_type; +public: +#ifdef __BORLANDC__ + typedef typename mpl::if_c< + (Digits2::value > ::boost::math::policies::detail::precision::digits2_type::value), + Digits2, digits2_type>::type type; +#else + typedef typename mpl::if_c< + (Digits2::value > digits2_type::value), + Digits2, digits2_type>::type type; +#endif +}; + +template +struct select_result +{ + typedef A type; +}; +template +struct select_result +{ + typedef typename mpl::deref::type type; +}; + +template +struct find_arg +{ +private: + typedef typename mpl::find_if::type iter; + typedef typename mpl::end::type end_type; +public: + typedef typename select_result< + DefaultType, iter, + ::boost::is_same::value>::type type; +}; + +double test_is_valid_arg(...); +double test_is_default_arg(...); +char test_is_valid_arg(const default_policy*); +char test_is_default_arg(const default_policy*); + +template +struct is_valid_policy_imp +{ + BOOST_STATIC_CONSTANT(bool, value = sizeof(::boost::math::policies::detail::test_is_valid_arg(static_cast(0))) == 1); +}; + +template +struct is_default_policy_imp +{ + BOOST_STATIC_CONSTANT(bool, value = sizeof(::boost::math::policies::detail::test_is_default_arg(static_cast(0))) == 1); +}; + +template struct is_valid_policy +: public mpl::bool_< + ::boost::math::policies::detail::is_valid_policy_imp::value> +{}; + +template struct is_default_policy +: public mpl::bool_< + ::boost::math::policies::detail::is_default_policy_imp::value> +{ + template + struct apply + { + typedef is_default_policy type; + }; +}; + +template +struct append_N +{ + typedef typename mpl::push_back::type new_seq; + typedef typename append_N::type type; +}; + +template +struct append_N +{ + typedef Seq type; +}; + +// +// Traits class to work out what template parameters our default +// policy<> class will have when modified for forwarding: +// +template +struct default_args +{ + typedef promote_float arg1; + typedef promote_double arg2; +}; + +template <> +struct default_args +{ + typedef default_policy arg1; + typedef default_policy arg2; +}; + +template <> +struct default_args +{ + typedef promote_float arg1; + typedef default_policy arg2; +}; + +template <> +struct default_args +{ + typedef promote_double arg1; + typedef default_policy arg2; +}; + +typedef default_args::arg1 forwarding_arg1; +typedef default_args::arg2 forwarding_arg2; + +} // detail +// +// Now define the policy type with enough arguments to handle all +// the policies: +// +template +struct policy +{ +private: + // + // Validate all our arguments: + // + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + BOOST_STATIC_ASSERT(::boost::math::policies::detail::is_valid_policy::value); + // + // Typelist of the arguments: + // + typedef mpl::list arg_list; + +public: + typedef typename detail::find_arg, domain_error<> >::type domain_error_type; + typedef typename detail::find_arg, pole_error<> >::type pole_error_type; + typedef typename detail::find_arg, overflow_error<> >::type overflow_error_type; + typedef typename detail::find_arg, underflow_error<> >::type underflow_error_type; + typedef typename detail::find_arg, denorm_error<> >::type denorm_error_type; + typedef typename detail::find_arg, evaluation_error<> >::type evaluation_error_type; + typedef typename detail::find_arg, rounding_error<> >::type rounding_error_type; + typedef typename detail::find_arg, indeterminate_result_error<> >::type indeterminate_result_error_type; +private: + // + // Now work out the precision: + // + typedef typename detail::find_arg, digits10<> >::type digits10_type; + typedef typename detail::find_arg, digits2<> >::type bits_precision_type; +public: + typedef typename detail::precision::type precision_type; + // + // Internal promotion: + // + typedef typename detail::find_arg, promote_float<> >::type promote_float_type; + typedef typename detail::find_arg, promote_double<> >::type promote_double_type; + // + // Discrete quantiles: + // + typedef typename detail::find_arg, discrete_quantile<> >::type discrete_quantile_type; + // + // Mathematically undefined properties: + // + typedef typename detail::find_arg, discrete_quantile<> >::type assert_undefined_type; + // + // Max iterations: + // + typedef typename detail::find_arg, max_series_iterations<> >::type max_series_iterations_type; + typedef typename detail::find_arg, max_root_iterations<> >::type max_root_iterations_type; +}; +// +// These full specializations are defined to reduce the amount of +// template instantiations that have to take place when using the default +// policies, they have quite a large impact on compile times: +// +template <> +struct policy +{ +public: + typedef domain_error<> domain_error_type; + typedef pole_error<> pole_error_type; + typedef overflow_error<> overflow_error_type; + typedef underflow_error<> underflow_error_type; + typedef denorm_error<> denorm_error_type; + typedef evaluation_error<> evaluation_error_type; + typedef rounding_error<> rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; +#if BOOST_MATH_DIGITS10_POLICY == 0 + typedef digits2<> precision_type; +#else + typedef detail::precision, digits2<> >::type precision_type; +#endif + typedef promote_float<> promote_float_type; + typedef promote_double<> promote_double_type; + typedef discrete_quantile<> discrete_quantile_type; + typedef assert_undefined<> assert_undefined_type; + typedef max_series_iterations<> max_series_iterations_type; + typedef max_root_iterations<> max_root_iterations_type; +}; + +template <> +struct policy +{ +public: + typedef domain_error<> domain_error_type; + typedef pole_error<> pole_error_type; + typedef overflow_error<> overflow_error_type; + typedef underflow_error<> underflow_error_type; + typedef denorm_error<> denorm_error_type; + typedef evaluation_error<> evaluation_error_type; + typedef rounding_error<> rounding_error_type; + typedef indeterminate_result_error<> indeterminate_result_error_type; +#if BOOST_MATH_DIGITS10_POLICY == 0 + typedef digits2<> precision_type; +#else + typedef detail::precision, digits2<> >::type precision_type; +#endif + typedef promote_float promote_float_type; + typedef promote_double promote_double_type; + typedef discrete_quantile<> discrete_quantile_type; + typedef assert_undefined<> assert_undefined_type; + typedef max_series_iterations<> max_series_iterations_type; + typedef max_root_iterations<> max_root_iterations_type; +}; + +template +struct normalise +{ +private: + typedef mpl::list arg_list; + typedef typename detail::find_arg, typename Policy::domain_error_type >::type domain_error_type; + typedef typename detail::find_arg, typename Policy::pole_error_type >::type pole_error_type; + typedef typename detail::find_arg, typename Policy::overflow_error_type >::type overflow_error_type; + typedef typename detail::find_arg, typename Policy::underflow_error_type >::type underflow_error_type; + typedef typename detail::find_arg, typename Policy::denorm_error_type >::type denorm_error_type; + typedef typename detail::find_arg, typename Policy::evaluation_error_type >::type evaluation_error_type; + typedef typename detail::find_arg, typename Policy::rounding_error_type >::type rounding_error_type; + typedef typename detail::find_arg, typename Policy::indeterminate_result_error_type >::type indeterminate_result_error_type; + // + // Now work out the precision: + // + typedef typename detail::find_arg, digits10<> >::type digits10_type; + typedef typename detail::find_arg, typename Policy::precision_type >::type bits_precision_type; + typedef typename detail::precision::type precision_type; + // + // Internal promotion: + // + typedef typename detail::find_arg, typename Policy::promote_float_type >::type promote_float_type; + typedef typename detail::find_arg, typename Policy::promote_double_type >::type promote_double_type; + // + // Discrete quantiles: + // + typedef typename detail::find_arg, typename Policy::discrete_quantile_type >::type discrete_quantile_type; + // + // Mathematically undefined properties: + // + typedef typename detail::find_arg, discrete_quantile<> >::type assert_undefined_type; + // + // Max iterations: + // + typedef typename detail::find_arg, max_series_iterations<> >::type max_series_iterations_type; + typedef typename detail::find_arg, max_root_iterations<> >::type max_root_iterations_type; + // + // Define a typelist of the policies: + // + typedef mpl::vector< + domain_error_type, + pole_error_type, + overflow_error_type, + underflow_error_type, + denorm_error_type, + evaluation_error_type, + rounding_error_type, + indeterminate_result_error_type, + precision_type, + promote_float_type, + promote_double_type, + discrete_quantile_type, + assert_undefined_type, + max_series_iterations_type, + max_root_iterations_type> result_list; + // + // Remove all the policies that are the same as the default: + // + typedef typename mpl::remove_if >::type reduced_list; + // + // Pad out the list with defaults: + // + typedef typename detail::append_N::value)>::type result_type; +public: + typedef policy< + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type, + typename mpl::at >::type > type; +}; +// +// Full specialisation to speed up compilation of the common case: +// +template <> +struct normalise, + promote_float, + promote_double, + discrete_quantile<>, + assert_undefined<>, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy> +{ + typedef policy type; +}; + +template <> +struct normalise, + promote_float, + promote_double, + discrete_quantile<>, + assert_undefined<>, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy, + default_policy> +{ + typedef policy type; +}; + +inline policy<> make_policy() +{ return policy<>(); } + +template +inline typename normalise, A1>::type make_policy(const A1&) +{ + typedef typename normalise, A1>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2>::type make_policy(const A1&, const A2&) +{ + typedef typename normalise, A1, A2>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3>::type make_policy(const A1&, const A2&, const A3&) +{ + typedef typename normalise, A1, A2, A3>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4>::type make_policy(const A1&, const A2&, const A3&, const A4&) +{ + typedef typename normalise, A1, A2, A3, A4>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&) +{ + typedef typename normalise, A1, A2, A3, A4, A5>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7, A8>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10>::type result_type; + return result_type(); +} + +template +inline typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type make_policy(const A1&, const A2&, const A3&, const A4&, const A5&, const A6&, const A7&, const A8&, const A9&, const A10&, const A11&) +{ + typedef typename normalise, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11>::type result_type; + return result_type(); +} + +// +// Traits class to handle internal promotion: +// +template +struct evaluation +{ + typedef Real type; +}; + +template +struct evaluation +{ + typedef typename mpl::if_::type type; +}; + +template +struct evaluation +{ + typedef typename mpl::if_::type type; +}; + +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + +template +struct basic_digits : public mpl::int_<0>{ }; +template <> +struct basic_digits : public mpl::int_{ }; +template <> +struct basic_digits : public mpl::int_{ }; +template <> +struct basic_digits : public mpl::int_{ }; + +template +struct precision +{ + BOOST_STATIC_ASSERT( ::std::numeric_limits::radix == 2); + typedef typename Policy::precision_type precision_type; + typedef basic_digits digits_t; + typedef typename mpl::if_< + mpl::equal_to >, + // Possibly unknown precision: + precision_type, + typename mpl::if_< + mpl::or_, mpl::less_equal > >, + // Default case, full precision for RealType: + digits2< ::std::numeric_limits::digits>, + // User customised precision: + precision_type + >::type + >::type type; +}; + +template +struct precision +{ + typedef digits2 type; +}; +template +struct precision +{ + typedef digits2 type; +}; +template +struct precision +{ + typedef digits2 type; +}; + +#else + +template +struct precision +{ + BOOST_STATIC_ASSERT((::std::numeric_limits::radix == 2) || ((::std::numeric_limits::is_specialized == 0) || (::std::numeric_limits::digits == 0))); +#ifndef __BORLANDC__ + typedef typename Policy::precision_type precision_type; + typedef typename mpl::if_c< + ((::std::numeric_limits::is_specialized == 0) || (::std::numeric_limits::digits == 0)), + // Possibly unknown precision: + precision_type, + typename mpl::if_c< + ((::std::numeric_limits::digits <= precision_type::value) + || (Policy::precision_type::value <= 0)), + // Default case, full precision for RealType: + digits2< ::std::numeric_limits::digits>, + // User customised precision: + precision_type + >::type + >::type type; +#else + typedef typename Policy::precision_type precision_type; + typedef mpl::int_< ::std::numeric_limits::digits> digits_t; + typedef mpl::bool_< ::std::numeric_limits::is_specialized> spec_t; + typedef typename mpl::if_< + mpl::or_, mpl::equal_to > >, + // Possibly unknown precision: + precision_type, + typename mpl::if_< + mpl::or_, mpl::less_equal > >, + // Default case, full precision for RealType: + digits2< ::std::numeric_limits::digits>, + // User customised precision: + precision_type + >::type + >::type type; +#endif +}; + +#endif + +namespace detail{ + +template +inline int digits_imp(mpl::true_ const&) +{ +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + BOOST_STATIC_ASSERT( ::std::numeric_limits::is_specialized); +#else + BOOST_ASSERT(::std::numeric_limits::is_specialized); +#endif + typedef typename boost::math::policies::precision::type p_t; + return p_t::value; +} + +template +inline int digits_imp(mpl::false_ const&) +{ + return tools::digits(); +} + +} // namespace detail + +template +inline int digits(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) +{ + typedef mpl::bool_< std::numeric_limits::is_specialized > tag_type; + return detail::digits_imp(tag_type()); +} + +template +inline unsigned long get_max_series_iterations() +{ + typedef typename Policy::max_series_iterations_type iter_type; + return iter_type::value; +} + +template +inline unsigned long get_max_root_iterations() +{ + typedef typename Policy::max_root_iterations_type iter_type; + return iter_type::value; +} + +namespace detail{ + +template +struct series_factor_calc +{ + static T get() + { + return ldexp(T(1.0), 1 - Digits::value); + } +}; + +template +struct series_factor_calc +{ + static T get() + { + return boost::math::tools::epsilon(); + } +}; +template +struct series_factor_calc +{ + static T get() + { + static const boost::uintmax_t v = static_cast(1u) << (Digits::value - 1); + return 1 / static_cast(v); + } +}; +template +struct series_factor_calc +{ + static T get() + { + return boost::math::tools::epsilon(); + } +}; + +template +inline T get_epsilon_imp(mpl::true_ const&) +{ +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + BOOST_STATIC_ASSERT( ::std::numeric_limits::is_specialized); + BOOST_STATIC_ASSERT( ::std::numeric_limits::radix == 2); +#else + BOOST_ASSERT(::std::numeric_limits::is_specialized); + BOOST_ASSERT(::std::numeric_limits::radix == 2); +#endif + typedef typename boost::math::policies::precision::type p_t; + typedef mpl::bool_::digits> is_small_int; + typedef mpl::bool_= std::numeric_limits::digits> is_default_value; + return series_factor_calc::get(); +} + +template +inline T get_epsilon_imp(mpl::false_ const&) +{ + return tools::epsilon(); +} + +} // namespace detail + +template +inline T get_epsilon(BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(T)) +{ + typedef mpl::bool_< (std::numeric_limits::is_specialized && (std::numeric_limits::radix == 2)) > tag_type; + return detail::get_epsilon_imp(tag_type()); +} + +namespace detail{ + +template +char test_is_policy(const policy*); +double test_is_policy(...); + +template +struct is_policy_imp +{ + BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::math::policies::detail::test_is_policy(static_cast(0))) == 1)); +}; + +} + +template +struct is_policy : public mpl::bool_< ::boost::math::policies::detail::is_policy_imp

::value> {}; + +}}} // namespaces + +#endif // BOOST_MATH_POLICY_HPP + + + diff --git a/boost/boost/math/special_functions/detail/fp_traits.hpp b/boost/boost/math/special_functions/detail/fp_traits.hpp new file mode 100644 index 0000000000..54d45917be --- /dev/null +++ b/boost/boost/math/special_functions/detail/fp_traits.hpp @@ -0,0 +1,570 @@ +// fp_traits.hpp + +#ifndef BOOST_MATH_FP_TRAITS_HPP +#define BOOST_MATH_FP_TRAITS_HPP + +// Copyright (c) 2006 Johan Rade + +// 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) + +/* +To support old compilers, care has been taken to avoid partial template +specialization and meta function forwarding. +With these techniques, the code could be simplified. +*/ + +#if defined(__vms) && defined(__DECCXX) && !__IEEE_FLOAT +// The VAX floating point formats are used (for float and double) +# define BOOST_FPCLASSIFY_VAX_FORMAT +#endif + +#include + +#include +#include +#include +#include +#include + +#ifdef BOOST_NO_STDC_NAMESPACE + namespace std{ using ::memcpy; } +#endif + +#ifndef FP_NORMAL + +#define FP_ZERO 0 +#define FP_NORMAL 1 +#define FP_INFINITE 2 +#define FP_NAN 3 +#define FP_SUBNORMAL 4 + +#else + +#define BOOST_HAS_FPCLASSIFY + +#ifndef fpclassify +# if (defined(__GLIBCPP__) || defined(__GLIBCXX__)) \ + && defined(_GLIBCXX_USE_C99_MATH) \ + && !(defined(_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC) \ + && (_GLIBCXX_USE_C99_FP_MACROS_DYNAMIC != 0)) +# ifdef _STLP_VENDOR_CSTD +# if _STLPORT_VERSION >= 0x520 +# define BOOST_FPCLASSIFY_PREFIX ::__std_alias:: +# else +# define BOOST_FPCLASSIFY_PREFIX ::_STLP_VENDOR_CSTD:: +# endif +# else +# define BOOST_FPCLASSIFY_PREFIX ::std:: +# endif +# else +# undef BOOST_HAS_FPCLASSIFY +# define BOOST_FPCLASSIFY_PREFIX +# endif +#elif (defined(__HP_aCC) && !defined(__hppa)) +// aCC 6 appears to do "#define fpclassify fpclassify" which messes us up a bit! +# define BOOST_FPCLASSIFY_PREFIX :: +#else +# define BOOST_FPCLASSIFY_PREFIX +#endif + +#ifdef __MINGW32__ +# undef BOOST_HAS_FPCLASSIFY +#endif + +#endif + + +//------------------------------------------------------------------------------ + +namespace boost { +namespace math { +namespace detail { + +//------------------------------------------------------------------------------ + +/* +The following classes are used to tag the different methods that are used +for floating point classification +*/ + +struct native_tag {}; +template +struct generic_tag {}; +struct ieee_tag {}; +struct ieee_copy_all_bits_tag : public ieee_tag {}; +struct ieee_copy_leading_bits_tag : public ieee_tag {}; + +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS +// +// These helper functions are used only when numeric_limits<> +// members are not compile time constants: +// +inline bool is_generic_tag_false(const generic_tag&) +{ + return true; +} +inline bool is_generic_tag_false(...) +{ + return false; +} +#endif + +//------------------------------------------------------------------------------ + +/* +Most processors support three different floating point precisions: +single precision (32 bits), double precision (64 bits) +and extended double precision (80 - 128 bits, depending on the processor) + +Note that the C++ type long double can be implemented +both as double precision and extended double precision. +*/ + +struct unknown_precision{}; +struct single_precision {}; +struct double_precision {}; +struct extended_double_precision {}; + +// native_tag version -------------------------------------------------------------- + +template struct fp_traits_native +{ + typedef native_tag method; +}; + +// generic_tag version ------------------------------------------------------------- + +template struct fp_traits_non_native +{ +#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + typedef generic_tag::is_specialized> method; +#else + typedef generic_tag method; +#endif +}; + +// ieee_tag versions --------------------------------------------------------------- + +/* +These specializations of fp_traits_non_native contain information needed +to "parse" the binary representation of a floating point number. + +Typedef members: + + bits -- the target type when copying the leading bytes of a floating + point number. It is a typedef for uint32_t or uint64_t. + + method -- tells us whether all bytes are copied or not. + It is a typedef for ieee_copy_all_bits_tag or ieee_copy_leading_bits_tag. + +Static data members: + + sign, exponent, flag, significand -- bit masks that give the meaning of the + bits in the leading bytes. + +Static function members: + + get_bits(), set_bits() -- provide access to the leading bytes. + +*/ + +// ieee_tag version, float (32 bits) ----------------------------------------------- + +#ifndef BOOST_FPCLASSIFY_VAX_FORMAT + +template<> struct fp_traits_non_native +{ + typedef ieee_copy_all_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7f800000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x007fffff); + + typedef uint32_t bits; + static void get_bits(float x, uint32_t& a) { std::memcpy(&a, &x, 4); } + static void set_bits(float& x, uint32_t a) { std::memcpy(&x, &a, 4); } +}; + +// ieee_tag version, double (64 bits) ---------------------------------------------- + +#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) \ + || defined(__BORLANDC__) || defined(__CODEGEAR__) + +template<> struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff); + + typedef uint32_t bits; + + static void get_bits(double x, uint32_t& a) + { + std::memcpy(&a, reinterpret_cast(&x) + offset_, 4); + } + + static void set_bits(double& x, uint32_t a) + { + std::memcpy(reinterpret_cast(&x) + offset_, &a, 4); + } + +private: + +#if defined(BOOST_BIG_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 0); +#elif defined(BOOST_LITTLE_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 4); +#else + BOOST_STATIC_ASSERT(false); +#endif +}; + +//.............................................................................. + +#else + +template<> struct fp_traits_non_native +{ + typedef ieee_copy_all_bits_tag method; + + static const uint64_t sign = ((uint64_t)0x80000000u) << 32; + static const uint64_t exponent = ((uint64_t)0x7ff00000) << 32; + static const uint64_t flag = 0; + static const uint64_t significand + = (((uint64_t)0x000fffff) << 32) + ((uint64_t)0xffffffffu); + + typedef uint64_t bits; + static void get_bits(double x, uint64_t& a) { std::memcpy(&a, &x, 8); } + static void set_bits(double& x, uint64_t a) { std::memcpy(&x, &a, 8); } +}; + +#endif + +#endif // #ifndef BOOST_FPCLASSIFY_VAX_FORMAT + +// long double (64 bits) ------------------------------------------------------- + +#if defined(BOOST_NO_INT64_T) || defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION)\ + || defined(__BORLANDC__) || defined(__CODEGEAR__) + +template<> struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff); + + typedef uint32_t bits; + + static void get_bits(long double x, uint32_t& a) + { + std::memcpy(&a, reinterpret_cast(&x) + offset_, 4); + } + + static void set_bits(long double& x, uint32_t a) + { + std::memcpy(reinterpret_cast(&x) + offset_, &a, 4); + } + +private: + +#if defined(BOOST_BIG_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 0); +#elif defined(BOOST_LITTLE_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 4); +#else + BOOST_STATIC_ASSERT(false); +#endif +}; + +//.............................................................................. + +#else + +template<> struct fp_traits_non_native +{ + typedef ieee_copy_all_bits_tag method; + + static const uint64_t sign = (uint64_t)0x80000000u << 32; + static const uint64_t exponent = (uint64_t)0x7ff00000 << 32; + static const uint64_t flag = 0; + static const uint64_t significand + = ((uint64_t)0x000fffff << 32) + (uint64_t)0xffffffffu; + + typedef uint64_t bits; + static void get_bits(long double x, uint64_t& a) { std::memcpy(&a, &x, 8); } + static void set_bits(long double& x, uint64_t a) { std::memcpy(&x, &a, 8); } +}; + +#endif + + +// long double (>64 bits), x86 and x64 ----------------------------------------- + +#if defined(__i386) || defined(__i386__) || defined(_M_IX86) \ + || defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) \ + || defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) + +// Intel extended double precision format (80 bits) + +template<> +struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff); + + typedef uint32_t bits; + + static void get_bits(long double x, uint32_t& a) + { + std::memcpy(&a, reinterpret_cast(&x) + 6, 4); + } + + static void set_bits(long double& x, uint32_t a) + { + std::memcpy(reinterpret_cast(&x) + 6, &a, 4); + } +}; + + +// long double (>64 bits), Itanium --------------------------------------------- + +#elif defined(__ia64) || defined(__ia64__) || defined(_M_IA64) + +// The floating point format is unknown at compile time +// No template specialization is provided. +// The generic_tag definition is used. + +// The Itanium supports both +// the Intel extended double precision format (80 bits) and +// the IEEE extended double precision format with 15 exponent bits (128 bits). + + +// long double (>64 bits), PowerPC --------------------------------------------- + +#elif defined(__powerpc) || defined(__powerpc__) || defined(__POWERPC__) \ + || defined(__ppc) || defined(__ppc__) || defined(__PPC__) + +// PowerPC extended double precision format (128 bits) + +template<> +struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7ff00000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x000fffff); + + typedef uint32_t bits; + + static void get_bits(long double x, uint32_t& a) + { + std::memcpy(&a, reinterpret_cast(&x) + offset_, 4); + } + + static void set_bits(long double& x, uint32_t a) + { + std::memcpy(reinterpret_cast(&x) + offset_, &a, 4); + } + +private: + +#if defined(BOOST_BIG_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 0); +#elif defined(BOOST_LITTLE_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 12); +#else + BOOST_STATIC_ASSERT(false); +#endif +}; + + +// long double (>64 bits), Motorola 68K ---------------------------------------- + +#elif defined(__m68k) || defined(__m68k__) \ + || defined(__mc68000) || defined(__mc68000__) \ + +// Motorola extended double precision format (96 bits) + +// It is the same format as the Intel extended double precision format, +// except that 1) it is big-endian, 2) the 3rd and 4th byte are padding, and +// 3) the flag bit is not set for infinity + +template<> +struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00008000); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x00007fff); + + // copy 1st, 2nd, 5th and 6th byte. 3rd and 4th byte are padding. + + typedef uint32_t bits; + + static void get_bits(long double x, uint32_t& a) + { + std::memcpy(&a, &x, 2); + std::memcpy(reinterpret_cast(&a) + 2, + reinterpret_cast(&x) + 4, 2); + } + + static void set_bits(long double& x, uint32_t a) + { + std::memcpy(&x, &a, 2); + std::memcpy(reinterpret_cast(&x) + 4, + reinterpret_cast(&a) + 2, 2); + } +}; + + +// long double (>64 bits), All other processors -------------------------------- + +#else + +// IEEE extended double precision format with 15 exponent bits (128 bits) + +template<> +struct fp_traits_non_native +{ + typedef ieee_copy_leading_bits_tag method; + + BOOST_STATIC_CONSTANT(uint32_t, sign = 0x80000000u); + BOOST_STATIC_CONSTANT(uint32_t, exponent = 0x7fff0000); + BOOST_STATIC_CONSTANT(uint32_t, flag = 0x00000000); + BOOST_STATIC_CONSTANT(uint32_t, significand = 0x0000ffff); + + typedef uint32_t bits; + + static void get_bits(long double x, uint32_t& a) + { + std::memcpy(&a, reinterpret_cast(&x) + offset_, 4); + } + + static void set_bits(long double& x, uint32_t a) + { + std::memcpy(reinterpret_cast(&x) + offset_, &a, 4); + } + +private: + +#if defined(BOOST_BIG_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 0); +#elif defined(BOOST_LITTLE_ENDIAN) + BOOST_STATIC_CONSTANT(int, offset_ = 12); +#else + BOOST_STATIC_ASSERT(false); +#endif +}; + +#endif + +//------------------------------------------------------------------------------ + +// size_to_precision is a type switch for converting a C++ floating point type +// to the corresponding precision type. + +template struct size_to_precision +{ + typedef unknown_precision type; +}; + +template<> struct size_to_precision<4, true> +{ + typedef single_precision type; +}; + +template<> struct size_to_precision<8, true> +{ + typedef double_precision type; +}; + +template<> struct size_to_precision<10, true> +{ + typedef extended_double_precision type; +}; + +template<> struct size_to_precision<12, true> +{ + typedef extended_double_precision type; +}; + +template<> struct size_to_precision<16, true> +{ + typedef extended_double_precision type; +}; + +//------------------------------------------------------------------------------ +// +// Figure out whether to use native classification functions based on +// whether T is a built in floating point type or not: +// +template +struct select_native +{ + typedef BOOST_DEDUCED_TYPENAME size_to_precision::value>::type precision; + typedef fp_traits_non_native type; +}; +template<> +struct select_native +{ + typedef fp_traits_native type; +}; +template<> +struct select_native +{ + typedef fp_traits_native type; +}; +template<> +struct select_native +{ + typedef fp_traits_native type; +}; + +//------------------------------------------------------------------------------ + +// fp_traits is a type switch that selects the right fp_traits_non_native + +#if (defined(BOOST_MATH_USE_C99) && !(defined(__GNUC__) && (__GNUC__ < 4))) \ + && !defined(__hpux) \ + && !defined(__DECCXX)\ + && !defined(__osf__) \ + && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION)\ + && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) +# define BOOST_MATH_USE_STD_FPCLASSIFY +#endif + +template struct fp_traits +{ + typedef BOOST_DEDUCED_TYPENAME size_to_precision::value>::type precision; +#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) + typedef typename select_native::type type; +#else + typedef fp_traits_non_native type; +#endif + typedef fp_traits_non_native sign_change_type; +}; + +//------------------------------------------------------------------------------ + +} // namespace detail +} // namespace math +} // namespace boost + +#endif diff --git a/boost/boost/math/special_functions/detail/round_fwd.hpp b/boost/boost/math/special_functions/detail/round_fwd.hpp new file mode 100644 index 0000000000..952259ae93 --- /dev/null +++ b/boost/boost/math/special_functions/detail/round_fwd.hpp @@ -0,0 +1,80 @@ +// Copyright John Maddock 2008. + +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_SPECIAL_ROUND_FWD_HPP +#define BOOST_MATH_SPECIAL_ROUND_FWD_HPP + +#include + +#ifdef _MSC_VER +#pragma once +#endif + +namespace boost +{ + namespace math + { + + template + T trunc(const T& v, const Policy& pol); + template + T trunc(const T& v); + template + int itrunc(const T& v, const Policy& pol); + template + int itrunc(const T& v); + template + long ltrunc(const T& v, const Policy& pol); + template + long ltrunc(const T& v); +#ifdef BOOST_HAS_LONG_LONG + template + boost::long_long_type lltrunc(const T& v, const Policy& pol); + template + boost::long_long_type lltrunc(const T& v); +#endif + template + T round(const T& v, const Policy& pol); + template + T round(const T& v); + template + int iround(const T& v, const Policy& pol); + template + int iround(const T& v); + template + long lround(const T& v, const Policy& pol); + template + long lround(const T& v); +#ifdef BOOST_HAS_LONG_LONG + template + boost::long_long_type llround(const T& v, const Policy& pol); + template + boost::long_long_type llround(const T& v); +#endif + template + T modf(const T& v, T* ipart, const Policy& pol); + template + T modf(const T& v, T* ipart); + template + T modf(const T& v, int* ipart, const Policy& pol); + template + T modf(const T& v, int* ipart); + template + T modf(const T& v, long* ipart, const Policy& pol); + template + T modf(const T& v, long* ipart); +#ifdef BOOST_HAS_LONG_LONG + template + T modf(const T& v, boost::long_long_type* ipart, const Policy& pol); + template + T modf(const T& v, boost::long_long_type* ipart); +#endif + + } +} +#endif // BOOST_MATH_SPECIAL_ROUND_FWD_HPP + diff --git a/boost/boost/math/special_functions/fpclassify.hpp b/boost/boost/math/special_functions/fpclassify.hpp new file mode 100644 index 0000000000..190b73ff44 --- /dev/null +++ b/boost/boost/math/special_functions/fpclassify.hpp @@ -0,0 +1,533 @@ +// Copyright John Maddock 2005-2008. +// Copyright (c) 2006-2008 Johan Rade +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_FPCLASSIFY_HPP +#define BOOST_MATH_FPCLASSIFY_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include +#include +#include +#include +#include +#include +#include +/*! + \file fpclassify.hpp + \brief Classify floating-point value as normal, subnormal, zero, infinite, or NaN. + \version 1.0 + \author John Maddock + */ + +/* + +1. If the platform is C99 compliant, then the native floating point +classification functions are used. However, note that we must only +define the functions which call std::fpclassify etc if that function +really does exist: otherwise a compiler may reject the code even though +the template is never instantiated. + +2. If the platform is not C99 compliant, and the binary format for +a floating point type (float, double or long double) can be determined +at compile time, then the following algorithm is used: + + If all exponent bits, the flag bit (if there is one), + and all significand bits are 0, then the number is zero. + + If all exponent bits and the flag bit (if there is one) are 0, + and at least one significand bit is 1, then the number is subnormal. + + If all exponent bits are 1 and all significand bits are 0, + then the number is infinity. + + If all exponent bits are 1 and at least one significand bit is 1, + then the number is a not-a-number. + + Otherwise the number is normal. + + This algorithm works for the IEEE 754 representation, + and also for several non IEEE 754 formats. + + Most formats have the structure + sign bit + exponent bits + significand bits. + + A few have the structure + sign bit + exponent bits + flag bit + significand bits. + The flag bit is 0 for zero and subnormal numbers, + and 1 for normal numbers and NaN. + It is 0 (Motorola 68K) or 1 (Intel) for infinity. + + To get the bits, the four or eight most significant bytes are copied + into an uint32_t or uint64_t and bit masks are applied. + This covers all the exponent bits and the flag bit (if there is one), + but not always all the significand bits. + Some of the functions below have two implementations, + depending on whether all the significand bits are copied or not. + +3. If the platform is not C99 compliant, and the binary format for +a floating point type (float, double or long double) can not be determined +at compile time, then comparison with std::numeric_limits values +is used. + +*/ + +#if defined(_MSC_VER) || defined(__BORLANDC__) +#include +#endif + +#ifdef BOOST_NO_STDC_NAMESPACE + namespace std{ using ::abs; using ::fabs; } +#endif + +namespace boost{ + +// +// This must not be located in any namespace under boost::math +// otherwise we can get into an infinite loop if isnan is +// a #define for "isnan" ! +// +namespace math_detail{ + +template +inline bool is_nan_helper(T t, const boost::true_type&) +{ +#ifdef isnan + return isnan(t); +#elif defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) || !defined(BOOST_HAS_FPCLASSIFY) + return false; +#else // BOOST_HAS_FPCLASSIFY + return (BOOST_FPCLASSIFY_PREFIX fpclassify(t) == (int)FP_NAN); +#endif +} + +template +inline bool is_nan_helper(T, const boost::false_type&) +{ + return false; +} + +} + +namespace math{ + +namespace detail{ + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY +template +inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const native_tag&) +{ + return (std::fpclassify)(t); +} +#endif + +template +inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag&) +{ + BOOST_MATH_INSTRUMENT_VARIABLE(t); + + // whenever possible check for Nan's first: +#if defined(BOOST_HAS_FPCLASSIFY) && !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) + if(::boost::math_detail::is_nan_helper(t, ::boost::is_floating_point())) + return FP_NAN; +#elif defined(isnan) + if(boost::math_detail::is_nan_helper(t, ::boost::is_floating_point())) + return FP_NAN; +#elif defined(_MSC_VER) || defined(__BORLANDC__) + if(::_isnan(boost::math::tools::real_cast(t))) + return FP_NAN; +#endif + // std::fabs broken on a few systems especially for long long!!!! + T at = (t < T(0)) ? -t : t; + + // Use a process of exclusion to figure out + // what kind of type we have, this relies on + // IEEE conforming reals that will treat + // Nan's as unordered. Some compilers + // don't do this once optimisations are + // turned on, hence the check for nan's above. + if(at <= (std::numeric_limits::max)()) + { + if(at >= (std::numeric_limits::min)()) + return FP_NORMAL; + return (at != 0) ? FP_SUBNORMAL : FP_ZERO; + } + else if(at > (std::numeric_limits::max)()) + return FP_INFINITE; + return FP_NAN; +} + +template +inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(T t, const generic_tag&) +{ +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized) + return fp_classify_imp(t, mpl::true_()); +#endif + // + // An unknown type with no numeric_limits support, + // so what are we supposed to do we do here? + // + BOOST_MATH_INSTRUMENT_VARIABLE(t); + + return t == 0 ? FP_ZERO : FP_NORMAL; +} + +template +int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_all_bits_tag) +{ + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_MATH_INSTRUMENT_VARIABLE(x); + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + BOOST_MATH_INSTRUMENT_VARIABLE(a); + a &= traits::exponent | traits::flag | traits::significand; + BOOST_MATH_INSTRUMENT_VARIABLE((traits::exponent | traits::flag | traits::significand)); + BOOST_MATH_INSTRUMENT_VARIABLE(a); + + if(a <= traits::significand) { + if(a == 0) + return FP_ZERO; + else + return FP_SUBNORMAL; + } + + if(a < traits::exponent) return FP_NORMAL; + + a &= traits::significand; + if(a == 0) return FP_INFINITE; + + return FP_NAN; +} + +template +int fpclassify_imp BOOST_NO_MACRO_EXPAND(T x, ieee_copy_leading_bits_tag) +{ + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_MATH_INSTRUMENT_VARIABLE(x); + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent | traits::flag | traits::significand; + + if(a <= traits::significand) { + if(x == 0) + return FP_ZERO; + else + return FP_SUBNORMAL; + } + + if(a < traits::exponent) return FP_NORMAL; + + a &= traits::significand; + traits::set_bits(x,a); + if(x == 0) return FP_INFINITE; + + return FP_NAN; +} + +#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) +template <> +inline int fpclassify_imp BOOST_NO_MACRO_EXPAND(long double t, const native_tag&) +{ + return boost::math::detail::fpclassify_imp(t, generic_tag()); +} +#endif + +} // namespace detail + +template +inline int fpclassify BOOST_NO_MACRO_EXPAND(T t) +{ + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized && detail::is_generic_tag_false(method())) + return detail::fpclassify_imp(t, detail::generic_tag()); + return detail::fpclassify_imp(t, method()); +#else + return detail::fpclassify_imp(t, method()); +#endif +} + +namespace detail { + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY + template + inline bool isfinite_impl(T x, native_tag const&) + { + return (std::isfinite)(x); + } +#endif + + template + inline bool isfinite_impl(T x, generic_tag const&) + { + return x >= -(std::numeric_limits::max)() + && x <= (std::numeric_limits::max)(); + } + + template + inline bool isfinite_impl(T x, generic_tag const&) + { +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized) + return isfinite_impl(x, mpl::true_()); +#endif + (void)x; // warning supression. + return true; + } + + template + inline bool isfinite_impl(T x, ieee_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME detail::fp_traits::type traits; + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent; + return a != traits::exponent; + } + +#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) +template <> +inline bool isfinite_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&) +{ + return boost::math::detail::isfinite_impl(t, generic_tag()); +} +#endif + +} + +template +inline bool (isfinite)(T x) +{ //!< \brief return true if floating-point type t is finite. + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + return detail::isfinite_impl(x, method()); +} + +//------------------------------------------------------------------------------ + +namespace detail { + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY + template + inline bool isnormal_impl(T x, native_tag const&) + { + return (std::isnormal)(x); + } +#endif + + template + inline bool isnormal_impl(T x, generic_tag const&) + { + if(x < 0) x = -x; + return x >= (std::numeric_limits::min)() + && x <= (std::numeric_limits::max)(); + } + + template + inline bool isnormal_impl(T x, generic_tag const&) + { +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized) + return isnormal_impl(x, mpl::true_()); +#endif + return !(x == 0); + } + + template + inline bool isnormal_impl(T x, ieee_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME detail::fp_traits::type traits; + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent | traits::flag; + return (a != 0) && (a < traits::exponent); + } + +#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) +template <> +inline bool isnormal_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&) +{ + return boost::math::detail::isnormal_impl(t, generic_tag()); +} +#endif + +} + +template +inline bool (isnormal)(T x) +{ + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + return detail::isnormal_impl(x, method()); +} + +//------------------------------------------------------------------------------ + +namespace detail { + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY + template + inline bool isinf_impl(T x, native_tag const&) + { + return (std::isinf)(x); + } +#endif + + template + inline bool isinf_impl(T x, generic_tag const&) + { + (void)x; // in case the compiler thinks that x is unused because std::numeric_limits::has_infinity is false + return std::numeric_limits::has_infinity + && ( x == std::numeric_limits::infinity() + || x == -std::numeric_limits::infinity()); + } + + template + inline bool isinf_impl(T x, generic_tag const&) + { +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized) + return isinf_impl(x, mpl::true_()); +#endif + (void)x; // warning supression. + return false; + } + + template + inline bool isinf_impl(T x, ieee_copy_all_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent | traits::significand; + return a == traits::exponent; + } + + template + inline bool isinf_impl(T x, ieee_copy_leading_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent | traits::significand; + if(a != traits::exponent) + return false; + + traits::set_bits(x,0); + return x == 0; + } + +#if defined(BOOST_MATH_USE_STD_FPCLASSIFY) && defined(BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) +template <> +inline bool isinf_impl BOOST_NO_MACRO_EXPAND(long double t, const native_tag&) +{ + return boost::math::detail::isinf_impl(t, generic_tag()); +} +#endif + +} // namespace detail + +template +inline bool (isinf)(T x) +{ + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + return detail::isinf_impl(x, method()); +} + +//------------------------------------------------------------------------------ + +namespace detail { + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY + template + inline bool isnan_impl(T x, native_tag const&) + { + return (std::isnan)(x); + } +#endif + + template + inline bool isnan_impl(T x, generic_tag const&) + { + return std::numeric_limits::has_infinity + ? !(x <= std::numeric_limits::infinity()) + : x != x; + } + + template + inline bool isnan_impl(T x, generic_tag const&) + { +#ifdef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS + if(std::numeric_limits::is_specialized) + return isnan_impl(x, mpl::true_()); +#endif + (void)x; // warning supression + return false; + } + + template + inline bool isnan_impl(T x, ieee_copy_all_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a &= traits::exponent | traits::significand; + return a > traits::exponent; + } + + template + inline bool isnan_impl(T x, ieee_copy_leading_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + + a &= traits::exponent | traits::significand; + if(a < traits::exponent) + return false; + + a &= traits::significand; + traits::set_bits(x,a); + return x != 0; + } + +} // namespace detail + +template bool (isnan)(T x) +{ //!< \brief return true if floating-point type t is NaN (Not A Number). + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + return detail::isnan_impl(x, method()); +} + +#ifdef isnan +template <> inline bool isnan BOOST_NO_MACRO_EXPAND(float t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); } +template <> inline bool isnan BOOST_NO_MACRO_EXPAND(double t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); } +template <> inline bool isnan BOOST_NO_MACRO_EXPAND(long double t){ return ::boost::math_detail::is_nan_helper(t, boost::true_type()); } +#endif + +} // namespace math +} // namespace boost + +#endif // BOOST_MATH_FPCLASSIFY_HPP + diff --git a/boost/boost/math/special_functions/math_fwd.hpp b/boost/boost/math/special_functions/math_fwd.hpp new file mode 100644 index 0000000000..14364a3d5c --- /dev/null +++ b/boost/boost/math/special_functions/math_fwd.hpp @@ -0,0 +1,1070 @@ +// math_fwd.hpp + +// TODO revise completely for new distribution classes. + +// Copyright Paul A. Bristow 2006. +// Copyright John Maddock 2006. + +// Use, modification and distribution are 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) + +// Omnibus list of forward declarations of math special functions. + +// IT = Integer type. +// RT = Real type (built-in floating-point types, float, double, long double) & User Defined Types +// AT = Integer or Real type + +#ifndef BOOST_MATH_SPECIAL_MATH_FWD_HPP +#define BOOST_MATH_SPECIAL_MATH_FWD_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include +#include // for argument promotion. +#include +#include +#include + +#define BOOST_NO_MACRO_EXPAND /**/ + +namespace boost +{ + namespace math + { // Math functions (in roughly alphabetic order). + + // Beta functions. + template + typename tools::promote_args::type + beta(RT1 a, RT2 b); // Beta function (2 arguments). + + template + typename tools::promote_args::type + beta(RT1 a, RT2 b, A x); // Beta function (3 arguments). + + template + typename tools::promote_args::type + beta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Beta function (3 arguments). + + template + typename tools::promote_args::type + betac(RT1 a, RT2 b, RT3 x); + + template + typename tools::promote_args::type + betac(RT1 a, RT2 b, RT3 x, const Policy& pol); + + template + typename tools::promote_args::type + ibeta(RT1 a, RT2 b, RT3 x); // Incomplete beta function. + + template + typename tools::promote_args::type + ibeta(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta function. + + template + typename tools::promote_args::type + ibetac(RT1 a, RT2 b, RT3 x); // Incomplete beta complement function. + + template + typename tools::promote_args::type + ibetac(RT1 a, RT2 b, RT3 x, const Policy& pol); // Incomplete beta complement function. + + template + typename tools::promote_args::type + ibeta_inv(T1 a, T2 b, T3 p, T4* py); + + template + typename tools::promote_args::type + ibeta_inv(T1 a, T2 b, T3 p, T4* py, const Policy& pol); + + template + typename tools::promote_args::type + ibeta_inv(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibeta_inv(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibeta_inva(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibeta_inva(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibeta_invb(RT1 a, RT2 b, RT3 p); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibeta_invb(RT1 a, RT2 b, RT3 p, const Policy&); // Incomplete beta inverse function. + + template + typename tools::promote_args::type + ibetac_inv(T1 a, T2 b, T3 q, T4* py); + + template + typename tools::promote_args::type + ibetac_inv(T1 a, T2 b, T3 q, T4* py, const Policy& pol); + + template + typename tools::promote_args::type + ibetac_inv(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibetac_inv(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibetac_inva(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibetac_inva(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibetac_invb(RT1 a, RT2 b, RT3 q); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibetac_invb(RT1 a, RT2 b, RT3 q, const Policy&); // Incomplete beta complement inverse function. + + template + typename tools::promote_args::type + ibeta_derivative(RT1 a, RT2 b, RT3 x); // derivative of incomplete beta + + template + typename tools::promote_args::type + ibeta_derivative(RT1 a, RT2 b, RT3 x, const Policy& pol); // derivative of incomplete beta + + // erf & erfc error functions. + template // Error function. + typename tools::promote_args::type erf(RT z); + template // Error function. + typename tools::promote_args::type erf(RT z, const Policy&); + + template // Error function complement. + typename tools::promote_args::type erfc(RT z); + template // Error function complement. + typename tools::promote_args::type erfc(RT z, const Policy&); + + template // Error function inverse. + typename tools::promote_args::type erf_inv(RT z); + template // Error function inverse. + typename tools::promote_args::type erf_inv(RT z, const Policy& pol); + + template // Error function complement inverse. + typename tools::promote_args::type erfc_inv(RT z); + template // Error function complement inverse. + typename tools::promote_args::type erfc_inv(RT z, const Policy& pol); + + // Polynomials: + template + typename tools::promote_args::type + legendre_next(unsigned l, T1 x, T2 Pl, T3 Plm1); + + template + typename tools::promote_args::type + legendre_p(int l, T x); + + template + typename tools::promote_args::type + legendre_p(int l, T x, const Policy& pol); + + template + typename tools::promote_args::type + legendre_q(unsigned l, T x); + + template + typename tools::promote_args::type + legendre_q(unsigned l, T x, const Policy& pol); + + template + typename tools::promote_args::type + legendre_next(unsigned l, unsigned m, T1 x, T2 Pl, T3 Plm1); + + template + typename tools::promote_args::type + legendre_p(int l, int m, T x); + + template + typename tools::promote_args::type + legendre_p(int l, int m, T x, const Policy& pol); + + template + typename tools::promote_args::type + laguerre_next(unsigned n, T1 x, T2 Ln, T3 Lnm1); + + template + typename tools::promote_args::type + laguerre_next(unsigned n, unsigned l, T1 x, T2 Pl, T3 Plm1); + + template + typename tools::promote_args::type + laguerre(unsigned n, T x); + + template + typename tools::promote_args::type + laguerre(unsigned n, unsigned m, T x, const Policy& pol); + + template + struct laguerre_result + { + typedef typename mpl::if_< + policies::is_policy, + typename tools::promote_args::type, + typename tools::promote_args::type + >::type type; + }; + + template + typename laguerre_result::type + laguerre(unsigned n, T1 m, T2 x); + + template + typename tools::promote_args::type + hermite(unsigned n, T x); + + template + typename tools::promote_args::type + hermite(unsigned n, T x, const Policy& pol); + + template + typename tools::promote_args::type + hermite_next(unsigned n, T1 x, T2 Hn, T3 Hnm1); + + template + std::complex::type> + spherical_harmonic(unsigned n, int m, T1 theta, T2 phi); + + template + std::complex::type> + spherical_harmonic(unsigned n, int m, T1 theta, T2 phi, const Policy& pol); + + template + typename tools::promote_args::type + spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi); + + template + typename tools::promote_args::type + spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi, const Policy& pol); + + template + typename tools::promote_args::type + spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi); + + template + typename tools::promote_args::type + spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol); + + // Elliptic integrals: + template + typename tools::promote_args::type + ellint_rf(T1 x, T2 y, T3 z); + + template + typename tools::promote_args::type + ellint_rf(T1 x, T2 y, T3 z, const Policy& pol); + + template + typename tools::promote_args::type + ellint_rd(T1 x, T2 y, T3 z); + + template + typename tools::promote_args::type + ellint_rd(T1 x, T2 y, T3 z, const Policy& pol); + + template + typename tools::promote_args::type + ellint_rc(T1 x, T2 y); + + template + typename tools::promote_args::type + ellint_rc(T1 x, T2 y, const Policy& pol); + + template + typename tools::promote_args::type + ellint_rj(T1 x, T2 y, T3 z, T4 p); + + template + typename tools::promote_args::type + ellint_rj(T1 x, T2 y, T3 z, T4 p, const Policy& pol); + + template + typename tools::promote_args::type ellint_2(T k); + + template + typename tools::promote_args::type ellint_2(T1 k, T2 phi); + + template + typename tools::promote_args::type ellint_2(T1 k, T2 phi, const Policy& pol); + + template + typename tools::promote_args::type ellint_1(T k); + + template + typename tools::promote_args::type ellint_1(T1 k, T2 phi); + + template + typename tools::promote_args::type ellint_1(T1 k, T2 phi, const Policy& pol); + + namespace detail{ + + template + struct ellint_3_result + { + typedef typename mpl::if_< + policies::is_policy, + typename tools::promote_args::type, + typename tools::promote_args::type + >::type type; + }; + + } // namespace detail + + + template + typename detail::ellint_3_result::type ellint_3(T1 k, T2 v, T3 phi); + + template + typename tools::promote_args::type ellint_3(T1 k, T2 v, T3 phi, const Policy& pol); + + template + typename tools::promote_args::type ellint_3(T1 k, T2 v); + + // Factorial functions. + // Note: not for integral types, at present. + template + struct max_factorial; + template + RT factorial(unsigned int); + template + RT factorial(unsigned int, const Policy& pol); + template + RT unchecked_factorial(unsigned int BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(RT)); + template + RT double_factorial(unsigned i); + template + RT double_factorial(unsigned i, const Policy& pol); + + template + typename tools::promote_args::type falling_factorial(RT x, unsigned n); + + template + typename tools::promote_args::type falling_factorial(RT x, unsigned n, const Policy& pol); + + template + typename tools::promote_args::type rising_factorial(RT x, int n); + + template + typename tools::promote_args::type rising_factorial(RT x, int n, const Policy& pol); + + // Gamma functions. + template + typename tools::promote_args::type tgamma(RT z); + + template + typename tools::promote_args::type tgamma1pm1(RT z); + + template + typename tools::promote_args::type tgamma1pm1(RT z, const Policy& pol); + + template + typename tools::promote_args::type tgamma(RT1 a, RT2 z); + + template + typename tools::promote_args::type tgamma(RT1 a, RT2 z, const Policy& pol); + + template + typename tools::promote_args::type lgamma(RT z, int* sign); + + template + typename tools::promote_args::type lgamma(RT z, int* sign, const Policy& pol); + + template + typename tools::promote_args::type lgamma(RT x); + + template + typename tools::promote_args::type lgamma(RT x, const Policy& pol); + + template + typename tools::promote_args::type tgamma_lower(RT1 a, RT2 z); + + template + typename tools::promote_args::type tgamma_lower(RT1 a, RT2 z, const Policy&); + + template + typename tools::promote_args::type gamma_q(RT1 a, RT2 z); + + template + typename tools::promote_args::type gamma_q(RT1 a, RT2 z, const Policy&); + + template + typename tools::promote_args::type gamma_p(RT1 a, RT2 z); + + template + typename tools::promote_args::type gamma_p(RT1 a, RT2 z, const Policy&); + + template + typename tools::promote_args::type tgamma_delta_ratio(T1 z, T2 delta); + + template + typename tools::promote_args::type tgamma_delta_ratio(T1 z, T2 delta, const Policy&); + + template + typename tools::promote_args::type tgamma_ratio(T1 a, T2 b); + + template + typename tools::promote_args::type tgamma_ratio(T1 a, T2 b, const Policy&); + + template + typename tools::promote_args::type gamma_p_derivative(T1 a, T2 x); + + template + typename tools::promote_args::type gamma_p_derivative(T1 a, T2 x, const Policy&); + + // gamma inverse. + template + typename tools::promote_args::type gamma_p_inv(T1 a, T2 p); + + template + typename tools::promote_args::type gamma_p_inva(T1 a, T2 p, const Policy&); + + template + typename tools::promote_args::type gamma_p_inva(T1 a, T2 p); + + template + typename tools::promote_args::type gamma_p_inv(T1 a, T2 p, const Policy&); + + template + typename tools::promote_args::type gamma_q_inv(T1 a, T2 q); + + template + typename tools::promote_args::type gamma_q_inv(T1 a, T2 q, const Policy&); + + template + typename tools::promote_args::type gamma_q_inva(T1 a, T2 q); + + template + typename tools::promote_args::type gamma_q_inva(T1 a, T2 q, const Policy&); + + // digamma: + template + typename tools::promote_args::type digamma(T x); + + template + typename tools::promote_args::type digamma(T x, const Policy&); + + // Hypotenuse function sqrt(x ^ 2 + y ^ 2). + template + typename tools::promote_args::type + hypot(T1 x, T2 y); + + template + typename tools::promote_args::type + hypot(T1 x, T2 y, const Policy&); + + // cbrt - cube root. + template + typename tools::promote_args::type cbrt(RT z); + + template + typename tools::promote_args::type cbrt(RT z, const Policy&); + + // log1p is log(x + 1) + template + typename tools::promote_args::type log1p(T); + + template + typename tools::promote_args::type log1p(T, const Policy&); + + // log1pmx is log(x + 1) - x + template + typename tools::promote_args::type log1pmx(T); + + template + typename tools::promote_args::type log1pmx(T, const Policy&); + + // Exp (x) minus 1 functions. + template + typename tools::promote_args::type expm1(T); + + template + typename tools::promote_args::type expm1(T, const Policy&); + + // Power - 1 + template + typename tools::promote_args::type + powm1(const T1 a, const T2 z); + + template + typename tools::promote_args::type + powm1(const T1 a, const T2 z, const Policy&); + + // sqrt(1+x) - 1 + template + typename tools::promote_args::type sqrt1pm1(const T& val); + + template + typename tools::promote_args::type sqrt1pm1(const T& val, const Policy&); + + // sinus cardinals: + template + typename tools::promote_args::type sinc_pi(T x); + + template + typename tools::promote_args::type sinc_pi(T x, const Policy&); + + template + typename tools::promote_args::type sinhc_pi(T x); + + template + typename tools::promote_args::type sinhc_pi(T x, const Policy&); + + // inverse hyperbolics: + template + typename tools::promote_args::type asinh(T x); + + template + typename tools::promote_args::type asinh(T x, const Policy&); + + template + typename tools::promote_args::type acosh(T x); + + template + typename tools::promote_args::type acosh(T x, const Policy&); + + template + typename tools::promote_args::type atanh(T x); + + template + typename tools::promote_args::type atanh(T x, const Policy&); + + namespace detail{ + + typedef mpl::int_<0> bessel_no_int_tag; // No integer optimisation possible. + typedef mpl::int_<1> bessel_maybe_int_tag; // Maybe integer optimisation. + typedef mpl::int_<2> bessel_int_tag; // Definite integer optimistaion. + + template + struct bessel_traits + { + typedef typename tools::promote_args< + T1, T2 + >::type result_type; + + typedef typename policies::precision::type precision_type; + + typedef typename mpl::if_< + mpl::or_< + mpl::less_equal >, + mpl::greater > >, + bessel_no_int_tag, + typename mpl::if_< + is_integral, + bessel_int_tag, + bessel_maybe_int_tag + >::type + >::type optimisation_tag; + }; + } // detail + + // Bessel functions: + template + typename detail::bessel_traits::result_type cyl_bessel_j(T1 v, T2 x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type cyl_bessel_j(T1 v, T2 x); + + template + typename detail::bessel_traits::result_type sph_bessel(unsigned v, T x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type sph_bessel(unsigned v, T x); + + template + typename detail::bessel_traits::result_type cyl_bessel_i(T1 v, T2 x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type cyl_bessel_i(T1 v, T2 x); + + template + typename detail::bessel_traits::result_type cyl_bessel_k(T1 v, T2 x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type cyl_bessel_k(T1 v, T2 x); + + template + typename detail::bessel_traits::result_type cyl_neumann(T1 v, T2 x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type cyl_neumann(T1 v, T2 x); + + template + typename detail::bessel_traits::result_type sph_neumann(unsigned v, T x, const Policy& pol); + + template + typename detail::bessel_traits >::result_type sph_neumann(unsigned v, T x); + + template + typename tools::promote_args::type sin_pi(T x, const Policy&); + + template + typename tools::promote_args::type sin_pi(T x); + + template + typename tools::promote_args::type cos_pi(T x, const Policy&); + + template + typename tools::promote_args::type cos_pi(T x); + + template + int fpclassify BOOST_NO_MACRO_EXPAND(T t); + + template + bool isfinite BOOST_NO_MACRO_EXPAND(T z); + + template + bool isinf BOOST_NO_MACRO_EXPAND(T t); + + template + bool isnan BOOST_NO_MACRO_EXPAND(T t); + + template + bool isnormal BOOST_NO_MACRO_EXPAND(T t); + + template + int signbit BOOST_NO_MACRO_EXPAND(T x); + + template + int sign BOOST_NO_MACRO_EXPAND(const T& z); + + template + T copysign BOOST_NO_MACRO_EXPAND(const T& x, const T& y); + + template + T changesign BOOST_NO_MACRO_EXPAND(const T& z); + + // Exponential integrals: + namespace detail{ + + template + struct expint_result + { + typedef typename mpl::if_< + policies::is_policy, + typename tools::promote_args::type, + typename tools::promote_args::type + >::type type; + }; + + } // namespace detail + + template + typename tools::promote_args::type expint(unsigned n, T z, const Policy&); + + template + typename detail::expint_result::type expint(T const z, U const u); + + template + typename tools::promote_args::type expint(T z); + + // Zeta: + template + typename tools::promote_args::type zeta(T s, const Policy&); + + template + typename tools::promote_args::type zeta(T s); + + // pow: + template + typename tools::promote_args::type pow(T base, const Policy& policy); + + template + typename tools::promote_args::type pow(T base); + + // next: + template + T nextafter(const T&, const T&, const Policy&); + template + T nextafter(const T&, const T&); + template + T float_next(const T&, const Policy&); + template + T float_next(const T&); + template + T float_prior(const T&, const Policy&); + template + T float_prior(const T&); + template + T float_distance(const T&, const T&, const Policy&); + template + T float_distance(const T&, const T&); + + } // namespace math +} // namespace boost + +#ifdef BOOST_HAS_LONG_LONG +#define BOOST_MATH_DETAIL_LL_FUNC(Policy)\ + \ + template \ + inline T modf(const T& v, boost::long_long_type* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ + \ + template \ + inline boost::long_long_type lltrunc(const T& v){ using boost::math::lltrunc; return lltrunc(v, Policy()); }\ + \ + template \ + inline boost::long_long_type llround(const T& v){ using boost::math::llround; return llround(v, Policy()); }\ + +#else +#define BOOST_MATH_DETAIL_LL_FUNC(Policy) +#endif + +#define BOOST_MATH_DECLARE_SPECIAL_FUNCTIONS(Policy)\ + \ + BOOST_MATH_DETAIL_LL_FUNC(Policy)\ + \ + template \ + inline typename boost::math::tools::promote_args::type \ + beta(RT1 a, RT2 b) { return ::boost::math::beta(a, b, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + beta(RT1 a, RT2 b, A x){ return ::boost::math::beta(a, b, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + betac(RT1 a, RT2 b, RT3 x) { return ::boost::math::betac(a, b, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta(a, b, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibetac(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibetac(a, b, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta_inv(T1 a, T2 b, T3 p, T4* py){ return ::boost::math::ibeta_inv(a, b, p, py, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta_inv(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inv(a, b, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibetac_inv(T1 a, T2 b, T3 q, T4* py){ return ::boost::math::ibetac_inv(a, b, q, py, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta_inva(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_inva(a, b, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibetac_inva(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_inva(a, b, q, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta_invb(RT1 a, RT2 b, RT3 p){ return ::boost::math::ibeta_invb(a, b, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibetac_invb(T1 a, T2 b, T3 q){ return ::boost::math::ibetac_invb(a, b, q, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibetac_inv(RT1 a, RT2 b, RT3 q){ return ::boost::math::ibetac_inv(a, b, q, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ibeta_derivative(RT1 a, RT2 b, RT3 x){ return ::boost::math::ibeta_derivative(a, b, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type erf(RT z) { return ::boost::math::erf(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type erfc(RT z){ return ::boost::math::erfc(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type erf_inv(RT z) { return ::boost::math::erf_inv(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type erfc_inv(RT z){ return ::boost::math::erfc_inv(z, Policy()); }\ +\ + using boost::math::legendre_next;\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + legendre_p(int l, T x){ return ::boost::math::legendre_p(l, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + legendre_q(unsigned l, T x){ return ::boost::math::legendre_q(l, x, Policy()); }\ +\ + using ::boost::math::legendre_next;\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + legendre_p(int l, int m, T x){ return ::boost::math::legendre_p(l, m, x, Policy()); }\ +\ + using ::boost::math::laguerre_next;\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + laguerre(unsigned n, T x){ return ::boost::math::laguerre(n, x, Policy()); }\ +\ + template \ + inline typename boost::math::laguerre_result::type \ + laguerre(unsigned n, T1 m, T2 x) { return ::boost::math::laguerre(n, m, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + hermite(unsigned n, T x){ return ::boost::math::hermite(n, x, Policy()); }\ +\ + using boost::math::hermite_next;\ +\ + template \ + inline std::complex::type> \ + spherical_harmonic(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic(n, m, theta, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + spherical_harmonic_r(unsigned n, int m, T1 theta, T2 phi){ return ::boost::math::spherical_harmonic_r(n, m, theta, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi){ return boost::math::spherical_harmonic_i(n, m, theta, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + spherical_harmonic_i(unsigned n, int m, T1 theta, T2 phi, const Policy& pol);\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ellint_rf(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rf(x, y, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ellint_rd(T1 x, T2 y, T3 z){ return ::boost::math::ellint_rd(x, y, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ellint_rc(T1 x, T2 y){ return ::boost::math::ellint_rc(x, y, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + ellint_rj(T1 x, T2 y, T3 z, T4 p){ return boost::math::ellint_rj(x, y, z, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_2(T k){ return boost::math::ellint_2(k, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_2(T1 k, T2 phi){ return boost::math::ellint_2(k, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_1(T k){ return boost::math::ellint_1(k, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_1(T1 k, T2 phi){ return boost::math::ellint_1(k, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_3(T1 k, T2 v, T3 phi){ return boost::math::ellint_3(k, v, phi, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type ellint_3(T1 k, T2 v){ return boost::math::ellint_3(k, v, Policy()); }\ +\ + using boost::math::max_factorial;\ + template \ + inline RT factorial(unsigned int i) { return boost::math::factorial(i, Policy()); }\ + using boost::math::unchecked_factorial;\ + template \ + inline RT double_factorial(unsigned i){ return boost::math::double_factorial(i, Policy()); }\ + template \ + inline typename boost::math::tools::promote_args::type falling_factorial(RT x, unsigned n){ return boost::math::falling_factorial(x, n, Policy()); }\ + template \ + inline typename boost::math::tools::promote_args::type rising_factorial(RT x, unsigned n){ return boost::math::rising_factorial(x, n, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma(RT z){ return boost::math::tgamma(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma1pm1(RT z){ return boost::math::tgamma1pm1(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma(RT1 a, RT2 z){ return boost::math::tgamma(a, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type lgamma(RT z, int* sign){ return boost::math::lgamma(z, sign, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type lgamma(RT x){ return boost::math::lgamma(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma_lower(RT1 a, RT2 z){ return boost::math::tgamma_lower(a, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_q(RT1 a, RT2 z){ return boost::math::gamma_q(a, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_p(RT1 a, RT2 z){ return boost::math::gamma_p(a, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma_delta_ratio(T1 z, T2 delta){ return boost::math::tgamma_delta_ratio(z, delta, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type tgamma_ratio(T1 a, T2 b) { return boost::math::tgamma_ratio(a, b, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_p_derivative(T1 a, T2 x){ return boost::math::gamma_p_derivative(a, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_p_inv(T1 a, T2 p){ return boost::math::gamma_p_inv(a, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_p_inva(T1 a, T2 p){ return boost::math::gamma_p_inva(a, p, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_q_inv(T1 a, T2 q){ return boost::math::gamma_q_inv(a, q, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type gamma_q_inva(T1 a, T2 q){ return boost::math::gamma_q_inva(a, q, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type digamma(T x){ return boost::math::digamma(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + hypot(T1 x, T2 y){ return boost::math::hypot(x, y, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type cbrt(RT z){ return boost::math::cbrt(z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type log1p(T x){ return boost::math::log1p(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type log1pmx(T x){ return boost::math::log1pmx(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type expm1(T x){ return boost::math::expm1(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type \ + powm1(const T1 a, const T2 z){ return boost::math::powm1(a, z, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type sqrt1pm1(const T& val){ return boost::math::sqrt1pm1(val, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type sinc_pi(T x){ return boost::math::sinc_pi(x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type sinhc_pi(T x){ return boost::math::sinhc_pi(x, Policy()); }\ +\ + template\ + inline typename boost::math::tools::promote_args::type asinh(const T x){ return boost::math::asinh(x, Policy()); }\ +\ + template\ + inline typename boost::math::tools::promote_args::type acosh(const T x){ return boost::math::acosh(x, Policy()); }\ +\ + template\ + inline typename boost::math::tools::promote_args::type atanh(const T x){ return boost::math::atanh(x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type cyl_bessel_j(T1 v, T2 x)\ + { return boost::math::cyl_bessel_j(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type sph_bessel(unsigned v, T x)\ + { return boost::math::sph_bessel(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type \ + cyl_bessel_i(T1 v, T2 x) { return boost::math::cyl_bessel_i(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type \ + cyl_bessel_k(T1 v, T2 x) { return boost::math::cyl_bessel_k(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type \ + cyl_neumann(T1 v, T2 x){ return boost::math::cyl_neumann(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::detail::bessel_traits::result_type \ + sph_neumann(unsigned v, T x){ return boost::math::sph_neumann(v, x, Policy()); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type sin_pi(T x){ return boost::math::sin_pi(x); }\ +\ + template \ + inline typename boost::math::tools::promote_args::type cos_pi(T x){ return boost::math::cos_pi(x); }\ +\ + using boost::math::fpclassify;\ + using boost::math::isfinite;\ + using boost::math::isinf;\ + using boost::math::isnan;\ + using boost::math::isnormal;\ + using boost::math::signbit;\ + using boost::math::sign;\ + using boost::math::copysign;\ + using boost::math::changesign;\ + \ + template \ + inline typename boost::math::tools::promote_args::type expint(T const& z, U const& u)\ + { return boost::math::expint(z, u, Policy()); }\ + \ + template \ + inline typename boost::math::tools::promote_args::type expint(T z){ return boost::math::expint(z, Policy()); }\ + \ + template \ + inline typename boost::math::tools::promote_args::type zeta(T s){ return boost::math::zeta(s, Policy()); }\ + \ + template \ + inline T round(const T& v){ using boost::math::round; return round(v, Policy()); }\ + \ + template \ + inline int iround(const T& v){ using boost::math::iround; return iround(v, Policy()); }\ + \ + template \ + inline long lround(const T& v){ using boost::math::lround; return lround(v, Policy()); }\ + \ + template \ + inline T trunc(const T& v){ using boost::math::trunc; return trunc(v, Policy()); }\ + \ + template \ + inline int itrunc(const T& v){ using boost::math::itrunc; return itrunc(v, Policy()); }\ + \ + template \ + inline long ltrunc(const T& v){ using boost::math::ltrunc; return ltrunc(v, Policy()); }\ + \ + template \ + inline T modf(const T& v, T* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ + \ + template \ + inline T modf(const T& v, int* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ + \ + template \ + inline T modf(const T& v, long* ipart){ using boost::math::modf; return modf(v, ipart, Policy()); }\ + \ + template \ + inline typename boost::math::tools::promote_args::type pow(T v){ return boost::math::pow(v, Policy()); }\ + \ + template T nextafter(const T& a, const T& b){ return boost::math::nextafter(a, b, Policy()); }\ + template T float_next(const T& a){ return boost::math::float_next(a, Policy()); }\ + template T float_prior(const T& a){ return boost::math::float_prior(a, Policy()); }\ + template T float_distance(const T& a, const T& b){ return boost::math::float_distance(a, b, Policy()); }\ + + +#endif // BOOST_MATH_SPECIAL_MATH_FWD_HPP + + diff --git a/boost/boost/math/special_functions/sign.hpp b/boost/boost/math/special_functions/sign.hpp new file mode 100644 index 0000000000..6de88b29a2 --- /dev/null +++ b/boost/boost/math/special_functions/sign.hpp @@ -0,0 +1,145 @@ +// (C) Copyright John Maddock 2006. +// (C) Copyright Johan Rade 2006. +// (C) Copyright Paul A. Bristow 2011 (added changesign). + +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_TOOLS_SIGN_HPP +#define BOOST_MATH_TOOLS_SIGN_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include +#include +#include + +namespace boost{ namespace math{ + +namespace detail { + + // signbit + +#ifdef BOOST_MATH_USE_STD_FPCLASSIFY + template + inline int signbit_impl(T x, native_tag const&) + { + return (std::signbit)(x); + } +#endif + + template + inline int signbit_impl(T x, generic_tag const&) + { + return x < 0; + } + + template + inline int signbit_impl(T x, generic_tag const&) + { + return x < 0; + } + + template + inline int signbit_impl(T x, ieee_copy_all_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + return a & traits::sign ? 1 : 0; + } + + template + inline int signbit_impl(T x, ieee_copy_leading_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + + return a & traits::sign ? 1 : 0; + } + + // Changesign + + template + inline T (changesign_impl)(T x, generic_tag const&) + { + return -x; + } + + template + inline T (changesign_impl)(T x, generic_tag const&) + { + return -x; + } + + + template + inline T changesign_impl(T x, ieee_copy_all_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::sign_change_type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a ^= traits::sign; + traits::set_bits(x,a); + return x; + } + + template + inline T (changesign_impl)(T x, ieee_copy_leading_bits_tag const&) + { + typedef BOOST_DEDUCED_TYPENAME fp_traits::sign_change_type traits; + + BOOST_DEDUCED_TYPENAME traits::bits a; + traits::get_bits(x,a); + a ^= traits::sign; + traits::set_bits(x,a); + return x; + } + + +} // namespace detail + +template int (signbit)(T x) +{ + typedef typename detail::fp_traits::type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + return detail::signbit_impl(x, method()); +} + +template +inline int sign BOOST_NO_MACRO_EXPAND(const T& z) +{ + return (z == 0) ? 0 : (boost::math::signbit)(z) ? -1 : 1; +} + +template T (changesign)(const T& x) +{ //!< \brief return unchanged binary pattern of x, except for change of sign bit. + typedef typename detail::fp_traits::sign_change_type traits; + typedef typename traits::method method; + typedef typename boost::is_floating_point::type fp_tag; + + return detail::changesign_impl(x, method()); +} + +template +inline T copysign BOOST_NO_MACRO_EXPAND(const T& x, const T& y) +{ + BOOST_MATH_STD_USING + return (boost::math::signbit)(x) != (boost::math::signbit)(y) ? (boost::math::changesign)(x) : x; +} + +} // namespace math +} // namespace boost + + +#endif // BOOST_MATH_TOOLS_SIGN_HPP + + diff --git a/boost/boost/math/tools/config.hpp b/boost/boost/math/tools/config.hpp new file mode 100644 index 0000000000..2dc7bf9cf7 --- /dev/null +++ b/boost/boost/math/tools/config.hpp @@ -0,0 +1,310 @@ +// Copyright (c) 2006-7 John Maddock +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_TOOLS_CONFIG_HPP +#define BOOST_MATH_TOOLS_CONFIG_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +#include // for boost::uintmax_t +#include +#include +#include // for min and max +#include +#include +#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) +# include +#endif + +#include +#include + +#if (defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__NetBSD__) \ + || (defined(__hppa) && !defined(__OpenBSD__)) || defined(__NO_LONG_DOUBLE_MATH)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) +# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#endif +#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582)) +// +// Borland post 5.8.2 uses Dinkumware's std C lib which +// doesn't have true long double precision. Earlier +// versions are problematic too: +// +# define BOOST_MATH_NO_REAL_CONCEPT_TESTS +# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM) +# include +#endif +#if (defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)) && ((LDBL_MANT_DIG == 106) || (__LDBL_MANT_DIG__ == 106)) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) +// +// Darwin's rather strange "double double" is rather hard to +// support, it should be possible given enough effort though... +// +# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#endif +#if defined(unix) && defined(__INTEL_COMPILER) && (__INTEL_COMPILER <= 1000) && !defined(BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS) +// +// Intel compiler prior to version 10 has sporadic problems +// calling the long double overloads of the std lib math functions: +// calling ::powl is OK, but std::pow(long double, long double) +// may segfault depending upon the value of the arguments passed +// and the specific Linux distribution. +// +// We'll be conservative and disable long double support for this compiler. +// +// Comment out this #define and try building the tests to determine whether +// your Intel compiler version has this issue or not. +// +# define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#endif +#if defined(unix) && defined(__INTEL_COMPILER) +// +// Intel compiler has sporadic issues compiling std::fpclassify depending on +// the exact OS version used. Use our own code for this as we know it works +// well on Intel processors: +// +#define BOOST_MATH_DISABLE_STD_FPCLASSIFY +#endif + +#if defined(BOOST_MSVC) && !defined(_WIN32_WCE) + // Better safe than sorry, our tests don't support hardware exceptions: +# define BOOST_MATH_CONTROL_FP _control87(MCW_EM,MCW_EM) +#endif + +#ifdef __IBMCPP__ +# define BOOST_MATH_NO_DEDUCED_FUNCTION_POINTERS +#endif + +#if (defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901)) +# define BOOST_MATH_USE_C99 +#endif + +#if (defined(__hpux) && !defined(__hppa)) +# define BOOST_MATH_USE_C99 +#endif + +#if defined(__GNUC__) && defined(_GLIBCXX_USE_C99) +# define BOOST_MATH_USE_C99 +#endif + +#if defined(__CYGWIN__) || defined(__HP_aCC) || defined(BOOST_INTEL) \ + || defined(BOOST_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY) \ + || (defined(__GNUC__) && !defined(BOOST_MATH_USE_C99)) +# define BOOST_MATH_NO_NATIVE_LONG_DOUBLE_FP_CLASSIFY +#endif + +#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) || BOOST_WORKAROUND(__SUNPRO_CC, <= 0x590) + +# include "boost/type.hpp" +# include "boost/non_type.hpp" + +# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) boost::type* = 0 +# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) boost::type* +# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) boost::non_type* = 0 +# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) boost::non_type* + +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) \ + , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) \ + , BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) \ + , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) \ + , BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) + +#else + +// no workaround needed: expand to nothing + +# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE(t) +# define BOOST_MATH_EXPLICIT_TEMPLATE_TYPE_SPEC(t) +# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE(t, v) +# define BOOST_MATH_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) + +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE(t) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_TYPE_SPEC(t) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(t, v) +# define BOOST_MATH_APPEND_EXPLICIT_TEMPLATE_NON_TYPE_SPEC(t, v) + + +#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS + +#if defined(__SUNPRO_CC) || defined(__hppa) || defined(__GNUC__) +// Sun's compiler emits a hard error if a constant underflows, +// as does aCC on PA-RISC, while gcc issues a large number of warnings: +# define BOOST_MATH_SMALL_CONSTANT(x) 0 +#else +# define BOOST_MATH_SMALL_CONSTANT(x) x +#endif + + +#if BOOST_WORKAROUND(BOOST_MSVC, < 1400) +// +// Define if constants too large for a float cause "bad" +// values to be stored in the data, rather than infinity +// or a suitably large value. +// +# define BOOST_MATH_BUGGY_LARGE_FLOAT_CONSTANTS +#endif +// +// Tune performance options for specific compilers: +// +#ifdef BOOST_MSVC +# define BOOST_MATH_POLY_METHOD 2 +#elif defined(BOOST_INTEL) +# define BOOST_MATH_POLY_METHOD 2 +# define BOOST_MATH_RATIONAL_METHOD 2 +#elif defined(__GNUC__) +# define BOOST_MATH_POLY_METHOD 3 +# define BOOST_MATH_RATIONAL_METHOD 3 +# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT +# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L +#endif + +#if defined(BOOST_NO_LONG_LONG) && !defined(BOOST_MATH_INT_TABLE_TYPE) +# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) RT +# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##.0L +#endif + +// +// The maximum order of polynomial that will be evaluated +// via an unrolled specialisation: +// +#ifndef BOOST_MATH_MAX_POLY_ORDER +# define BOOST_MATH_MAX_POLY_ORDER 17 +#endif +// +// Set the method used to evaluate polynomials and rationals: +// +#ifndef BOOST_MATH_POLY_METHOD +# define BOOST_MATH_POLY_METHOD 1 +#endif +#ifndef BOOST_MATH_RATIONAL_METHOD +# define BOOST_MATH_RATIONAL_METHOD 0 +#endif +// +// decide whether to store constants as integers or reals: +// +#ifndef BOOST_MATH_INT_TABLE_TYPE +# define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT +#endif +#ifndef BOOST_MATH_INT_VALUE_SUFFIX +# define BOOST_MATH_INT_VALUE_SUFFIX(RV, SUF) RV##SUF +#endif + +// +// Helper macro for controlling the FP behaviour: +// +#ifndef BOOST_MATH_CONTROL_FP +# define BOOST_MATH_CONTROL_FP +#endif +// +// Helper macro for using statements: +// +#define BOOST_MATH_STD_USING \ + using std::abs;\ + using std::acos;\ + using std::cos;\ + using std::fmod;\ + using std::modf;\ + using std::tan;\ + using std::asin;\ + using std::cosh;\ + using std::frexp;\ + using std::pow;\ + using std::tanh;\ + using std::atan;\ + using std::exp;\ + using std::ldexp;\ + using std::sin;\ + using std::atan2;\ + using std::fabs;\ + using std::log;\ + using std::sinh;\ + using std::ceil;\ + using std::floor;\ + using std::log10;\ + using std::sqrt;\ + using boost::math::round;\ + using boost::math::iround;\ + using boost::math::lround;\ + using boost::math::trunc;\ + using boost::math::itrunc;\ + using boost::math::ltrunc;\ + using boost::math::modf; + + +namespace boost{ namespace math{ +namespace tools +{ + +template +inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c) +{ + return (std::max)((std::max)(a, b), c); +} + +template +inline T max BOOST_PREVENT_MACRO_SUBSTITUTION(T a, T b, T c, T d) +{ + return (std::max)((std::max)(a, b), (std::max)(c, d)); +} +} // namespace tools + +template +void suppress_unused_variable_warning(const T&) +{ +} + +}} // namespace boost namespace math + +#if ((defined(__linux__) && !defined(__UCLIBC__)) || defined(__QNX__) || defined(__IBMCPP__)) && !defined(BOOST_NO_FENV_H) + + #include + + namespace boost{ namespace math{ + namespace detail + { + struct fpu_guard + { + fpu_guard() + { + fegetexceptflag(&m_flags, FE_ALL_EXCEPT); + feclearexcept(FE_ALL_EXCEPT); + } + ~fpu_guard() + { + fesetexceptflag(&m_flags, FE_ALL_EXCEPT); + } + private: + fexcept_t m_flags; + }; + + } // namespace detail + }} // namespaces + +# define BOOST_FPU_EXCEPTION_GUARD boost::math::detail::fpu_guard local_guard_object; +# define BOOST_MATH_INSTRUMENT_FPU do{ fexcept_t cpu_flags; fegetexceptflag(&cpu_flags, FE_ALL_EXCEPT); BOOST_MATH_INSTRUMENT_VARIABLE(cpu_flags); } while(0); +#else // All other platforms. +# define BOOST_FPU_EXCEPTION_GUARD +# define BOOST_MATH_INSTRUMENT_FPU +#endif + +#ifdef BOOST_MATH_INSTRUMENT +#define BOOST_MATH_INSTRUMENT_CODE(x) \ + std::cout << std::setprecision(35) << __FILE__ << ":" << __LINE__ << " " << x << std::endl; +#define BOOST_MATH_INSTRUMENT_VARIABLE(name) BOOST_MATH_INSTRUMENT_CODE(BOOST_STRINGIZE(name) << " = " << name) +#else +#define BOOST_MATH_INSTRUMENT_CODE(x) +#define BOOST_MATH_INSTRUMENT_VARIABLE(name) +#endif + +#endif // BOOST_MATH_TOOLS_CONFIG_HPP + + + + + diff --git a/boost/boost/math/tools/promotion.hpp b/boost/boost/math/tools/promotion.hpp new file mode 100644 index 0000000000..728aaf1209 --- /dev/null +++ b/boost/boost/math/tools/promotion.hpp @@ -0,0 +1,150 @@ +// boost\math\tools\promotion.hpp + +// Copyright John Maddock 2006. +// Copyright Paul A. Bristow 2006. + +// Use, modification and distribution are 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) + +// Promote arguments functions to allow math functions to have arguments +// provided as integer OR real (floating-point, built-in or UDT) +// (called ArithmeticType in functions that use promotion) +// that help to reduce the risk of creating multiple instantiations. +// Allows creation of an inline wrapper that forwards to a foo(RT, RT) function, +// so you never get to instantiate any mixed foo(RT, IT) functions. + +#ifndef BOOST_MATH_PROMOTION_HPP +#define BOOST_MATH_PROMOTION_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +// Boost type traits: +#include +#include // for boost::is_floating_point; +#include // for boost::is_integral +#include // for boost::is_convertible +#include // for boost::is_same +#include // for boost::remove_cv +// Boost Template meta programming: +#include // for boost::mpl::if_c. +#include // for boost::mpl::if_c. +#include // for boost::mpl::if_c. +#include // for boost::mpl::if_c. + +#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +#include +#endif + +namespace boost +{ + namespace math + { + namespace tools + { + // If either T1 or T2 is an integer type, + // pretend it was a double (for the purposes of further analysis). + // Then pick the wider of the two floating-point types + // as the actual signature to forward to. + // For example: + // foo(int, short) -> double foo(double, double); + // foo(int, float) -> double foo(double, double); + // Note: NOT float foo(float, float) + // foo(int, double) -> foo(double, double); + // foo(double, float) -> double foo(double, double); + // foo(double, float) -> double foo(double, double); + // foo(any-int-or-float-type, long double) -> foo(long double, long double); + // but ONLY float foo(float, float) is unchanged. + // So the only way to get an entirely float version is to call foo(1.F, 2.F), + // But since most (all?) the math functions convert to double internally, + // probably there would not be the hoped-for gain by using float here. + + // This follows the C-compatible conversion rules of pow, etc + // where pow(int, float) is converted to pow(double, double). + + template + struct promote_arg + { // If T is integral type, then promote to double. + typedef typename mpl::if_, double, T>::type type; + }; + // These full specialisations reduce mpl::if_ usage and speed up + // compilation: + template <> struct promote_arg { typedef float type; }; + template <> struct promote_arg{ typedef double type; }; + template <> struct promote_arg { typedef long double type; }; + template <> struct promote_arg { typedef double type; }; + + template + struct promote_args_2 + { // Promote, if necessary, & pick the wider of the two floating-point types. + // for both parameter types, if integral promote to double. + typedef typename promote_arg::type T1P; // T1 perhaps promoted. + typedef typename promote_arg::type T2P; // T2 perhaps promoted. + + typedef typename mpl::if_< + typename mpl::and_, is_floating_point >::type, // both T1P and T2P are floating-point? + typename mpl::if_< typename mpl::or_, is_same >::type, // either long double? + long double, // then result type is long double. + typename mpl::if_< typename mpl::or_, is_same >::type, // either double? + double, // result type is double. + float // else result type is float. + >::type + >::type, + // else one or the other is a user-defined type: + typename mpl::if_< typename mpl::and_ >, ::boost::is_convertible >, T2P, T1P>::type>::type type; + }; // promote_arg2 + // These full specialisations reduce mpl::if_ usage and speed up + // compilation: + template <> struct promote_args_2 { typedef float type; }; + template <> struct promote_args_2{ typedef double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef long double type; }; + template <> struct promote_args_2 { typedef long double type; }; + + template + struct promote_args + { + typedef typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, + typename promote_args_2< + typename remove_cv::type, typename remove_cv::type + >::type + >::type + >::type + >::type + >::type type; + +#ifdef BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS + // + // Guard against use of long double if it's not supported: + // + BOOST_STATIC_ASSERT((0 == ::boost::is_same::value)); +#endif + }; + + } // namespace tools + } // namespace math +} // namespace boost + +#endif // BOOST_MATH_PROMOTION_HPP + diff --git a/boost/boost/math/tools/real_cast.hpp b/boost/boost/math/tools/real_cast.hpp new file mode 100644 index 0000000000..9b854e3014 --- /dev/null +++ b/boost/boost/math/tools/real_cast.hpp @@ -0,0 +1,29 @@ +// Copyright John Maddock 2006. +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_TOOLS_REAL_CAST_HPP +#define BOOST_MATH_TOOLS_REAL_CAST_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +namespace boost{ namespace math +{ + namespace tools + { + template + inline To real_cast(T t) + { + return static_cast(t); + } + } // namespace tools +} // namespace math +} // namespace boost + +#endif // BOOST_MATH_TOOLS_REAL_CAST_HPP + + + diff --git a/boost/boost/math/tools/user.hpp b/boost/boost/math/tools/user.hpp new file mode 100644 index 0000000000..c1bdaf7d87 --- /dev/null +++ b/boost/boost/math/tools/user.hpp @@ -0,0 +1,97 @@ +// Copyright John Maddock 2007. +// Copyright Paul A. Bristow 2007. + +// Use, modification and distribution are 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) + +#ifndef BOOST_MATH_TOOLS_USER_HPP +#define BOOST_MATH_TOOLS_USER_HPP + +#ifdef _MSC_VER +#pragma once +#endif + +// This file can be modified by the user to change the default policies. +// See "Changing the Policy Defaults" in documentation. + +// define this if the platform has no long double functions, +// or if the long double versions have only double precision: +// +// #define BOOST_MATH_NO_LONG_DOUBLE_MATH_FUNCTIONS +// +// Performance tuning options: +// +// #define BOOST_MATH_POLY_METHOD 3 +// #define BOOST_MATH_RATIONAL_METHOD 3 +// +// The maximum order of polynomial that will be evaluated +// via an unrolled specialisation: +// +// #define BOOST_MATH_MAX_POLY_ORDER 17 +// +// decide whether to store constants as integers or reals: +// +// #define BOOST_MATH_INT_TABLE_TYPE(RT, IT) IT + +// +// Default policies follow: +// +// Domain errors: +// +// #define BOOST_MATH_DOMAIN_ERROR_POLICY throw_on_error +// +// Pole errors: +// +// #define BOOST_MATH_POLE_ERROR_POLICY throw_on_error +// +// Overflow Errors: +// +// #define BOOST_MATH_OVERFLOW_ERROR_POLICY throw_on_error +// +// Internal Evaluation Errors: +// +// #define BOOST_MATH_EVALUATION_ERROR_POLICY throw_on_error +// +// Underfow: +// +// #define BOOST_MATH_UNDERFLOW_ERROR_POLICY ignore_error +// +// Denorms: +// +// #define BOOST_MATH_DENORM_ERROR_POLICY ignore_error +// +// Max digits to use for internal calculations: +// +// #define BOOST_MATH_DIGITS10_POLICY 0 +// +// Promote floats to doubles internally? +// +// #define BOOST_MATH_PROMOTE_FLOAT_POLICY true +// +// Promote doubles to long double internally: +// +// #define BOOST_MATH_PROMOTE_DOUBLE_POLICY true +// +// What do discrete quantiles return? +// +// #define BOOST_MATH_DISCRETE_QUANTILE_POLICY integer_round_outwards +// +// If a function is mathematically undefined +// (for example the Cauchy distribution has no mean), +// then do we stop the code from compiling? +// +// #define BOOST_MATH_ASSERT_UNDEFINED_POLICY true +// +// Maximum series iterstions permitted: +// +// #define BOOST_MATH_MAX_SERIES_ITERATION_POLICY 1000000 +// +// Maximum root finding steps permitted: +// +// define BOOST_MATH_MAX_ROOT_ITERATION_POLICY 200 + +#endif // BOOST_MATH_TOOLS_USER_HPP + + diff --git a/boost/boost/mpl/comparison.hpp b/boost/boost/mpl/comparison.hpp new file mode 100644 index 0000000000..005d280b46 --- /dev/null +++ b/boost/boost/mpl/comparison.hpp @@ -0,0 +1,24 @@ + +#ifndef BOOST_MPL_COMPARISON_HPP_INCLUDED +#define BOOST_MPL_COMPARISON_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: comparison.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include +#include +#include + +#endif // BOOST_MPL_COMPARISON_HPP_INCLUDED diff --git a/boost/boost/mpl/greater.hpp b/boost/boost/mpl/greater.hpp new file mode 100644 index 0000000000..e33ae487d5 --- /dev/null +++ b/boost/boost/mpl/greater.hpp @@ -0,0 +1,21 @@ + +#ifndef BOOST_MPL_GREATER_HPP_INCLUDED +#define BOOST_MPL_GREATER_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: greater.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#define AUX778076_OP_NAME greater +#define AUX778076_OP_TOKEN > +#include + +#endif // BOOST_MPL_GREATER_HPP_INCLUDED diff --git a/boost/boost/mpl/greater_equal.hpp b/boost/boost/mpl/greater_equal.hpp new file mode 100644 index 0000000000..91ccf83ece --- /dev/null +++ b/boost/boost/mpl/greater_equal.hpp @@ -0,0 +1,21 @@ + +#ifndef BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED +#define BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: greater_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#define AUX778076_OP_NAME greater_equal +#define AUX778076_OP_TOKEN >= +#include + +#endif // BOOST_MPL_GREATER_EQUAL_HPP_INCLUDED diff --git a/boost/boost/mpl/less_equal.hpp b/boost/boost/mpl/less_equal.hpp new file mode 100644 index 0000000000..2284d1d0c2 --- /dev/null +++ b/boost/boost/mpl/less_equal.hpp @@ -0,0 +1,21 @@ + +#ifndef BOOST_MPL_LESS_EQUAL_HPP_INCLUDED +#define BOOST_MPL_LESS_EQUAL_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: less_equal.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#define AUX778076_OP_NAME less_equal +#define AUX778076_OP_TOKEN <= +#include + +#endif // BOOST_MPL_LESS_EQUAL_HPP_INCLUDED diff --git a/boost/boost/mpl/limits/list.hpp b/boost/boost/mpl/limits/list.hpp new file mode 100644 index 0000000000..ee9c7aa187 --- /dev/null +++ b/boost/boost/mpl/limits/list.hpp @@ -0,0 +1,21 @@ + +#ifndef BOOST_MPL_LIMITS_LIST_HPP_INCLUDED +#define BOOST_MPL_LIMITS_LIST_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_LIMIT_LIST_SIZE) +# define BOOST_MPL_LIMIT_LIST_SIZE 20 +#endif + +#endif // BOOST_MPL_LIMITS_LIST_HPP_INCLUDED diff --git a/boost/boost/mpl/list.hpp b/boost/boost/mpl/list.hpp new file mode 100644 index 0000000000..838b8f4b12 --- /dev/null +++ b/boost/boost/mpl/list.hpp @@ -0,0 +1,57 @@ + +#ifndef BOOST_MPL_LIST_HPP_INCLUDED +#define BOOST_MPL_LIST_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +# include +# include + +# include +# include +# include + +#if !defined(BOOST_NEEDS_TOKEN_PASTING_OP_FOR_TOKENS_JUXTAPOSING) +# define AUX778076_LIST_HEADER \ + BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE).hpp \ + /**/ +#else +# define AUX778076_LIST_HEADER \ + BOOST_PP_CAT(list,BOOST_MPL_LIMIT_LIST_SIZE)##.hpp \ + /**/ +#endif + +# include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_LIST_HEADER) +# undef AUX778076_LIST_HEADER +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list.hpp +# include + +#else + +# include + +# define AUX778076_SEQUENCE_NAME list +# define AUX778076_SEQUENCE_LIMIT BOOST_MPL_LIMIT_LIST_SIZE +# include + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS +#endif // BOOST_MPL_LIST_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/O1_size.hpp b/boost/boost/mpl/list/aux_/O1_size.hpp new file mode 100644 index 0000000000..6ef2cf7fa0 --- /dev/null +++ b/boost/boost/mpl/list/aux_/O1_size.hpp @@ -0,0 +1,33 @@ + +#ifndef BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: O1_size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include + +namespace boost { namespace mpl { + +template<> +struct O1_size_impl< aux::list_tag > +{ + template< typename List > struct apply + : List::size + { + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_O1_SIZE_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/begin_end.hpp b/boost/boost/mpl/list/aux_/begin_end.hpp new file mode 100644 index 0000000000..dab60f318c --- /dev/null +++ b/boost/boost/mpl/list/aux_/begin_end.hpp @@ -0,0 +1,44 @@ + +#ifndef BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: begin_end.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include + +namespace boost { namespace mpl { + +template<> +struct begin_impl< aux::list_tag > +{ + template< typename List > struct apply + { + typedef l_iter type; + }; +}; + +template<> +struct end_impl< aux::list_tag > +{ + template< typename > struct apply + { + typedef l_iter type; + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_BEGIN_END_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/clear.hpp b/boost/boost/mpl/list/aux_/clear.hpp new file mode 100644 index 0000000000..247a4de536 --- /dev/null +++ b/boost/boost/mpl/list/aux_/clear.hpp @@ -0,0 +1,34 @@ + +#ifndef BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: clear.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include + +namespace boost { namespace mpl { + +template<> +struct clear_impl< aux::list_tag > +{ + template< typename List > struct apply + { + typedef l_end type; + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_CLEAR_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/empty.hpp b/boost/boost/mpl/list/aux_/empty.hpp new file mode 100644 index 0000000000..6ab60cfee0 --- /dev/null +++ b/boost/boost/mpl/list/aux_/empty.hpp @@ -0,0 +1,34 @@ + +#ifndef BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: empty.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include + +namespace boost { namespace mpl { + +template<> +struct empty_impl< aux::list_tag > +{ + template< typename List > struct apply + : not_ + { + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_EMPTY_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/front.hpp b/boost/boost/mpl/list/aux_/front.hpp new file mode 100644 index 0000000000..8defa99450 --- /dev/null +++ b/boost/boost/mpl/list/aux_/front.hpp @@ -0,0 +1,33 @@ + +#ifndef BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include + +namespace boost { namespace mpl { + +template<> +struct front_impl< aux::list_tag > +{ + template< typename List > struct apply + { + typedef typename List::item type; + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_FRONT_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/include_preprocessed.hpp b/boost/boost/mpl/list/aux_/include_preprocessed.hpp new file mode 100644 index 0000000000..431b51f5d9 --- /dev/null +++ b/boost/boost/mpl/list/aux_/include_preprocessed.hpp @@ -0,0 +1,35 @@ + +// Copyright Aleksey Gurtovoy 2001-2006 +// +// 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/mpl for documentation. + +// $Id: include_preprocessed.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION! + +#include + +#include +#include + +# define AUX778076_HEADER \ + aux_/preprocessed/plain/BOOST_MPL_PREPROCESSED_HEADER \ +/**/ + +#if BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(700)) +# define AUX778076_INCLUDE_STRING BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER) +# include AUX778076_INCLUDE_STRING +# undef AUX778076_INCLUDE_STRING +#else +# include BOOST_PP_STRINGIZE(boost/mpl/list/AUX778076_HEADER) +#endif + +# undef AUX778076_HEADER + +#undef BOOST_MPL_PREPROCESSED_HEADER diff --git a/boost/boost/mpl/list/aux_/item.hpp b/boost/boost/mpl/list/aux_/item.hpp new file mode 100644 index 0000000000..37ddff75e4 --- /dev/null +++ b/boost/boost/mpl/list/aux_/item.hpp @@ -0,0 +1,55 @@ + +#ifndef BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: item.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include + +namespace boost { namespace mpl { + +template< + typename Size + , typename T + , typename Next + > +struct l_item +{ +// agurt, 17/jul/03: to facilitate the deficient 'is_sequence' implementation +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + typedef int begin; +#endif + typedef aux::list_tag tag; + typedef l_item type; + + typedef Size size; + typedef T item; + typedef Next next; +}; + +struct l_end +{ +#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) + typedef int begin; +#endif + typedef aux::list_tag tag; + typedef l_end type; + typedef long_<0> size; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_NODE_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/iterator.hpp b/boost/boost/mpl/list/aux_/iterator.hpp new file mode 100644 index 0000000000..b94126cf72 --- /dev/null +++ b/boost/boost/mpl/list/aux_/iterator.hpp @@ -0,0 +1,76 @@ + +#ifndef BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: iterator.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace mpl { + +#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + +template< typename Node > +struct l_iter +{ + typedef aux::l_iter_tag tag; + typedef forward_iterator_tag category; +}; + +template< typename Node > +struct deref< l_iter > +{ + typedef typename Node::item type; +}; + +template< typename Node > +struct next< l_iter > +{ + typedef l_iter< typename Node::next > type; +}; + +#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + +template< typename Node > +struct l_iter +{ + typedef aux::l_iter_tag tag; + typedef forward_iterator_tag category; + typedef typename Node::item type; + typedef l_iter< typename mpl::next::type > next; +}; + +#endif + + +template<> struct l_iter +{ + typedef aux::l_iter_tag tag; + typedef forward_iterator_tag category; +#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) + typedef na type; + typedef l_iter next; +#endif +}; + +BOOST_MPL_AUX_PASS_THROUGH_LAMBDA_SPEC(1, l_iter) + +}} + +#endif // BOOST_MPL_LIST_AUX_ITERATOR_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/numbered.hpp b/boost/boost/mpl/list/aux_/numbered.hpp new file mode 100644 index 0000000000..de8d4041d3 --- /dev/null +++ b/boost/boost/mpl/list/aux_/numbered.hpp @@ -0,0 +1,68 @@ + +// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION + +// Copyright Peter Dimov 2000-2002 +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: numbered.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include + +#define i BOOST_PP_FRAME_ITERATION(1) + +#if i == 1 + +template< + BOOST_PP_ENUM_PARAMS(i, typename T) + > +struct list1 + : l_item< + long_<1> + , T0 + , l_end + > +{ + typedef list1 type; +}; + +#else + +# define MPL_AUX_LIST_TAIL(list, i, T) \ + BOOST_PP_CAT(list,BOOST_PP_DEC(i))< \ + BOOST_PP_ENUM_SHIFTED_PARAMS(i, T) \ + > \ + /**/ + +template< + BOOST_PP_ENUM_PARAMS(i, typename T) + > +struct BOOST_PP_CAT(list,i) + : l_item< + long_ + , T0 + , MPL_AUX_LIST_TAIL(list,i,T) + > +{ + typedef BOOST_PP_CAT(list,i) type; +}; + +# undef MPL_AUX_LIST_TAIL + +#endif // i == 1 + +#undef i + +#endif // BOOST_PP_IS_ITERATING diff --git a/boost/boost/mpl/list/aux_/numbered_c.hpp b/boost/boost/mpl/list/aux_/numbered_c.hpp new file mode 100644 index 0000000000..f3043827b1 --- /dev/null +++ b/boost/boost/mpl/list/aux_/numbered_c.hpp @@ -0,0 +1,71 @@ + +// NO INCLUDE GUARDS, THE HEADER IS INTENDED FOR MULTIPLE INCLUSION + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: numbered_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if defined(BOOST_PP_IS_ITERATING) + +#include +#include +#include +#include + +#define i BOOST_PP_FRAME_ITERATION(1) + +#if i == 1 + +template< + typename T + , BOOST_PP_ENUM_PARAMS(i, T C) + > +struct list1_c + : l_item< + long_<1> + , integral_c + , l_end + > +{ + typedef list1_c type; + typedef T value_type; +}; + +#else + +# define MPL_AUX_LIST_C_TAIL(list, i, C) \ + BOOST_PP_CAT(BOOST_PP_CAT(list,BOOST_PP_DEC(i)),_c) \ + /**/ + +template< + typename T + , BOOST_PP_ENUM_PARAMS(i, T C) + > +struct BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c) + : l_item< + long_ + , integral_c + , MPL_AUX_LIST_C_TAIL(list,i,C) + > +{ + typedef BOOST_PP_CAT(BOOST_PP_CAT(list,i),_c) type; + typedef T value_type; +}; + +# undef MPL_AUX_LIST_C_TAIL + +#endif // i == 1 + +#undef i + +#endif // BOOST_PP_IS_ITERATING diff --git a/boost/boost/mpl/list/aux_/pop_front.hpp b/boost/boost/mpl/list/aux_/pop_front.hpp new file mode 100644 index 0000000000..e053391c84 --- /dev/null +++ b/boost/boost/mpl/list/aux_/pop_front.hpp @@ -0,0 +1,34 @@ + +#ifndef BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: pop_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include + +namespace boost { namespace mpl { + +template<> +struct pop_front_impl< aux::list_tag > +{ + template< typename List > struct apply + { + typedef typename mpl::next::type type; + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_POP_FRONT_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list10.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list10.hpp new file mode 100644 index 0000000000..99368d2c18 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list10.hpp @@ -0,0 +1,149 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list10.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T0 + > +struct list1 + : l_item< + long_<1> + , T0 + , l_end + > +{ + typedef list1 type; +}; + +template< + typename T0, typename T1 + > +struct list2 + : l_item< + long_<2> + , T0 + , list1 + > +{ + typedef list2 type; +}; + +template< + typename T0, typename T1, typename T2 + > +struct list3 + : l_item< + long_<3> + , T0 + , list2< T1,T2 > + > +{ + typedef list3 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3 + > +struct list4 + : l_item< + long_<4> + , T0 + , list3< T1,T2,T3 > + > +{ + typedef list4 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + > +struct list5 + : l_item< + long_<5> + , T0 + , list4< T1,T2,T3,T4 > + > +{ + typedef list5 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5 + > +struct list6 + : l_item< + long_<6> + , T0 + , list5< T1,T2,T3,T4,T5 > + > +{ + typedef list6 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6 + > +struct list7 + : l_item< + long_<7> + , T0 + , list6< T1,T2,T3,T4,T5,T6 > + > +{ + typedef list7 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7 + > +struct list8 + : l_item< + long_<8> + , T0 + , list7< T1,T2,T3,T4,T5,T6,T7 > + > +{ + typedef list8 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8 + > +struct list9 + : l_item< + long_<9> + , T0 + , list8< T1,T2,T3,T4,T5,T6,T7,T8 > + > +{ + typedef list9 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + > +struct list10 + : l_item< + long_<10> + , T0 + , list9< T1,T2,T3,T4,T5,T6,T7,T8,T9 > + > +{ + typedef list10 type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list10_c.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list10_c.hpp new file mode 100644 index 0000000000..7133d71216 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list10_c.hpp @@ -0,0 +1,164 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list10_c.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T + , T C0 + > +struct list1_c + : l_item< + long_<1> + , integral_c< T,C0 > + , l_end + > +{ + typedef list1_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1 + > +struct list2_c + : l_item< + long_<2> + , integral_c< T,C0 > + , list1_c< T,C1 > + > +{ + typedef list2_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2 + > +struct list3_c + : l_item< + long_<3> + , integral_c< T,C0 > + , list2_c< T,C1,C2 > + > +{ + typedef list3_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3 + > +struct list4_c + : l_item< + long_<4> + , integral_c< T,C0 > + , list3_c< T,C1,C2,C3 > + > +{ + typedef list4_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4 + > +struct list5_c + : l_item< + long_<5> + , integral_c< T,C0 > + , list4_c< T,C1,C2,C3,C4 > + > +{ + typedef list5_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5 + > +struct list6_c + : l_item< + long_<6> + , integral_c< T,C0 > + , list5_c< T,C1,C2,C3,C4,C5 > + > +{ + typedef list6_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6 + > +struct list7_c + : l_item< + long_<7> + , integral_c< T,C0 > + , list6_c< T,C1,C2,C3,C4,C5,C6 > + > +{ + typedef list7_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7 + > +struct list8_c + : l_item< + long_<8> + , integral_c< T,C0 > + , list7_c< T,C1,C2,C3,C4,C5,C6,C7 > + > +{ + typedef list8_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8 + > +struct list9_c + : l_item< + long_<9> + , integral_c< T,C0 > + , list8_c< T,C1,C2,C3,C4,C5,C6,C7,C8 > + > +{ + typedef list9_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9 + > +struct list10_c + : l_item< + long_<10> + , integral_c< T,C0 > + , list9_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9 > + > +{ + typedef list10_c type; + typedef T value_type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list20.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list20.hpp new file mode 100644 index 0000000000..750e495f3f --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list20.hpp @@ -0,0 +1,169 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list20.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10 + > +struct list11 + : l_item< + long_<11> + , T0 + , list10< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10 > + > +{ + typedef list11 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11 + > +struct list12 + : l_item< + long_<12> + , T0 + , list11< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11 > + > +{ + typedef list12 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12 + > +struct list13 + : l_item< + long_<13> + , T0 + , list12< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12 > + > +{ + typedef list13 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13 + > +struct list14 + : l_item< + long_<14> + , T0 + , list13< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13 > + > +{ + typedef list14 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + > +struct list15 + : l_item< + long_<15> + , T0 + , list14< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14 > + > +{ + typedef list15 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15 + > +struct list16 + : l_item< + long_<16> + , T0 + , list15< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15 > + > +{ + typedef list16 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16 + > +struct list17 + : l_item< + long_<17> + , T0 + , list16< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16 > + > +{ + typedef list17 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17 + > +struct list18 + : l_item< + long_<18> + , T0 + , list17< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17 > + > +{ + typedef list18 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18 + > +struct list19 + : l_item< + long_<19> + , T0 + , list18< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18 > + > +{ + typedef list19 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + > +struct list20 + : l_item< + long_<20> + , T0 + , list19< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19 > + > +{ + typedef list20 type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list20_c.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list20_c.hpp new file mode 100644 index 0000000000..7f15acf3e9 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list20_c.hpp @@ -0,0 +1,173 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list20_c.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + > +struct list11_c + : l_item< + long_<11> + , integral_c< T,C0 > + , list10_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10 > + > +{ + typedef list11_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11 + > +struct list12_c + : l_item< + long_<12> + , integral_c< T,C0 > + , list11_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11 > + > +{ + typedef list12_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12 + > +struct list13_c + : l_item< + long_<13> + , integral_c< T,C0 > + , list12_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12 > + > +{ + typedef list13_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13 + > +struct list14_c + : l_item< + long_<14> + , integral_c< T,C0 > + , list13_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13 > + > +{ + typedef list14_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14 + > +struct list15_c + : l_item< + long_<15> + , integral_c< T,C0 > + , list14_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14 > + > +{ + typedef list15_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15 + > +struct list16_c + : l_item< + long_<16> + , integral_c< T,C0 > + , list15_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15 > + > +{ + typedef list16_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16 + > +struct list17_c + : l_item< + long_<17> + , integral_c< T,C0 > + , list16_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16 > + > +{ + typedef list17_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17 + > +struct list18_c + : l_item< + long_<18> + , integral_c< T,C0 > + , list17_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17 > + > +{ + typedef list18_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18 + > +struct list19_c + : l_item< + long_<19> + , integral_c< T,C0 > + , list18_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18 > + > +{ + typedef list19_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19 + > +struct list20_c + : l_item< + long_<20> + , integral_c< T,C0 > + , list19_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19 > + > +{ + typedef list20_c type; + typedef T value_type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list30.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list30.hpp new file mode 100644 index 0000000000..5459101196 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list30.hpp @@ -0,0 +1,189 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list30.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20 + > +struct list21 + : l_item< + long_<21> + , T0 + , list20< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20 > + > +{ + typedef list21 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21 + > +struct list22 + : l_item< + long_<22> + , T0 + , list21< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21 > + > +{ + typedef list22 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22 + > +struct list23 + : l_item< + long_<23> + , T0 + , list22< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22 > + > +{ + typedef list23 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23 + > +struct list24 + : l_item< + long_<24> + , T0 + , list23< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23 > + > +{ + typedef list24 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + > +struct list25 + : l_item< + long_<25> + , T0 + , list24< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24 > + > +{ + typedef list25 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25 + > +struct list26 + : l_item< + long_<26> + , T0 + , list25< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25 > + > +{ + typedef list26 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26 + > +struct list27 + : l_item< + long_<27> + , T0 + , list26< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26 > + > +{ + typedef list27 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27 + > +struct list28 + : l_item< + long_<28> + , T0 + , list27< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27 > + > +{ + typedef list28 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28 + > +struct list29 + : l_item< + long_<29> + , T0 + , list28< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28 > + > +{ + typedef list29 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + > +struct list30 + : l_item< + long_<30> + , T0 + , list29< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29 > + > +{ + typedef list30 type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list30_c.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list30_c.hpp new file mode 100644 index 0000000000..5393d792bd --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list30_c.hpp @@ -0,0 +1,183 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list30_c.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + > +struct list21_c + : l_item< + long_<21> + , integral_c< T,C0 > + , list20_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20 > + > +{ + typedef list21_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21 + > +struct list22_c + : l_item< + long_<22> + , integral_c< T,C0 > + , list21_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21 > + > +{ + typedef list22_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22 + > +struct list23_c + : l_item< + long_<23> + , integral_c< T,C0 > + , list22_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22 > + > +{ + typedef list23_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23 + > +struct list24_c + : l_item< + long_<24> + , integral_c< T,C0 > + , list23_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23 > + > +{ + typedef list24_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24 + > +struct list25_c + : l_item< + long_<25> + , integral_c< T,C0 > + , list24_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24 > + > +{ + typedef list25_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25 + > +struct list26_c + : l_item< + long_<26> + , integral_c< T,C0 > + , list25_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25 > + > +{ + typedef list26_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26 + > +struct list27_c + : l_item< + long_<27> + , integral_c< T,C0 > + , list26_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26 > + > +{ + typedef list27_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27 + > +struct list28_c + : l_item< + long_<28> + , integral_c< T,C0 > + , list27_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27 > + > +{ + typedef list28_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28 + > +struct list29_c + : l_item< + long_<29> + , integral_c< T,C0 > + , list28_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28 > + > +{ + typedef list29_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29 + > +struct list30_c + : l_item< + long_<30> + , integral_c< T,C0 > + , list29_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29 > + > +{ + typedef list30_c type; + typedef T value_type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list40.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list40.hpp new file mode 100644 index 0000000000..68c6761364 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list40.hpp @@ -0,0 +1,209 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list40.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30 + > +struct list31 + : l_item< + long_<31> + , T0 + , list30< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30 > + > +{ + typedef list31 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31 + > +struct list32 + : l_item< + long_<32> + , T0 + , list31< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31 > + > +{ + typedef list32 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32 + > +struct list33 + : l_item< + long_<33> + , T0 + , list32< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32 > + > +{ + typedef list33 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33 + > +struct list34 + : l_item< + long_<34> + , T0 + , list33< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33 > + > +{ + typedef list34 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + > +struct list35 + : l_item< + long_<35> + , T0 + , list34< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34 > + > +{ + typedef list35 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35 + > +struct list36 + : l_item< + long_<36> + , T0 + , list35< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35 > + > +{ + typedef list36 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36 + > +struct list37 + : l_item< + long_<37> + , T0 + , list36< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36 > + > +{ + typedef list37 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37 + > +struct list38 + : l_item< + long_<38> + , T0 + , list37< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37 > + > +{ + typedef list38 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38 + > +struct list39 + : l_item< + long_<39> + , T0 + , list38< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38 > + > +{ + typedef list39 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + > +struct list40 + : l_item< + long_<40> + , T0 + , list39< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39 > + > +{ + typedef list40 type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list40_c.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list40_c.hpp new file mode 100644 index 0000000000..0c51ba2095 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list40_c.hpp @@ -0,0 +1,193 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list40_c.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + > +struct list31_c + : l_item< + long_<31> + , integral_c< T,C0 > + , list30_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30 > + > +{ + typedef list31_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31 + > +struct list32_c + : l_item< + long_<32> + , integral_c< T,C0 > + , list31_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31 > + > +{ + typedef list32_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32 + > +struct list33_c + : l_item< + long_<33> + , integral_c< T,C0 > + , list32_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32 > + > +{ + typedef list33_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33 + > +struct list34_c + : l_item< + long_<34> + , integral_c< T,C0 > + , list33_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33 > + > +{ + typedef list34_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34 + > +struct list35_c + : l_item< + long_<35> + , integral_c< T,C0 > + , list34_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34 > + > +{ + typedef list35_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35 + > +struct list36_c + : l_item< + long_<36> + , integral_c< T,C0 > + , list35_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35 > + > +{ + typedef list36_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36 + > +struct list37_c + : l_item< + long_<37> + , integral_c< T,C0 > + , list36_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36 > + > +{ + typedef list37_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37 + > +struct list38_c + : l_item< + long_<38> + , integral_c< T,C0 > + , list37_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37 > + > +{ + typedef list38_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38 + > +struct list39_c + : l_item< + long_<39> + , integral_c< T,C0 > + , list38_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38 > + > +{ + typedef list39_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39 + > +struct list40_c + : l_item< + long_<40> + , integral_c< T,C0 > + , list39_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39 > + > +{ + typedef list40_c type; + typedef T value_type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list50.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list50.hpp new file mode 100644 index 0000000000..4cc22da278 --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list50.hpp @@ -0,0 +1,229 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list50.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40 + > +struct list41 + : l_item< + long_<41> + , T0 + , list40< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40 > + > +{ + typedef list41 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41 + > +struct list42 + : l_item< + long_<42> + , T0 + , list41< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41 > + > +{ + typedef list42 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42 + > +struct list43 + : l_item< + long_<43> + , T0 + , list42< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42 > + > +{ + typedef list43 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43 + > +struct list44 + : l_item< + long_<44> + , T0 + , list43< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43 > + > +{ + typedef list44 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + > +struct list45 + : l_item< + long_<45> + , T0 + , list44< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44 > + > +{ + typedef list45 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + , typename T45 + > +struct list46 + : l_item< + long_<46> + , T0 + , list45< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45 > + > +{ + typedef list46 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + , typename T45, typename T46 + > +struct list47 + : l_item< + long_<47> + , T0 + , list46< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46 > + > +{ + typedef list47 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + , typename T45, typename T46, typename T47 + > +struct list48 + : l_item< + long_<48> + , T0 + , list47< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47 > + > +{ + typedef list48 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + , typename T45, typename T46, typename T47, typename T48 + > +struct list49 + : l_item< + long_<49> + , T0 + , list48< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48 > + > +{ + typedef list49 type; +}; + +template< + typename T0, typename T1, typename T2, typename T3, typename T4 + , typename T5, typename T6, typename T7, typename T8, typename T9 + , typename T10, typename T11, typename T12, typename T13, typename T14 + , typename T15, typename T16, typename T17, typename T18, typename T19 + , typename T20, typename T21, typename T22, typename T23, typename T24 + , typename T25, typename T26, typename T27, typename T28, typename T29 + , typename T30, typename T31, typename T32, typename T33, typename T34 + , typename T35, typename T36, typename T37, typename T38, typename T39 + , typename T40, typename T41, typename T42, typename T43, typename T44 + , typename T45, typename T46, typename T47, typename T48, typename T49 + > +struct list50 + : l_item< + long_<50> + , T0 + , list49< T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,T12,T13,T14,T15,T16,T17,T18,T19,T20,T21,T22,T23,T24,T25,T26,T27,T28,T29,T30,T31,T32,T33,T34,T35,T36,T37,T38,T39,T40,T41,T42,T43,T44,T45,T46,T47,T48,T49 > + > +{ + typedef list50 type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/preprocessed/plain/list50_c.hpp b/boost/boost/mpl/list/aux_/preprocessed/plain/list50_c.hpp new file mode 100644 index 0000000000..28c061d5bf --- /dev/null +++ b/boost/boost/mpl/list/aux_/preprocessed/plain/list50_c.hpp @@ -0,0 +1,203 @@ + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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) +// + +// Preprocessed version of "boost/mpl/list/list50_c.hpp" header +// -- DO NOT modify by hand! + +namespace boost { namespace mpl { + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + > +struct list41_c + : l_item< + long_<41> + , integral_c< T,C0 > + , list40_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40 > + > +{ + typedef list41_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41 + > +struct list42_c + : l_item< + long_<42> + , integral_c< T,C0 > + , list41_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41 > + > +{ + typedef list42_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42 + > +struct list43_c + : l_item< + long_<43> + , integral_c< T,C0 > + , list42_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42 > + > +{ + typedef list43_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43 + > +struct list44_c + : l_item< + long_<44> + , integral_c< T,C0 > + , list43_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43 > + > +{ + typedef list44_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44 + > +struct list45_c + : l_item< + long_<45> + , integral_c< T,C0 > + , list44_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44 > + > +{ + typedef list45_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44, T C45 + > +struct list46_c + : l_item< + long_<46> + , integral_c< T,C0 > + , list45_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45 > + > +{ + typedef list46_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44, T C45, T C46 + > +struct list47_c + : l_item< + long_<47> + , integral_c< T,C0 > + , list46_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46 > + > +{ + typedef list47_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44, T C45, T C46, T C47 + > +struct list48_c + : l_item< + long_<48> + , integral_c< T,C0 > + , list47_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47 > + > +{ + typedef list48_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44, T C45, T C46, T C47, T C48 + > +struct list49_c + : l_item< + long_<49> + , integral_c< T,C0 > + , list48_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48 > + > +{ + typedef list49_c type; + typedef T value_type; +}; + +template< + typename T + , T C0, T C1, T C2, T C3, T C4, T C5, T C6, T C7, T C8, T C9, T C10 + , T C11, T C12, T C13, T C14, T C15, T C16, T C17, T C18, T C19, T C20 + , T C21, T C22, T C23, T C24, T C25, T C26, T C27, T C28, T C29, T C30 + , T C31, T C32, T C33, T C34, T C35, T C36, T C37, T C38, T C39, T C40 + , T C41, T C42, T C43, T C44, T C45, T C46, T C47, T C48, T C49 + > +struct list50_c + : l_item< + long_<50> + , integral_c< T,C0 > + , list49_c< T,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10,C11,C12,C13,C14,C15,C16,C17,C18,C19,C20,C21,C22,C23,C24,C25,C26,C27,C28,C29,C30,C31,C32,C33,C34,C35,C36,C37,C38,C39,C40,C41,C42,C43,C44,C45,C46,C47,C48,C49 > + > +{ + typedef list50_c type; + typedef T value_type; +}; + +}} diff --git a/boost/boost/mpl/list/aux_/push_back.hpp b/boost/boost/mpl/list/aux_/push_back.hpp new file mode 100644 index 0000000000..6adb7db762 --- /dev/null +++ b/boost/boost/mpl/list/aux_/push_back.hpp @@ -0,0 +1,36 @@ + +#ifndef BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: push_back.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include + +namespace boost { namespace mpl { + +template< typename Tag > struct has_push_back_impl; + +template<> +struct has_push_back_impl< aux::list_tag > +{ + template< typename Seq > struct apply + : false_ + { + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_PUSH_BACK_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/push_front.hpp b/boost/boost/mpl/list/aux_/push_front.hpp new file mode 100644 index 0000000000..a601fea169 --- /dev/null +++ b/boost/boost/mpl/list/aux_/push_front.hpp @@ -0,0 +1,39 @@ + +#ifndef BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: push_front.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include + +namespace boost { namespace mpl { + +template<> +struct push_front_impl< aux::list_tag > +{ + template< typename List, typename T > struct apply + { + typedef l_item< + typename next::type + , T + , typename List::type + > type; + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_PUSH_FRONT_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/size.hpp b/boost/boost/mpl/list/aux_/size.hpp new file mode 100644 index 0000000000..4ecbab83ca --- /dev/null +++ b/boost/boost/mpl/list/aux_/size.hpp @@ -0,0 +1,33 @@ + +#ifndef BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: size.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include + +namespace boost { namespace mpl { + +template<> +struct size_impl< aux::list_tag > +{ + template< typename List > struct apply + : List::size + { + }; +}; + +}} + +#endif // BOOST_MPL_LIST_AUX_SIZE_HPP_INCLUDED diff --git a/boost/boost/mpl/list/aux_/tag.hpp b/boost/boost/mpl/list/aux_/tag.hpp new file mode 100644 index 0000000000..d44bfe40e8 --- /dev/null +++ b/boost/boost/mpl/list/aux_/tag.hpp @@ -0,0 +1,24 @@ + +#ifndef BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED +#define BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: tag.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +namespace boost { namespace mpl { namespace aux { + +struct list_tag; +struct l_iter_tag; + +}}} + +#endif // BOOST_MPL_LIST_AUX_TAG_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list0.hpp b/boost/boost/mpl/list/list0.hpp new file mode 100644 index 0000000000..58e93cff56 --- /dev/null +++ b/boost/boost/mpl/list/list0.hpp @@ -0,0 +1,42 @@ + +#ifndef BOOST_MPL_LIST_LIST0_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST0_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list0.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace mpl { + +template< typename Dummy = na > struct list0; + +template<> struct list0 + : l_end +{ + typedef l_end type; +}; + +}} + +#endif // BOOST_MPL_LIST_LIST0_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list0_c.hpp b/boost/boost/mpl/list/list0_c.hpp new file mode 100644 index 0000000000..ed9bca5f43 --- /dev/null +++ b/boost/boost/mpl/list/list0_c.hpp @@ -0,0 +1,31 @@ + +#ifndef BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list0_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include + +namespace boost { namespace mpl { + +template< typename T > struct list0_c + : l_end +{ + typedef l_end type; + typedef T value_type; +}; + +}} + +#endif // BOOST_MPL_LIST_LIST0_C_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list10.hpp b/boost/boost/mpl/list/list10.hpp new file mode 100644 index 0000000000..4a4ee19954 --- /dev/null +++ b/boost/boost/mpl/list/list10.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST10_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST10_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list10.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list10.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(1, 10, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST10_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list10_c.hpp b/boost/boost/mpl/list/list10_c.hpp new file mode 100644 index 0000000000..e05ef87530 --- /dev/null +++ b/boost/boost/mpl/list/list10_c.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list10_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list10_c.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(1, 10, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST10_C_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list20.hpp b/boost/boost/mpl/list/list20.hpp new file mode 100644 index 0000000000..9321192a49 --- /dev/null +++ b/boost/boost/mpl/list/list20.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST20_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST20_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list20.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list20.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(11, 20, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST20_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list20_c.hpp b/boost/boost/mpl/list/list20_c.hpp new file mode 100644 index 0000000000..bc807e664d --- /dev/null +++ b/boost/boost/mpl/list/list20_c.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list20_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list20_c.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(11, 20, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST20_C_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list30.hpp b/boost/boost/mpl/list/list30.hpp new file mode 100644 index 0000000000..f736f8c590 --- /dev/null +++ b/boost/boost/mpl/list/list30.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST30_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST30_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list30.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list30.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(21, 30, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST30_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list30_c.hpp b/boost/boost/mpl/list/list30_c.hpp new file mode 100644 index 0000000000..e682086d99 --- /dev/null +++ b/boost/boost/mpl/list/list30_c.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list30_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list30_c.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(21, 30, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST30_C_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list40.hpp b/boost/boost/mpl/list/list40.hpp new file mode 100644 index 0000000000..8560d8fa37 --- /dev/null +++ b/boost/boost/mpl/list/list40.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST40_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST40_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list40.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list40.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(31, 40, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST40_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list40_c.hpp b/boost/boost/mpl/list/list40_c.hpp new file mode 100644 index 0000000000..5c5bfdfa4d --- /dev/null +++ b/boost/boost/mpl/list/list40_c.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list40_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list40_c.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(31, 40, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST40_C_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list50.hpp b/boost/boost/mpl/list/list50.hpp new file mode 100644 index 0000000000..dcaf18ebfd --- /dev/null +++ b/boost/boost/mpl/list/list50.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST50_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST50_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list50.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list50.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(41, 50, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST50_HPP_INCLUDED diff --git a/boost/boost/mpl/list/list50_c.hpp b/boost/boost/mpl/list/list50_c.hpp new file mode 100644 index 0000000000..0f38e07d13 --- /dev/null +++ b/boost/boost/mpl/list/list50_c.hpp @@ -0,0 +1,43 @@ + +#ifndef BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED +#define BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: list50_c.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#if !defined(BOOST_MPL_PREPROCESSING_MODE) +# include +#endif + +#include + +#if !defined(BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS) \ + && !defined(BOOST_MPL_PREPROCESSING_MODE) + +# define BOOST_MPL_PREPROCESSED_HEADER list50_c.hpp +# include + +#else + +# include + +namespace boost { namespace mpl { + +# define BOOST_PP_ITERATION_PARAMS_1 \ + (3,(41, 50, )) +# include BOOST_PP_ITERATE() + +}} + +#endif // BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS + +#endif // BOOST_MPL_LIST_LIST50_C_HPP_INCLUDED diff --git a/boost/boost/mpl/not_equal_to.hpp b/boost/boost/mpl/not_equal_to.hpp new file mode 100644 index 0000000000..00132b1eaa --- /dev/null +++ b/boost/boost/mpl/not_equal_to.hpp @@ -0,0 +1,21 @@ + +#ifndef BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED +#define BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// +// 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/mpl for documentation. + +// $Id: not_equal_to.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#define AUX778076_OP_NAME not_equal_to +#define AUX778076_OP_TOKEN != +#include + +#endif // BOOST_MPL_NOT_EQUAL_TO_HPP_INCLUDED diff --git a/boost/boost/mpl/remove_if.hpp b/boost/boost/mpl/remove_if.hpp new file mode 100644 index 0000000000..f707abd423 --- /dev/null +++ b/boost/boost/mpl/remove_if.hpp @@ -0,0 +1,83 @@ + +#ifndef BOOST_MPL_REMOVE_IF_HPP_INCLUDED +#define BOOST_MPL_REMOVE_IF_HPP_INCLUDED + +// Copyright Aleksey Gurtovoy 2000-2004 +// Copyright David Abrahams 2003-2004 +// +// 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/mpl for documentation. + +// $Id: remove_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ +// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ +// $Revision: 49267 $ + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace boost { namespace mpl { + +namespace aux { + +template< typename Pred, typename InsertOp > struct remove_if_helper +{ + template< typename Sequence, typename U > struct apply + { + typedef typename eval_if< + typename apply1::type + , identity + , apply2 + >::type type; + }; +}; + +template< + typename Sequence + , typename Predicate + , typename Inserter + > +struct remove_if_impl + : fold< + Sequence + , typename Inserter::state + , protect< aux::remove_if_helper< + typename lambda::type + , typename Inserter::operation + > > + > +{ +}; + +template< + typename Sequence + , typename Predicate + , typename Inserter + > +struct reverse_remove_if_impl + : reverse_fold< + Sequence + , typename Inserter::state + , protect< aux::remove_if_helper< + typename lambda::type + , typename Inserter::operation + > > + > +{ +}; + +} // namespace aux + +BOOST_MPL_AUX_INSERTER_ALGORITHM_DEF(3, remove_if) + +}} + +#endif // BOOST_MPL_REMOVE_IF_HPP_INCLUDED diff --git a/boost/boost/numeric/conversion/cast.hpp b/boost/boost/numeric/conversion/cast.hpp index aa518e8cf8..1ee02518bc 100644 --- a/boost/boost/numeric/conversion/cast.hpp +++ b/boost/boost/numeric/conversion/cast.hpp @@ -16,6 +16,7 @@ // 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 @@ -30,22 +31,31 @@ #include #include +#include namespace boost { - template - inline - Target numeric_cast ( Source arg ) - { - typedef boost::numeric::converter Converter ; - return Converter::convert(arg); - } - - using numeric::bad_numeric_cast; - + 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/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp b/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp new file mode 100644 index 0000000000..9ac7950163 --- /dev/null +++ b/boost/boost/numeric/conversion/detail/numeric_cast_traits.hpp @@ -0,0 +1,105 @@ +// +//! 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) +// +#if !defined(BOOST_NUMERIC_CONVERSION_DONT_USE_PREPROCESSED_FILES) + #include +#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.hpp") + #endif + +// +//! 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) +// + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(preserve: 1) + #endif + + //! Generate the specializations for the built-in types. + #if !defined( BOOST_NO_INT64_T ) + #define BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES() \ + (char) \ + (boost::int8_t) \ + (boost::uint8_t) \ + (boost::int16_t) \ + (boost::uint16_t) \ + (boost::int32_t) \ + (boost::uint32_t) \ + (boost::int64_t) \ + (boost::uint64_t) \ + (float) \ + (double) \ + (long double) \ + /***/ + #else + #define BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES() \ + (char) \ + (boost::int8_t) \ + (boost::uint8_t) \ + (boost::int16_t) \ + (boost::uint16_t) \ + (boost::int32_t) \ + (boost::uint32_t) \ + (float) \ + (double) \ + (long double) \ + /***/ + #endif + +namespace boost { namespace numeric { + + #define BOOST_PP_ITERATION_PARAMS_1 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES())), )) + #include BOOST_PP_ITERATE() + +}}//namespace boost::numeric; + + #if defined(__WAVE__) && defined(BOOST_NUMERIC_CONVERSION_CREATE_PREPROCESSED_FILES) + #pragma wave option(output: null) + #endif + + #undef BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES + +#elif BOOST_PP_ITERATION_DEPTH() == 1 + + #define BOOST_PP_ITERATION_PARAMS_2 (3, (0, BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES())), )) + #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_BUILTIN_TYPES()) + , BOOST_PP_SEQ_ELEM(BOOST_NUMERIC_CONVERSION_B, BOOST_NUMERIC_CONVERSION_BUILTIN_TYPES()) + > + { + 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/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp b/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp new file mode 100644 index 0000000000..8259097945 --- /dev/null +++ b/boost/boost/numeric/conversion/detail/preprocessed/numeric_cast_traits.hpp @@ -0,0 +1,1751 @@ +// +//! 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) +// + +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 + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + char + , boost::uint64_t + > + { + 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 + < + boost::int8_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int8_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint8_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::int16_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int16_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint16_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::int32_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int32_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint32_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::int64_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::int64_t + , long double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , char + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , boost::uint64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , float + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , double + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + boost::uint64_t + , 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 + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + float + , boost::uint64_t + > + { + 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 + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + double + , boost::uint64_t + > + { + 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 + , boost::int8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::uint8_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::int16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::uint16_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::int32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::uint32_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::int64_t + > + { + typedef def_overflow_handler overflow_policy; + typedef UseInternalRangeChecker range_checking_policy; + typedef Trunc rounding_policy; + }; + + template <> + struct numeric_cast_traits + < + long double + , boost::uint64_t + > + { + 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/boost/boost/numeric/conversion/numeric_cast_traits.hpp b/boost/boost/numeric/conversion/numeric_cast_traits.hpp new file mode 100644 index 0000000000..e24296bc7e --- /dev/null +++ b/boost/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/boost/boost/regex/icu.hpp b/boost/boost/regex/icu.hpp index e9a55c0c48..772806e97c 100644 --- a/boost/boost/regex/icu.hpp +++ b/boost/boost/regex/icu.hpp @@ -251,7 +251,7 @@ inline u32regex do_make_u32regex(InputIterator i, const boost::mpl::int_<1>*) { typedef boost::u8_to_u32_iterator conv_type; - return u32regex(conv_type(i), conv_type(j), opt); + return u32regex(conv_type(i, i, j), conv_type(j, i, j), opt); } template @@ -261,7 +261,7 @@ inline u32regex do_make_u32regex(InputIterator i, const boost::mpl::int_<2>*) { typedef boost::u16_to_u32_iterator conv_type; - return u32regex(conv_type(i), conv_type(j), opt); + return u32regex(conv_type(i, i, j), conv_type(j, i, j), opt); } template @@ -282,7 +282,7 @@ inline u32regex do_make_u32regex(InputIterator i, typedef boost::u8_to_u32_iterator conv_type; typedef std::vector vector_type; vector_type v; - conv_type a(i), b(j); + conv_type a(i, i, j), b(j, i, j); while(a != b) { v.push_back(*a); @@ -302,7 +302,7 @@ inline u32regex do_make_u32regex(InputIterator i, typedef boost::u16_to_u32_iterator conv_type; typedef std::vector vector_type; vector_type v; - conv_type a(i), b(j); + conv_type a(i, i, j), b(j, i, j); while(a != b) { v.push_back(*a); @@ -425,7 +425,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last, typedef match_results match_type; typedef typename match_type::allocator_type alloc_type; match_type what; - bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags); + bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags); // copy results across to m: if(result) copy_results(m, what); return result; @@ -441,7 +441,7 @@ bool do_regex_match(BidiIterator first, BidiIterator last, typedef match_results match_type; typedef typename match_type::allocator_type alloc_type; match_type what; - bool result = ::boost::regex_match(conv_type(first), conv_type(last), what, e, flags); + bool result = ::boost::regex_match(conv_type(first, first, last), conv_type(last, first, last), what, e, flags); // copy results across to m: if(result) copy_results(m, what); return result; @@ -600,7 +600,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last, typedef match_results match_type; typedef typename match_type::allocator_type alloc_type; match_type what; - bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base)); + bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base)); // copy results across to m: if(result) copy_results(m, what); return result; @@ -617,7 +617,7 @@ bool do_regex_search(BidiIterator first, BidiIterator last, typedef match_results match_type; typedef typename match_type::allocator_type alloc_type; match_type what; - bool result = ::boost::regex_search(conv_type(first), conv_type(last), what, e, flags, conv_type(base)); + bool result = ::boost::regex_search(conv_type(first, first, last), conv_type(last, first, last), what, e, flags, conv_type(base)); // copy results across to m: if(result) copy_results(m, what); return result; @@ -764,13 +764,13 @@ template inline std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator > make_utf32_seq(I i, I j, mpl::int_<1> const*) { - return std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator >(boost::u8_to_u32_iterator(i), boost::u8_to_u32_iterator(j)); + return std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator >(boost::u8_to_u32_iterator(i, i, j), boost::u8_to_u32_iterator(j, i, j)); } template inline std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator > make_utf32_seq(I i, I j, mpl::int_<2> const*) { - return std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator >(boost::u16_to_u32_iterator(i), boost::u16_to_u32_iterator(j)); + return std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator >(boost::u16_to_u32_iterator(i, i, j), boost::u16_to_u32_iterator(j, i, j)); } template inline std::pair< I, I > @@ -782,13 +782,15 @@ template inline std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator > make_utf32_seq(const charT* p, mpl::int_<1> const*) { - return std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator >(boost::u8_to_u32_iterator(p), boost::u8_to_u32_iterator(p+std::strlen((const char*)p))); + std::size_t len = std::strlen((const char*)p); + return std::pair< boost::u8_to_u32_iterator, boost::u8_to_u32_iterator >(boost::u8_to_u32_iterator(p, p, p+len), boost::u8_to_u32_iterator(p+len, p, p+len)); } template inline std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator > make_utf32_seq(const charT* p, mpl::int_<2> const*) { - return std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator >(boost::u16_to_u32_iterator(p), boost::u16_to_u32_iterator(p+u_strlen((const UChar*)p))); + std::size_t len = u_strlen((const UChar*)p); + return std::pair< boost::u16_to_u32_iterator, boost::u16_to_u32_iterator >(boost::u16_to_u32_iterator(p, p, p + len), boost::u16_to_u32_iterator(p+len, p, p + len)); } template inline std::pair< const charT*, const charT* > diff --git a/boost/boost/regex/pending/unicode_iterator.hpp b/boost/boost/regex/pending/unicode_iterator.hpp index a8faefd5de..e6399b50b3 100644 --- a/boost/boost/regex/pending/unicode_iterator.hpp +++ b/boost/boost/regex/pending/unicode_iterator.hpp @@ -82,16 +82,16 @@ static const ::boost::uint32_t ten_bit_mask = 0x3FFu; inline bool is_high_surrogate(::boost::uint16_t v) { - return (v & 0xFC00u) == 0xd800u; + return (v & 0xFFFFFC00u) == 0xd800u; } inline bool is_low_surrogate(::boost::uint16_t v) { - return (v & 0xFC00u) == 0xdc00u; + return (v & 0xFFFFFC00u) == 0xdc00u; } template inline bool is_surrogate(T v) { - return (v & 0xF800u) == 0xd800; + return (v & 0xFFFFF800u) == 0xd800; } inline unsigned utf8_byte_count(boost::uint8_t c) @@ -303,6 +303,34 @@ public: { m_value = pending_read; } + // + // Range checked version: + // + u16_to_u32_iterator(BaseIterator b, BaseIterator start, BaseIterator end) : m_position(b) + { + m_value = pending_read; + // + // The range must not start with a low surrogate, or end in a high surrogate, + // otherwise we run the risk of running outside the underlying input range. + // Likewise b must not be located at a low surrogate. + // + boost::uint16_t val; + if(start != end) + { + if((b != start) && (b != end)) + { + val = *b; + if(detail::is_surrogate(val) && ((val & 0xFC00u) == 0xDC00u)) + invalid_code_point(val); + } + val = *start; + if(detail::is_surrogate(val) && ((val & 0xFC00u) == 0xDC00u)) + invalid_code_point(val); + val = *--end; + if(detail::is_high_surrogate(val)) + invalid_code_point(val); + } + } private: static void invalid_code_point(::boost::uint16_t val) { @@ -504,7 +532,7 @@ public: while((*--m_position & 0xC0u) == 0x80u) ++count; // now check that the sequence was valid: if(count != detail::utf8_trailing_byte_count(*m_position)) - invalid_sequnce(); + invalid_sequence(); m_value = pending_read; } BaseIterator base()const @@ -520,8 +548,37 @@ public: { m_value = pending_read; } + // + // Checked constructor: + // + u8_to_u32_iterator(BaseIterator b, BaseIterator start, BaseIterator end) : m_position(b) + { + m_value = pending_read; + // + // We must not start with a continuation character, or end with a + // truncated UTF-8 sequence otherwise we run the risk of going past + // the start/end of the underlying sequence: + // + if(start != end) + { + unsigned char v = *start; + if((v & 0xC0u) == 0x80u) + invalid_sequence(); + if((b != start) && (b != end) && ((*b & 0xC0u) == 0x80u)) + invalid_sequence(); + BaseIterator pos = end; + do + { + v = *--pos; + } + while((start != pos) && ((v & 0xC0u) == 0x80u)); + std::ptrdiff_t extra = detail::utf8_byte_count(v); + if(std::distance(pos, end) < extra) + invalid_sequence(); + } + } private: - static void invalid_sequnce() + static void invalid_sequence() { std::out_of_range e("Invalid UTF-8 sequence encountered while trying to encode UTF-32 character"); boost::throw_exception(e); @@ -531,7 +588,7 @@ private: m_value = static_cast(static_cast< ::boost::uint8_t>(*m_position)); // we must not have a continuation character: if((m_value & 0xC0u) == 0x80u) - invalid_sequnce(); + invalid_sequence(); // see how many extra byts we have: unsigned extra = detail::utf8_trailing_byte_count(*m_position); // extract the extra bits, 6 from each extra byte: @@ -554,7 +611,7 @@ private: m_value &= masks[extra]; // check the result: if(m_value > static_cast(0x10FFFFu)) - invalid_sequnce(); + invalid_sequence(); } BaseIterator m_position; mutable U32Type m_value; diff --git a/boost/boost/regex/v4/basic_regex.hpp b/boost/boost/regex/v4/basic_regex.hpp index 53b7bcaa23..1e71877ef4 100644 --- a/boost/boost/regex/v4/basic_regex.hpp +++ b/boost/boost/regex/v4/basic_regex.hpp @@ -398,7 +398,7 @@ public: typedef typename traits::string_type seq_type; seq_type a(arg_first, arg_last); if(a.size()) - assign(&*a.begin(), &*a.begin() + a.size(), f); + assign(static_cast(&*a.begin()), static_cast(&*a.begin() + a.size()), f); else assign(static_cast(0), static_cast(0), f); } diff --git a/boost/boost/regex/v4/basic_regex_creator.hpp b/boost/boost/regex/v4/basic_regex_creator.hpp index efa9f7dd8e..c4b1c048d0 100644 --- a/boost/boost/regex/v4/basic_regex_creator.hpp +++ b/boost/boost/regex/v4/basic_regex_creator.hpp @@ -241,6 +241,7 @@ protected: unsigned m_backrefs; // bitmask of permitted backrefs boost::uintmax_t m_bad_repeats; // bitmask of repeats we can't deduce a startmap for; bool m_has_recursions; // set when we have recursive expresisons to fixup + std::vector m_recursion_checks; // notes which recursions we've followed while analysing this expression typename traits::char_class_type m_word_mask; // mask used to determine if a character is a word character typename traits::char_class_type m_mask_space; // mask used to determine if a character is a word character typename traits::char_class_type m_lower_mask; // mask used to determine if a character is a lowercase character @@ -712,6 +713,8 @@ void basic_regex_creator::finalize(const charT* p1, const charT* m_pdata->m_can_be_null = 0; m_bad_repeats = 0; + if(m_has_recursions) + m_recursion_checks.assign(1 + m_pdata->m_mark_count, false); create_startmap(m_pdata->m_first_state, m_pdata->m_startmap, &(m_pdata->m_can_be_null), mask_all); // get the restart type: m_pdata->m_restart_type = get_restart_type(m_pdata->m_first_state); @@ -948,9 +951,14 @@ void basic_regex_creator::create_startmaps(re_syntax_base* state) state = state->next.p; } } + // now work through our list, building all the maps as we go: while(v.size()) { + // Initialize m_recursion_checks if we need it: + if(m_has_recursions) + m_recursion_checks.assign(1 + m_pdata->m_mark_count, false); + const std::pair& p = v.back(); m_icase = p.first; state = p.second; @@ -960,6 +968,9 @@ void basic_regex_creator::create_startmaps(re_syntax_base* state) m_bad_repeats = 0; create_startmap(state->next.p, static_cast(state)->_map, &static_cast(state)->can_be_null, mask_take); m_bad_repeats = 0; + + if(m_has_recursions) + m_recursion_checks.assign(1 + m_pdata->m_mark_count, false); create_startmap(static_cast(state)->alt.p, static_cast(state)->_map, &static_cast(state)->can_be_null, mask_skip); // adjust the type of the state to allow for faster matching: state->type = this->get_repeat_type(state); @@ -1114,7 +1125,11 @@ void basic_regex_creator::create_startmap(re_syntax_base* state, } case syntax_element_recurse: { - if(recursion_start == state) + if(state->type == syntax_element_startmark) + recursion_sub = static_cast(state)->index; + else + recursion_sub = 0; + if(m_recursion_checks[recursion_sub]) { // Infinite recursion!! if(0 == this->m_pdata->m_status) // update the error code if not already set @@ -1139,12 +1154,10 @@ void basic_regex_creator::create_startmap(re_syntax_base* state, recursion_start = state; recursion_restart = state->next.p; state = static_cast(state)->alt.p; - if(state->type == syntax_element_startmark) - recursion_sub = static_cast(state)->index; - else - recursion_sub = 0; + m_recursion_checks[recursion_sub] = true; break; } + m_recursion_checks[recursion_sub] = true; // fall through, can't handle nested recursion here... } case syntax_element_backref: @@ -1213,7 +1226,7 @@ void basic_regex_creator::create_startmap(re_syntax_base* state, for(unsigned int i = 0; i < (1u << CHAR_BIT); ++i) { charT c = static_cast(i); - if(&c != re_is_set_member(&c, &c + 1, static_cast*>(state), *m_pdata, m_icase)) + if(&c != re_is_set_member(&c, &c + 1, static_cast*>(state), *m_pdata, l_icase)) l_map[i] |= mask; } } diff --git a/boost/boost/regex/v4/basic_regex_parser.hpp b/boost/boost/regex/v4/basic_regex_parser.hpp index 0192a9f1e1..87ff6e2042 100644 --- a/boost/boost/regex/v4/basic_regex_parser.hpp +++ b/boost/boost/regex/v4/basic_regex_parser.hpp @@ -941,7 +941,8 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ ++m_position; } // for perl regexes only check for pocessive ++ repeats. - if((0 == (this->flags() & regbase::main_option_type)) + if((m_position != m_end) + && (0 == (this->flags() & regbase::main_option_type)) && (this->m_traits.syntax_type(*m_position) == regex_constants::syntax_plus)) { pocessive = true; @@ -1025,13 +1026,14 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ { // // Check for illegal following quantifier, we have to do this here, because - // the extra states we insert below circumvents are usual error checking :-( + // the extra states we insert below circumvents our usual error checking :-( // switch(this->m_traits.syntax_type(*m_position)) { case regex_constants::syntax_star: case regex_constants::syntax_plus: case regex_constants::syntax_question: + case regex_constants::syntax_open_brace: fail(regex_constants::error_badrepeat, m_position - m_base); return false; } diff --git a/boost/boost/regex/v4/regex_format.hpp b/boost/boost/regex/v4/regex_format.hpp index 4406839f35..e05862fa60 100644 --- a/boost/boost/regex/v4/regex_format.hpp +++ b/boost/boost/regex/v4/regex_format.hpp @@ -842,7 +842,15 @@ OutputIterator regex_format_imp(OutputIterator out, BOOST_MPL_HAS_XXX_TRAIT_DEF(const_iterator) -struct any_type { any_type(...); }; +struct any_type +{ + template + any_type(const T&); + template + any_type(const T&, const U&); + template + any_type(const T&, const U&, const V&); +}; typedef char no_type; typedef char (&unary_type)[2]; typedef char (&binary_type)[3]; diff --git a/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp b/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp index 0c69b0b891..3f1f449912 100644 --- a/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp +++ b/boost/boost/smart_ptr/detail/sp_counted_base_gcc_mips.hpp @@ -37,9 +37,12 @@ inline void atomic_increment( int * pw ) __asm__ __volatile__ ( "0:\n\t" + ".set push\n\t" + ".set mips2\n\t" "ll %0, %1\n\t" "addiu %0, 1\n\t" "sc %0, %1\n\t" + ".set pop\n\t" "beqz %0, 0b": "=&r"( tmp ), "=m"( *pw ): "m"( *pw ) @@ -55,9 +58,12 @@ inline int atomic_decrement( int * pw ) __asm__ __volatile__ ( "0:\n\t" + ".set push\n\t" + ".set mips2\n\t" "ll %1, %2\n\t" "addiu %0, %1, -1\n\t" "sc %0, %2\n\t" + ".set pop\n\t" "beqz %0, 0b\n\t" "addiu %0, %1, -1": "=&r"( rv ), "=&r"( tmp ), "=m"( *pw ): @@ -78,10 +84,13 @@ inline int atomic_conditional_increment( int * pw ) __asm__ __volatile__ ( "0:\n\t" + ".set push\n\t" + ".set mips2\n\t" "ll %0, %2\n\t" "beqz %0, 1f\n\t" "addiu %1, %0, 1\n\t" "sc %1, %2\n\t" + ".set pop\n\t" "beqz %1, 0b\n\t" "addiu %0, %0, 1\n\t" "1:": diff --git a/boost/boost/smart_ptr/detail/sp_has_sync.hpp b/boost/boost/smart_ptr/detail/sp_has_sync.hpp index 31cedbce3d..12acea8455 100644 --- a/boost/boost/smart_ptr/detail/sp_has_sync.hpp +++ b/boost/boost/smart_ptr/detail/sp_has_sync.hpp @@ -36,6 +36,10 @@ #undef BOOST_SP_HAS_SYNC #endif +#if defined( __sh__ ) +#undef BOOST_SP_HAS_SYNC +#endif + #if defined( __sparc__ ) #undef BOOST_SP_HAS_SYNC #endif diff --git a/boost/boost/smart_ptr/shared_array.hpp b/boost/boost/smart_ptr/shared_array.hpp index 1f50403a38..0acdff7d5e 100644 --- a/boost/boost/smart_ptr/shared_array.hpp +++ b/boost/boost/smart_ptr/shared_array.hpp @@ -69,7 +69,25 @@ public: { } -// generated copy constructor, assignment, destructor are fine +// generated copy constructor, destructor are fine... + +#if defined( BOOST_HAS_RVALUE_REFS ) + +// ... except in C++0x, move disables the implicit copy + + shared_array( shared_array const & r ): px( r.px ), pn( r.pn ) // never throws + { + } + +#endif + + // assignment + + shared_array & operator=( shared_array const & r ) // never throws + { + this_type( r ).swap( *this ); + return *this; + } void reset(T * p = 0) { diff --git a/boost/boost/smart_ptr/shared_ptr.hpp b/boost/boost/smart_ptr/shared_ptr.hpp index 100f1a888b..9ead1ba1dd 100644 --- a/boost/boost/smart_ptr/shared_ptr.hpp +++ b/boost/boost/smart_ptr/shared_ptr.hpp @@ -203,7 +203,17 @@ public: boost::detail::sp_enable_shared_from_this( this, p, p ); } -// generated copy constructor, destructor are fine +// generated copy constructor, destructor are fine... + +#if defined( BOOST_HAS_RVALUE_REFS ) + +// ... except in C++0x, move disables the implicit copy + + shared_ptr( shared_ptr const & r ): px( r.px ), pn( r.pn ) // never throws + { + } + +#endif template explicit shared_ptr(weak_ptr const & r): pn(r.pn) // may throw diff --git a/boost/boost/smart_ptr/weak_ptr.hpp b/boost/boost/smart_ptr/weak_ptr.hpp index d314b0df3e..34b0d1e057 100644 --- a/boost/boost/smart_ptr/weak_ptr.hpp +++ b/boost/boost/smart_ptr/weak_ptr.hpp @@ -40,8 +40,24 @@ public: { } -// generated copy constructor, assignment, destructor are fine +// generated copy constructor, assignment, destructor are fine... +#if defined( BOOST_HAS_RVALUE_REFS ) + +// ... except in C++0x, move disables the implicit copy + + weak_ptr( weak_ptr const & r ): px( r.px ), pn( r.pn ) // never throws + { + } + + weak_ptr & operator=( weak_ptr const & r ) // never throws + { + px = r.px; + pn = r.pn; + return *this; + } + +#endif // // The "obvious" converting constructor implementation: diff --git a/boost/boost/type_traits.hpp b/boost/boost/type_traits.hpp index c725296b90..acd5aff672 100644 --- a/boost/boost/type_traits.hpp +++ b/boost/boost/type_traits.hpp @@ -1,4 +1,4 @@ -// (C) Copyright John Maddock 2000. +// (C) Copyright John Maddock 2000. // Use, modification and distribution are 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). @@ -32,6 +32,7 @@ #include "boost/type_traits/has_nothrow_constructor.hpp" #include "boost/type_traits/has_nothrow_copy.hpp" #include "boost/type_traits/has_nothrow_destructor.hpp" +#include #include "boost/type_traits/has_trivial_assign.hpp" #include "boost/type_traits/has_trivial_constructor.hpp" #include "boost/type_traits/has_trivial_copy.hpp" @@ -93,7 +94,3 @@ #include "boost/type_traits/ice.hpp" #endif // BOOST_TYPE_TRAITS_HPP - - - - diff --git a/boost/boost/type_traits/add_rvalue_reference.hpp b/boost/boost/type_traits/add_rvalue_reference.hpp index 2be58f6a98..f0e9925a34 100644 --- a/boost/boost/type_traits/add_rvalue_reference.hpp +++ b/boost/boost/type_traits/add_rvalue_reference.hpp @@ -39,15 +39,13 @@ namespace type_traits_detail { struct add_rvalue_reference_helper { typedef T type; }; +#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) template struct add_rvalue_reference_helper { -#if !defined(BOOST_NO_RVALUE_REFERENCES) typedef T&& type; -#else - typedef T type; -#endif }; +#endif template struct add_rvalue_reference_imp diff --git a/boost/boost/type_traits/detail/bool_trait_def.hpp b/boost/boost/type_traits/detail/bool_trait_def.hpp index 88c6899753..0935c60727 100644 --- a/boost/boost/type_traits/detail/bool_trait_def.hpp +++ b/boost/boost/type_traits/detail/bool_trait_def.hpp @@ -8,8 +8,8 @@ // http://www.boost.org/LICENSE_1_0.txt) // $Source$ -// $Date: 2011-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $ -// $Revision: 71481 $ +// $Date: 2011-10-09 18:28:33 -0400 (Sun, 09 Oct 2011) $ +// $Revision: 74865 $ #include #include @@ -89,6 +89,18 @@ public:\ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \ /**/ +#define BOOST_TT_AUX_BOOL_TRAIT_DEF3(trait,T1,T2,T3,C) \ +template< typename T1, typename T2, typename T3 > struct trait \ + BOOST_TT_AUX_BOOL_C_BASE(C) \ +{ \ +public:\ + BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \ + BOOST_MPL_AUX_LAMBDA_SUPPORT(3,trait,(T1,T2,T3)) \ +}; \ +\ +BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(3,trait) \ +/**/ + #define BOOST_TT_AUX_BOOL_TRAIT_SPEC1(trait,sp,C) \ template<> struct trait< sp > \ BOOST_TT_AUX_BOOL_C_BASE(C) \ diff --git a/boost/boost/type_traits/detail/bool_trait_undef.hpp b/boost/boost/type_traits/detail/bool_trait_undef.hpp index 2259c644f2..6daba04cfe 100644 --- a/boost/boost/type_traits/detail/bool_trait_undef.hpp +++ b/boost/boost/type_traits/detail/bool_trait_undef.hpp @@ -8,13 +8,14 @@ // http://www.boost.org/LICENSE_1_0.txt) // $Source$ -// $Date: 2004-09-02 11:41:37 -0400 (Thu, 02 Sep 2004) $ -// $Revision: 24874 $ +// $Date: 2011-10-09 18:28:33 -0400 (Sun, 09 Oct 2011) $ +// $Revision: 74865 $ #undef BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL #undef BOOST_TT_AUX_BOOL_C_BASE #undef BOOST_TT_AUX_BOOL_TRAIT_DEF1 #undef BOOST_TT_AUX_BOOL_TRAIT_DEF2 +#undef BOOST_TT_AUX_BOOL_TRAIT_DEF3 #undef BOOST_TT_AUX_BOOL_TRAIT_SPEC1 #undef BOOST_TT_AUX_BOOL_TRAIT_SPEC2 #undef BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1 diff --git a/boost/boost/type_traits/detail/has_binary_operator.hpp b/boost/boost/type_traits/detail/has_binary_operator.hpp new file mode 100644 index 0000000000..9257bc2220 --- /dev/null +++ b/boost/boost/type_traits/detail/has_binary_operator.hpp @@ -0,0 +1,229 @@ +// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +// cannot include this header without getting warnings of the kind: +// gcc: +// warning: value computed is not used +// warning: comparison between signed and unsigned integer expressions +// msvc: +// warning C4018: '<' : signed/unsigned mismatch +// warning C4244: '+=' : conversion from 'double' to 'char', possible loss of data +// warning C4547: '*' : operator before comma has no effect; expected operator with side-effect +// warning C4800: 'int' : forcing value to bool 'true' or 'false' (performance warning) +// warning C4804: '<' : unsafe use of type 'bool' in operation +// warning C4805: '==' : unsafe mix of type 'bool' and type 'char' in operation +// cannot find another implementation -> declared as system header to suppress these warnings. +#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4018 4244 4547 4800 4804 4805 4913 ) +#endif + +namespace boost { +namespace detail { + +// This namespace ensures that argument-dependent name lookup does not mess things up. +namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) { + +// 1. a function to have an instance of type T without requiring T to be default +// constructible +template T &make(); + + +// 2. we provide our operator definition for types that do not have one already + +// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is +// found in the type's own namespace (our own operator is used) so that we have +// a means to know that our operator was used +struct no_operator { }; + +// this class allows implicit conversions and makes the following operator +// definition less-preferred than any other such operators that might be found +// via argument-dependent name lookup +struct any { template any(T const&); }; + +// when operator BOOST_TT_TRAIT_OP is not available, this one is used +no_operator operator BOOST_TT_TRAIT_OP (const any&, const any&); + + +// 3. checks if the operator returns void or not +// conditions: Lhs!=void and Rhs!=void + +// we first redefine "operator," so that we have no compilation error if +// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of +// (lhs BOOST_TT_TRAIT_OP rhs, returns_void_t()) to deduce if +// operator BOOST_TT_TRAIT_OP returns void or not: +// - operator BOOST_TT_TRAIT_OP returns void -> (lhs BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns returns_void_t +// - operator BOOST_TT_TRAIT_OP returns !=void -> (lhs BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns int +struct returns_void_t { }; +template int operator,(const T&, returns_void_t); +template int operator,(const volatile T&, returns_void_t); + +// this intermediate trait has member value of type bool: +// - value==true -> operator BOOST_TT_TRAIT_OP returns void +// - value==false -> operator BOOST_TT_TRAIT_OP does not return void +template < typename Lhs, typename Rhs > +struct operator_returns_void { + // overloads of function returns_void make the difference + // yes_type and no_type have different size by construction + static ::boost::type_traits::yes_type returns_void(returns_void_t); + static ::boost::type_traits::no_type returns_void(int); + BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make() BOOST_TT_TRAIT_OP make(),returns_void_t()))))); +}; + + +// 4. checks if the return type is Ret or Ret==dont_care +// conditions: Lhs!=void and Rhs!=void + +struct dont_care { }; + +template < typename Lhs, typename Rhs, typename Ret, bool Returns_void > +struct operator_returns_Ret; + +template < typename Lhs, typename Rhs > +struct operator_returns_Ret < Lhs, Rhs, dont_care, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs, typename Rhs > +struct operator_returns_Ret < Lhs, Rhs, dont_care, false > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs, typename Rhs > +struct operator_returns_Ret < Lhs, Rhs, void, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs, typename Rhs > +struct operator_returns_Ret < Lhs, Rhs, void, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Lhs, typename Rhs, typename Ret > +struct operator_returns_Ret < Lhs, Rhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// otherwise checks if it is convertible to Ret using the sizeof trick +// based on overload resolution +// condition: Ret!=void and Ret!=dont_care and the operator does not return void +template < typename Lhs, typename Rhs, typename Ret > +struct operator_returns_Ret < Lhs, Rhs, Ret, false > { + static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret + static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(make() BOOST_TT_TRAIT_OP make()))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 5. checks for operator existence +// condition: Lhs!=void and Rhs!=void + +// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other +// existing one; +// this is done with redefinition of "operator," that returns no_operator or has_operator +struct has_operator { }; +no_operator operator,(no_operator, has_operator); + +template < typename Lhs, typename Rhs > +struct operator_exists { + static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists + static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make() BOOST_TT_TRAIT_OP make()),make())))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 6. main trait: to avoid any compilation error, this class behaves +// differently when operator BOOST_TT_TRAIT_OP(Lhs, Rhs) is forbidden by the +// standard. +// Forbidden_if is a bool that is: +// - true when the operator BOOST_TT_TRAIT_OP(Lhs, Rhs) is forbidden by the standard +// (would yield compilation error if used) +// - false otherwise +template < typename Lhs, typename Rhs, typename Ret, bool Forbidden_if > +struct trait_impl1; + +template < typename Lhs, typename Rhs, typename Ret > +struct trait_impl1 < Lhs, Rhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Lhs, typename Rhs, typename Ret > +struct trait_impl1 < Lhs, Rhs, Ret, false > { + BOOST_STATIC_CONSTANT(bool, + value = ( + ::boost::type_traits::ice_and< + operator_exists < Lhs, Rhs >::value, + operator_returns_Ret < Lhs, Rhs, Ret, operator_returns_void < Lhs, Rhs >::value >::value + >::value + ) + ); +}; + +// some specializations needs to be declared for the special void case +template < typename Rhs, typename Ret > +struct trait_impl1 < void, Rhs, Ret, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Lhs, typename Ret > +struct trait_impl1 < Lhs, void, Ret, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Ret > +struct trait_impl1 < void, void, Ret, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// defines some typedef for convenience +template < typename Lhs, typename Rhs, typename Ret > +struct trait_impl { + typedef typename ::boost::remove_reference::type Lhs_noref; + typedef typename ::boost::remove_reference::type Rhs_noref; + typedef typename ::boost::remove_cv::type Lhs_nocv; + typedef typename ::boost::remove_cv::type Rhs_nocv; + typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer::type >::type >::type Lhs_noptr; + typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer::type >::type >::type Rhs_noptr; + BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Lhs_noref, Rhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value)); +}; + +} // namespace impl +} // namespace detail + +// this is the accessible definition of the trait to end user +BOOST_TT_AUX_BOOL_TRAIT_DEF3(BOOST_TT_TRAIT_NAME, Lhs, Rhs=Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Lhs, Rhs, Ret >::value)) + +} // namespace boost + +#if defined(BOOST_MSVC) +# pragma warning ( pop ) +#endif + +#include diff --git a/boost/boost/type_traits/detail/has_postfix_operator.hpp b/boost/boost/type_traits/detail/has_postfix_operator.hpp new file mode 100644 index 0000000000..5c52b07d29 --- /dev/null +++ b/boost/boost/type_traits/detail/has_postfix_operator.hpp @@ -0,0 +1,202 @@ +// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +// avoid warnings +#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4244 4913 ) +#endif + +namespace boost { +namespace detail { + +// This namespace ensures that argument-dependent name lookup does not mess things up. +namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) { + +// 1. a function to have an instance of type T without requiring T to be default +// constructible +template T &make(); + + +// 2. we provide our operator definition for types that do not have one already + +// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is +// found in the type's own namespace (our own operator is used) so that we have +// a means to know that our operator was used +struct no_operator { }; + +// this class allows implicit conversions and makes the following operator +// definition less-preferred than any other such operators that might be found +// via argument-dependent name lookup +struct any { template any(T const&); }; + +// when operator BOOST_TT_TRAIT_OP is not available, this one is used +no_operator operator BOOST_TT_TRAIT_OP (const any&, int); + + +// 3. checks if the operator returns void or not +// conditions: Lhs!=void + +// we first redefine "operator," so that we have no compilation error if +// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of +// (lhs BOOST_TT_TRAIT_OP, returns_void_t()) to deduce if +// operator BOOST_TT_TRAIT_OP returns void or not: +// - operator BOOST_TT_TRAIT_OP returns void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns returns_void_t +// - operator BOOST_TT_TRAIT_OP returns !=void -> (lhs BOOST_TT_TRAIT_OP, returns_void_t()) returns int +struct returns_void_t { }; +template int operator,(const T&, returns_void_t); +template int operator,(const volatile T&, returns_void_t); + +// this intermediate trait has member value of type bool: +// - value==true -> operator BOOST_TT_TRAIT_OP returns void +// - value==false -> operator BOOST_TT_TRAIT_OP does not return void +template < typename Lhs > +struct operator_returns_void { + // overloads of function returns_void make the difference + // yes_type and no_type have different size by construction + static ::boost::type_traits::yes_type returns_void(returns_void_t); + static ::boost::type_traits::no_type returns_void(int); + BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((make() BOOST_TT_TRAIT_OP,returns_void_t()))))); +}; + + +// 4. checks if the return type is Ret or Ret==dont_care +// conditions: Lhs!=void + +struct dont_care { }; + +template < typename Lhs, typename Ret, bool Returns_void > +struct operator_returns_Ret; + +template < typename Lhs > +struct operator_returns_Ret < Lhs, dont_care, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs > +struct operator_returns_Ret < Lhs, dont_care, false > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs > +struct operator_returns_Ret < Lhs, void, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Lhs > +struct operator_returns_Ret < Lhs, void, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Lhs, typename Ret > +struct operator_returns_Ret < Lhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// otherwise checks if it is convertible to Ret using the sizeof trick +// based on overload resolution +// condition: Ret!=void and Ret!=dont_care and the operator does not return void +template < typename Lhs, typename Ret > +struct operator_returns_Ret < Lhs, Ret, false > { + static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret + static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(make() BOOST_TT_TRAIT_OP))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 5. checks for operator existence +// condition: Lhs!=void + +// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other +// existing one; +// this is done with redefinition of "operator," that returns no_operator or has_operator +struct has_operator { }; +no_operator operator,(no_operator, has_operator); + +template < typename Lhs > +struct operator_exists { + static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists + static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((make() BOOST_TT_TRAIT_OP),make())))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 6. main trait: to avoid any compilation error, this class behaves +// differently when operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the +// standard. +// Forbidden_if is a bool that is: +// - true when the operator BOOST_TT_TRAIT_OP(Lhs) is forbidden by the standard +// (would yield compilation error if used) +// - false otherwise +template < typename Lhs, typename Ret, bool Forbidden_if > +struct trait_impl1; + +template < typename Lhs, typename Ret > +struct trait_impl1 < Lhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Lhs, typename Ret > +struct trait_impl1 < Lhs, Ret, false > { + BOOST_STATIC_CONSTANT(bool, + value = ( + ::boost::type_traits::ice_and< + operator_exists < Lhs >::value, + operator_returns_Ret < Lhs, Ret, operator_returns_void < Lhs >::value >::value + >::value + ) + ); +}; + +// specialization needs to be declared for the special void case +template < typename Ret > +struct trait_impl1 < void, Ret, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// defines some typedef for convenience +template < typename Lhs, typename Ret > +struct trait_impl { + typedef typename ::boost::remove_reference::type Lhs_noref; + typedef typename ::boost::remove_cv::type Lhs_nocv; + typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer::type >::type >::type Lhs_noptr; + BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Lhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value)); +}; + +} // namespace impl +} // namespace detail + +// this is the accessible definition of the trait to end user +BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Lhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl< Lhs, Ret >::value)) + +} // namespace boost + +#if defined(BOOST_MSVC) +# pragma warning ( pop ) +#endif + +#include diff --git a/boost/boost/type_traits/detail/has_prefix_operator.hpp b/boost/boost/type_traits/detail/has_prefix_operator.hpp new file mode 100644 index 0000000000..ac30e4dfad --- /dev/null +++ b/boost/boost/type_traits/detail/has_prefix_operator.hpp @@ -0,0 +1,210 @@ +// (C) Copyright 2009-2011 Frederic Bron, Robert Stewart, Steven Watanabe & Roman Perepelitsa. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +// should be the last #include +#include + +// cannot include this header without getting warnings of the kind: +// gcc: +// warning: value computed is not used +// warning: comparison between signed and unsigned integer expressions +// msvc: +// warning C4146: unary minus operator applied to unsigned type, result still unsigned +// warning C4804: '-' : unsafe use of type 'bool' in operation +// cannot find another implementation -> declared as system header to suppress these warnings. +#if defined(__GNUC__) && ((__GNUC__==3 && __GNUC_MINOR__>=1) || (__GNUC__>3)) +# pragma GCC system_header +#elif defined(BOOST_MSVC) +# pragma warning ( push ) +# pragma warning ( disable : 4146 4804 4913 4244 ) +#endif + +namespace boost { +namespace detail { + +// This namespace ensures that argument-dependent name lookup does not mess things up. +namespace BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl) { + +// 1. a function to have an instance of type T without requiring T to be default +// constructible +template T &make(); + + +// 2. we provide our operator definition for types that do not have one already + +// a type returned from operator BOOST_TT_TRAIT_OP when no such operator is +// found in the type's own namespace (our own operator is used) so that we have +// a means to know that our operator was used +struct no_operator { }; + +// this class allows implicit conversions and makes the following operator +// definition less-preferred than any other such operators that might be found +// via argument-dependent name lookup +struct any { template any(T const&); }; + +// when operator BOOST_TT_TRAIT_OP is not available, this one is used +no_operator operator BOOST_TT_TRAIT_OP (const any&); + + +// 3. checks if the operator returns void or not +// conditions: Rhs!=void + +// we first redefine "operator," so that we have no compilation error if +// operator BOOST_TT_TRAIT_OP returns void and we can use the return type of +// (BOOST_TT_TRAIT_OP rhs, returns_void_t()) to deduce if +// operator BOOST_TT_TRAIT_OP returns void or not: +// - operator BOOST_TT_TRAIT_OP returns void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns returns_void_t +// - operator BOOST_TT_TRAIT_OP returns !=void -> (BOOST_TT_TRAIT_OP rhs, returns_void_t()) returns int +struct returns_void_t { }; +template int operator,(const T&, returns_void_t); +template int operator,(const volatile T&, returns_void_t); + +// this intermediate trait has member value of type bool: +// - value==true -> operator BOOST_TT_TRAIT_OP returns void +// - value==false -> operator BOOST_TT_TRAIT_OP does not return void +template < typename Rhs > +struct operator_returns_void { + // overloads of function returns_void make the difference + // yes_type and no_type have different size by construction + static ::boost::type_traits::yes_type returns_void(returns_void_t); + static ::boost::type_traits::no_type returns_void(int); + BOOST_STATIC_CONSTANT(bool, value = (sizeof(::boost::type_traits::yes_type)==sizeof(returns_void((BOOST_TT_TRAIT_OP make(),returns_void_t()))))); +}; + + +// 4. checks if the return type is Ret or Ret==dont_care +// conditions: Rhs!=void + +struct dont_care { }; + +template < typename Rhs, typename Ret, bool Returns_void > +struct operator_returns_Ret; + +template < typename Rhs > +struct operator_returns_Ret < Rhs, dont_care, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Rhs > +struct operator_returns_Ret < Rhs, dont_care, false > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Rhs > +struct operator_returns_Ret < Rhs, void, true > { + BOOST_STATIC_CONSTANT(bool, value = true); +}; + +template < typename Rhs > +struct operator_returns_Ret < Rhs, void, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Rhs, typename Ret > +struct operator_returns_Ret < Rhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// otherwise checks if it is convertible to Ret using the sizeof trick +// based on overload resolution +// condition: Ret!=void and Ret!=dont_care and the operator does not return void +template < typename Rhs, typename Ret > +struct operator_returns_Ret < Rhs, Ret, false > { + static ::boost::type_traits::yes_type is_convertible_to_Ret(Ret); // this version is preferred for types convertible to Ret + static ::boost::type_traits::no_type is_convertible_to_Ret(...); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(is_convertible_to_Ret(BOOST_TT_TRAIT_OP make()))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 5. checks for operator existence +// condition: Rhs!=void + +// checks if our definition of operator BOOST_TT_TRAIT_OP is used or an other +// existing one; +// this is done with redefinition of "operator," that returns no_operator or has_operator +struct has_operator { }; +no_operator operator,(no_operator, has_operator); + +template < typename Rhs > +struct operator_exists { + static ::boost::type_traits::yes_type check(has_operator); // this version is preferred when operator exists + static ::boost::type_traits::no_type check(no_operator); // this version is used otherwise + + BOOST_STATIC_CONSTANT(bool, value = (sizeof(check(((BOOST_TT_TRAIT_OP make()),make())))==sizeof(::boost::type_traits::yes_type))); +}; + + +// 6. main trait: to avoid any compilation error, this class behaves +// differently when operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the +// standard. +// Forbidden_if is a bool that is: +// - true when the operator BOOST_TT_TRAIT_OP(Rhs) is forbidden by the standard +// (would yield compilation error if used) +// - false otherwise +template < typename Rhs, typename Ret, bool Forbidden_if > +struct trait_impl1; + +template < typename Rhs, typename Ret > +struct trait_impl1 < Rhs, Ret, true > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +template < typename Rhs, typename Ret > +struct trait_impl1 < Rhs, Ret, false > { + BOOST_STATIC_CONSTANT(bool, + value = ( + ::boost::type_traits::ice_and< + operator_exists < Rhs >::value, + operator_returns_Ret < Rhs, Ret, operator_returns_void < Rhs >::value >::value + >::value + ) + ); +}; + +// specialization needs to be declared for the special void case +template < typename Ret > +struct trait_impl1 < void, Ret, false > { + BOOST_STATIC_CONSTANT(bool, value = false); +}; + +// defines some typedef for convenience +template < typename Rhs, typename Ret > +struct trait_impl { + typedef typename ::boost::remove_reference::type Rhs_noref; + typedef typename ::boost::remove_cv::type Rhs_nocv; + typedef typename ::boost::remove_cv< typename ::boost::remove_reference< typename ::boost::remove_pointer::type >::type >::type Rhs_noptr; + BOOST_STATIC_CONSTANT(bool, value = (trait_impl1 < Rhs_noref, Ret, BOOST_TT_FORBIDDEN_IF >::value)); +}; + +} // namespace impl +} // namespace detail + +// this is the accessible definition of the trait to end user +BOOST_TT_AUX_BOOL_TRAIT_DEF2(BOOST_TT_TRAIT_NAME, Rhs, Ret=::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::dont_care, (::boost::detail::BOOST_JOIN(BOOST_TT_TRAIT_NAME,_impl)::trait_impl < Rhs, Ret >::value)) + +} // namespace boost + +#if defined(BOOST_MSVC) +# pragma warning ( pop ) +#endif + +#include diff --git a/boost/boost/type_traits/has_bit_and.hpp b/boost/boost/type_traits/has_bit_and.hpp new file mode 100644 index 0000000000..ee3307f8da --- /dev/null +++ b/boost/boost/type_traits/has_bit_and.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_AND_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_AND_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_and +#define BOOST_TT_TRAIT_OP & +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_bit_and_assign.hpp b/boost/boost/type_traits/has_bit_and_assign.hpp new file mode 100644 index 0000000000..5b3112a5bd --- /dev/null +++ b/boost/boost/type_traits/has_bit_and_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_AND_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_and_assign +#define BOOST_TT_TRAIT_OP &= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_bit_or.hpp b/boost/boost/type_traits/has_bit_or.hpp new file mode 100644 index 0000000000..922b4ce966 --- /dev/null +++ b/boost/boost/type_traits/has_bit_or.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_OR_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_OR_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_or +#define BOOST_TT_TRAIT_OP | +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_bit_or_assign.hpp b/boost/boost/type_traits/has_bit_or_assign.hpp new file mode 100644 index 0000000000..5481b92453 --- /dev/null +++ b/boost/boost/type_traits/has_bit_or_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_OR_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_or_assign +#define BOOST_TT_TRAIT_OP |= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_bit_xor.hpp b/boost/boost/type_traits/has_bit_xor.hpp new file mode 100644 index 0000000000..883dcf691c --- /dev/null +++ b/boost/boost/type_traits/has_bit_xor.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_XOR_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_XOR_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_xor +#define BOOST_TT_TRAIT_OP ^ +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_bit_xor_assign.hpp b/boost/boost/type_traits/has_bit_xor_assign.hpp new file mode 100644 index 0000000000..e2767cc8c6 --- /dev/null +++ b/boost/boost/type_traits/has_bit_xor_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_BIT_XOR_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_bit_xor_assign +#define BOOST_TT_TRAIT_OP ^= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_complement.hpp b/boost/boost/type_traits/has_complement.hpp new file mode 100644 index 0000000000..dafd9f5215 --- /dev/null +++ b/boost/boost/type_traits/has_complement.hpp @@ -0,0 +1,32 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED +#define BOOST_TT_HAS_COMPLEMENT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_complement +#define BOOST_TT_TRAIT_OP ~ +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* pointer */\ + ::boost::is_pointer< Rhs_noref >::value,\ + /* fundamental non integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_noref >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_dereference.hpp b/boost/boost/type_traits/has_dereference.hpp new file mode 100644 index 0000000000..fe48e11878 --- /dev/null +++ b/boost/boost/type_traits/has_dereference.hpp @@ -0,0 +1,31 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED +#define BOOST_TT_HAS_DEREFERENCE_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_dereference +#define BOOST_TT_TRAIT_OP * +#define BOOST_TT_FORBIDDEN_IF\ + /* void* or fundamental */\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_divides.hpp b/boost/boost/type_traits/has_divides.hpp new file mode 100644 index 0000000000..277c2da4b6 --- /dev/null +++ b/boost/boost/type_traits/has_divides.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_DIVIDES_HPP_INCLUDED +#define BOOST_TT_HAS_DIVIDES_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_divides +#define BOOST_TT_TRAIT_OP / +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer with pointer or fundamental */\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_divides_assign.hpp b/boost/boost/type_traits/has_divides_assign.hpp new file mode 100644 index 0000000000..b21a05aff8 --- /dev/null +++ b/boost/boost/type_traits/has_divides_assign.hpp @@ -0,0 +1,47 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_DIVIDES_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_divides_assign +#define BOOST_TT_TRAIT_OP /= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value,\ + /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_equal_to.hpp b/boost/boost/type_traits/has_equal_to.hpp new file mode 100644 index 0000000000..c2245c2d2f --- /dev/null +++ b/boost/boost/type_traits/has_equal_to.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED +#define BOOST_TT_HAS_EQUAL_TO_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_equal_to +#define BOOST_TT_TRAIT_OP == +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_greater.hpp b/boost/boost/type_traits/has_greater.hpp new file mode 100644 index 0000000000..ce32658405 --- /dev/null +++ b/boost/boost/type_traits/has_greater.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_GREATER_HPP_INCLUDED +#define BOOST_TT_HAS_GREATER_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_greater +#define BOOST_TT_TRAIT_OP > +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_greater_equal.hpp b/boost/boost/type_traits/has_greater_equal.hpp new file mode 100644 index 0000000000..681685a23d --- /dev/null +++ b/boost/boost/type_traits/has_greater_equal.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED +#define BOOST_TT_HAS_GREATER_EQUAL_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_greater_equal +#define BOOST_TT_TRAIT_OP >= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_left_shift.hpp b/boost/boost/type_traits/has_left_shift.hpp new file mode 100644 index 0000000000..88205d9939 --- /dev/null +++ b/boost/boost/type_traits/has_left_shift.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LEFT_SHIFT_HPP_INCLUDED +#define BOOST_TT_HAS_LEFT_SHIFT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_left_shift +#define BOOST_TT_TRAIT_OP << +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_left_shift_assign.hpp b/boost/boost/type_traits/has_left_shift_assign.hpp new file mode 100644 index 0000000000..0b3b9b1f9b --- /dev/null +++ b/boost/boost/type_traits/has_left_shift_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_LEFT_SHIFT_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_left_shift_assign +#define BOOST_TT_TRAIT_OP <<= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_less.hpp b/boost/boost/type_traits/has_less.hpp new file mode 100644 index 0000000000..e1a045e592 --- /dev/null +++ b/boost/boost/type_traits/has_less.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LESS_HPP_INCLUDED +#define BOOST_TT_HAS_LESS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_less +#define BOOST_TT_TRAIT_OP < +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_less_equal.hpp b/boost/boost/type_traits/has_less_equal.hpp new file mode 100644 index 0000000000..c633b8b81d --- /dev/null +++ b/boost/boost/type_traits/has_less_equal.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED +#define BOOST_TT_HAS_LESS_EQUAL_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_less_equal +#define BOOST_TT_TRAIT_OP <= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_logical_and.hpp b/boost/boost/type_traits/has_logical_and.hpp new file mode 100644 index 0000000000..5bfa1c334d --- /dev/null +++ b/boost/boost/type_traits/has_logical_and.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED +#define BOOST_TT_HAS_LOGICAL_AND_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_logical_and +#define BOOST_TT_TRAIT_OP && +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer with fundamental non convertible to bool */\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ + >::value\ + >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_logical_not.hpp b/boost/boost/type_traits/has_logical_not.hpp new file mode 100644 index 0000000000..fd99d3cbbe --- /dev/null +++ b/boost/boost/type_traits/has_logical_not.hpp @@ -0,0 +1,23 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED +#define BOOST_TT_HAS_LOGICAL_NOT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_logical_not +#define BOOST_TT_TRAIT_OP ! +#define BOOST_TT_FORBIDDEN_IF\ + false + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_logical_or.hpp b/boost/boost/type_traits/has_logical_or.hpp new file mode 100644 index 0000000000..a4ae6c5f47 --- /dev/null +++ b/boost/boost/type_traits/has_logical_or.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED +#define BOOST_TT_HAS_LOGICAL_OR_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_logical_or +#define BOOST_TT_TRAIT_OP || +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer with fundamental non convertible to bool */\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_convertible< Rhs_nocv, bool >::value >::value\ + >::value\ + >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_convertible< Lhs_nocv, bool >::value >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_minus.hpp b/boost/boost/type_traits/has_minus.hpp new file mode 100644 index 0000000000..cc1d06b5c3 --- /dev/null +++ b/boost/boost/type_traits/has_minus.hpp @@ -0,0 +1,60 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MINUS_HPP_INCLUDED +#define BOOST_TT_HAS_MINUS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_minus +#define BOOST_TT_TRAIT_OP - +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value,\ + /* Lhs==void* and (Rhs==fundamental or Rhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value,\ + /* Rhs==void* and (Lhs==fundamental or Lhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value\ + >::value,\ + /* Lhs=fundamental and Rhs=pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* two different pointers */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, Rhs_nocv >::value >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_minus_assign.hpp b/boost/boost/type_traits/has_minus_assign.hpp new file mode 100644 index 0000000000..84ba3594d6 --- /dev/null +++ b/boost/boost/type_traits/has_minus_assign.hpp @@ -0,0 +1,65 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MINUS_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_MINUS_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_minus_assign +#define BOOST_TT_TRAIT_OP -= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value,\ + /* Lhs==void* and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==void* and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs=fundamental and Rhs=pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_modulus.hpp b/boost/boost/type_traits/has_modulus.hpp new file mode 100644 index 0000000000..6948728058 --- /dev/null +++ b/boost/boost/type_traits/has_modulus.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MODULUS_HPP_INCLUDED +#define BOOST_TT_HAS_MODULUS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_modulus +#define BOOST_TT_TRAIT_OP % +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_modulus_assign.hpp b/boost/boost/type_traits/has_modulus_assign.hpp new file mode 100644 index 0000000000..f0531f0747 --- /dev/null +++ b/boost/boost/type_traits/has_modulus_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_MODULUS_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_modulus_assign +#define BOOST_TT_TRAIT_OP %= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_multiplies.hpp b/boost/boost/type_traits/has_multiplies.hpp new file mode 100644 index 0000000000..4b578c5d78 --- /dev/null +++ b/boost/boost/type_traits/has_multiplies.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED +#define BOOST_TT_HAS_MULTIPLIES_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_multiplies +#define BOOST_TT_TRAIT_OP * +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer with pointer or fundamental */\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value,\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_multiplies_assign.hpp b/boost/boost/type_traits/has_multiplies_assign.hpp new file mode 100644 index 0000000000..1678b7bda5 --- /dev/null +++ b/boost/boost/type_traits/has_multiplies_assign.hpp @@ -0,0 +1,47 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_MULTIPLIES_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_multiplies_assign +#define BOOST_TT_TRAIT_OP *= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Lhs==const and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and (Rhs==fundamental or Rhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value,\ + /* Rhs==pointer and (Lhs==fundamental or Lhs==pointer) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_negate.hpp b/boost/boost/type_traits/has_negate.hpp new file mode 100644 index 0000000000..452e54ab41 --- /dev/null +++ b/boost/boost/type_traits/has_negate.hpp @@ -0,0 +1,25 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NEGATE_HPP_INCLUDED +#define BOOST_TT_HAS_NEGATE_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_negate +#define BOOST_TT_TRAIT_OP - +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer */\ + ::boost::is_pointer< Rhs_noref >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_not_equal_to.hpp b/boost/boost/type_traits/has_not_equal_to.hpp new file mode 100644 index 0000000000..e7e370013d --- /dev/null +++ b/boost/boost/type_traits/has_not_equal_to.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED +#define BOOST_TT_HAS_NOT_EQUAL_TO_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_not_equal_to +#define BOOST_TT_TRAIT_OP != +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer and Lhs!=base(Rhs) and Rhs!=base(Lhs) and Lhs!=void* and Rhs!=void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::type_traits::ice_not<\ + ::boost::type_traits::ice_or<\ + ::boost::is_base_of< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_base_of< Rhs_noptr, Lhs_noptr >::value,\ + ::boost::is_same< Lhs_noptr, Rhs_noptr >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value\ + >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_operator.hpp b/boost/boost/type_traits/has_operator.hpp new file mode 100644 index 0000000000..c97a90fc0b --- /dev/null +++ b/boost/boost/type_traits/has_operator.hpp @@ -0,0 +1,51 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_OPERATOR_HPP_INCLUDED +#define BOOST_TT_HAS_OPERATOR_HPP_INCLUDED + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#endif diff --git a/boost/boost/type_traits/has_plus.hpp b/boost/boost/type_traits/has_plus.hpp new file mode 100644 index 0000000000..70c12008f4 --- /dev/null +++ b/boost/boost/type_traits/has_plus.hpp @@ -0,0 +1,54 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_PLUS_HPP_INCLUDED +#define BOOST_TT_HAS_PLUS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_plus +#define BOOST_TT_TRAIT_OP + +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==void* and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==void* and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental and Lhs!=integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_plus_assign.hpp b/boost/boost/type_traits/has_plus_assign.hpp new file mode 100644 index 0000000000..6d65204dcf --- /dev/null +++ b/boost/boost/type_traits/has_plus_assign.hpp @@ -0,0 +1,66 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_PLUS_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_PLUS_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_plus_assign +#define BOOST_TT_TRAIT_OP += +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==void* and Rhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value\ + >::value,\ + /* Rhs==void* and Lhs==fundamental */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value\ + >::value,\ + /* Lhs==pointer and Rhs==fundamental and Rhs!=integral */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value,\ + /* Rhs==pointer and Lhs==fundamental and Lhs!=bool */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::type_traits::ice_not< ::boost::is_same< Lhs_nocv, bool >::value >::value\ + >::value,\ + /* (Lhs==fundamental or Lhs==pointer) and (Rhs==fundamental or Rhs==pointer) and (Lhs==const) */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_post_decrement.hpp b/boost/boost/type_traits/has_post_decrement.hpp new file mode 100644 index 0000000000..e277eaf98a --- /dev/null +++ b/boost/boost/type_traits/has_post_decrement.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED +#define BOOST_TT_HAS_POST_DECREMENT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_post_decrement +#define BOOST_TT_TRAIT_OP -- +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* bool */\ + ::boost::is_same< bool, Lhs_nocv >::value,\ + /* void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value\ + >::value,\ + /* (fundamental or pointer) and const */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_post_increment.hpp b/boost/boost/type_traits/has_post_increment.hpp new file mode 100644 index 0000000000..085b2d5933 --- /dev/null +++ b/boost/boost/type_traits/has_post_increment.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED +#define BOOST_TT_HAS_POST_INCREMENT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_post_increment +#define BOOST_TT_TRAIT_OP ++ +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* bool */\ + ::boost::is_same< bool, Lhs_nocv >::value,\ + /* void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_void< Lhs_noptr >::value\ + >::value,\ + /* (fundamental or pointer) and const */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_pre_decrement.hpp b/boost/boost/type_traits/has_pre_decrement.hpp new file mode 100644 index 0000000000..8f08291b0b --- /dev/null +++ b/boost/boost/type_traits/has_pre_decrement.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED +#define BOOST_TT_HAS_PRE_DECREMENT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_pre_decrement +#define BOOST_TT_TRAIT_OP -- +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* bool */\ + ::boost::is_same< bool, Rhs_nocv >::value,\ + /* void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value,\ + /* (fundamental or pointer) and const */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + ::boost::is_const< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_pre_increment.hpp b/boost/boost/type_traits/has_pre_increment.hpp new file mode 100644 index 0000000000..fcb946d573 --- /dev/null +++ b/boost/boost/type_traits/has_pre_increment.hpp @@ -0,0 +1,40 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED +#define BOOST_TT_HAS_PRE_INCREMENT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_pre_increment +#define BOOST_TT_TRAIT_OP ++ +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* bool */\ + ::boost::is_same< bool, Rhs_nocv >::value,\ + /* void* */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Rhs_noref >::value,\ + ::boost::is_void< Rhs_noptr >::value\ + >::value,\ + /* (fundamental or pointer) and const */\ + ::boost::type_traits::ice_and<\ + ::boost::type_traits::ice_or<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + ::boost::is_const< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_right_shift.hpp b/boost/boost/type_traits/has_right_shift.hpp new file mode 100644 index 0000000000..5735870159 --- /dev/null +++ b/boost/boost/type_traits/has_right_shift.hpp @@ -0,0 +1,49 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_RIGHT_SHIFT_HPP_INCLUDED +#define BOOST_TT_HAS_RIGHT_SHIFT_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_right_shift +#define BOOST_TT_TRAIT_OP >> +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_right_shift_assign.hpp b/boost/boost/type_traits/has_right_shift_assign.hpp new file mode 100644 index 0000000000..0536e71b6a --- /dev/null +++ b/boost/boost/type_traits/has_right_shift_assign.hpp @@ -0,0 +1,55 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED +#define BOOST_TT_HAS_RIGHT_SHIFT_ASSIGN_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_right_shift_assign +#define BOOST_TT_TRAIT_OP >>= +#define BOOST_TT_FORBIDDEN_IF\ + ::boost::type_traits::ice_or<\ + /* Lhs==fundamental and Rhs==fundamental and (Lhs!=integral or Rhs!=integral) */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::type_traits::ice_or<\ + ::boost::type_traits::ice_not< ::boost::is_integral< Lhs_noref >::value >::value,\ + ::boost::type_traits::ice_not< ::boost::is_integral< Rhs_noref >::value >::value\ + >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Rhs==fundamental and Lhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_pointer< Lhs_noref >::value\ + >::value,\ + /* Lhs==pointer and Rhs==pointer */\ + ::boost::type_traits::ice_and<\ + ::boost::is_pointer< Lhs_noref >::value,\ + ::boost::is_pointer< Rhs_noref >::value\ + >::value,\ + /* Lhs==fundamental and Rhs==fundamental and Lhs==const */\ + ::boost::type_traits::ice_and<\ + ::boost::is_fundamental< Lhs_nocv >::value,\ + ::boost::is_fundamental< Rhs_nocv >::value,\ + ::boost::is_const< Lhs_noref >::value\ + >::value\ + >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_unary_minus.hpp b/boost/boost/type_traits/has_unary_minus.hpp new file mode 100644 index 0000000000..6b3157f42c --- /dev/null +++ b/boost/boost/type_traits/has_unary_minus.hpp @@ -0,0 +1,25 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED +#define BOOST_TT_HAS_UNARY_MINUS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_unary_minus +#define BOOST_TT_TRAIT_OP - +#define BOOST_TT_FORBIDDEN_IF\ + /* pointer */\ + ::boost::is_pointer< Rhs_noref >::value + + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/has_unary_plus.hpp b/boost/boost/type_traits/has_unary_plus.hpp new file mode 100644 index 0000000000..a61770f858 --- /dev/null +++ b/boost/boost/type_traits/has_unary_plus.hpp @@ -0,0 +1,23 @@ +// (C) Copyright 2009-2011 Frederic Bron. +// +// Use, modification and distribution are 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 http://www.boost.org/libs/type_traits for most recent version including documentation. + +#ifndef BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED +#define BOOST_TT_HAS_UNARY_PLUS_HPP_INCLUDED + +#define BOOST_TT_TRAIT_NAME has_unary_plus +#define BOOST_TT_TRAIT_OP + +#define BOOST_TT_FORBIDDEN_IF\ + false + +#include + +#undef BOOST_TT_TRAIT_NAME +#undef BOOST_TT_TRAIT_OP +#undef BOOST_TT_FORBIDDEN_IF + +#endif diff --git a/boost/boost/type_traits/intrinsics.hpp b/boost/boost/type_traits/intrinsics.hpp index 6057249755..d47b33ee47 100644 --- a/boost/boost/type_traits/intrinsics.hpp +++ b/boost/boost/type_traits/intrinsics.hpp @@ -1,4 +1,3 @@ - // (C) Copyright Steve Cleary, Beman Dawes, Howard Hinnant & John Maddock 2000. // Use, modification and distribution are subject to the Boost Software License, // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at @@ -22,7 +21,7 @@ // (these should largely ignore cv-qualifiers) // BOOST_IS_UNION(T) should evaluate to true if T is a union type // BOOST_IS_POD(T) should evaluate to true if T is a POD type -// BOOST_IS_EMPTY(T) should evaluate to true if T is an empty struct or union +// BOOST_IS_EMPTY(T) should evaluate to true if T is an empty class type (and not a union) // BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) should evaluate to true if "T x;" has no effect // BOOST_HAS_TRIVIAL_COPY(T) should evaluate to true if T(t) <==> memcpy // BOOST_HAS_TRIVIAL_ASSIGN(T) should evaluate to true if t = u <==> memcpy @@ -36,7 +35,7 @@ // // BOOST_IS_ABSTRACT(T) true if T is an abstract type // BOOST_IS_BASE_OF(T,U) true if T is a base class of U -// BOOST_IS_CLASS(T) true if T is a class type +// BOOST_IS_CLASS(T) true if T is a class type (and not a union) // BOOST_IS_CONVERTIBLE(T,U) true if T is convertible to U // BOOST_IS_ENUM(T) true is T is an enum // BOOST_IS_POLYMORPHIC(T) true if T is a polymorphic type @@ -124,6 +123,68 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#if defined(BOOST_CLANG) && defined(__has_feature) +# include +# include +# include + +# if __has_feature(is_union) +# define BOOST_IS_UNION(T) __is_union(T) +# endif +# if __has_feature(is_pod) && defined(_LIBCPP_VERSION) +# define BOOST_IS_POD(T) __is_pod(T) +# endif +# if __has_feature(is_empty) && defined(_LIBCPP_VERSION) +# define BOOST_IS_EMPTY(T) __is_empty(T) +# endif +# if __has_feature(has_trivial_constructor) +# define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) +# endif +# if __has_feature(has_trivial_copy) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && !is_volatile::value) +# endif +# if __has_feature(has_trivial_assign) +# define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) +# endif +# if __has_feature(has_trivial_destructor) +# define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) +# endif +# if __has_feature(has_nothrow_constructor) +# define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) +# endif +# if __has_feature(has_nothrow_copy) +# define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile::value && !is_reference::value) +# endif +# if __has_feature(has_nothrow_assign) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::value) +# endif +# if __has_feature(has_virtual_destructor) +# define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T) +# endif +# if __has_feature(is_abstract) +# define BOOST_IS_ABSTRACT(T) __is_abstract(T) +# endif +# if __has_feature(is_base_of) +# define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same::value) +# endif +# if __has_feature(is_class) +# define BOOST_IS_CLASS(T) __is_class(T) +# endif +# if __has_feature(is_convertible_to) +# include +# define BOOST_IS_CONVERTIBLE(T,U) (__is_convertible_to(T,U) && !::boost::is_abstract::value) +# endif +# if __has_feature(is_enum) +# define BOOST_IS_ENUM(T) __is_enum(T) +# endif +# if __has_feature(is_polymorphic) +# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) +# endif +# define BOOST_ALIGNMENT_OF(T) __alignof(T) + +# define BOOST_HAS_TYPE_TRAITS_INTRINSICS +#endif + #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 3) && !defined(__GCCXML__))) # include # include @@ -171,7 +232,7 @@ # define BOOST_IS_POD(T) __is_pod(T) # define BOOST_IS_EMPTY(T) __is_empty(T) # define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) __has_trivial_constructor(T) -# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && && !is_volatile::value) +# define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference::value && !is_volatile::value) # define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile::value) # define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T) # define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T) @@ -224,3 +285,4 @@ + diff --git a/boost/boost/type_traits/is_unsigned.hpp b/boost/boost/type_traits/is_unsigned.hpp index d8e5a89d9d..0602838a33 100644 --- a/boost/boost/type_traits/is_unsigned.hpp +++ b/boost/boost/type_traits/is_unsigned.hpp @@ -109,7 +109,7 @@ template <> struct is_unsigned_imp : public true_type{}; template <> struct is_unsigned_imp : public true_type{}; template <> struct is_unsigned_imp : public true_type{}; #endif -#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) +#if defined(WCHAR_MIN) && (WCHAR_MIN == 0) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) template <> struct is_unsigned_imp : public true_type{}; template <> struct is_unsigned_imp : public true_type{}; template <> struct is_unsigned_imp : public true_type{}; diff --git a/boost/boost/type_traits/remove_cv.hpp b/boost/boost/type_traits/remove_cv.hpp index 4061fd2b4c..ee6d8f9691 100644 --- a/boost/boost/type_traits/remove_cv.hpp +++ b/boost/boost/type_traits/remove_cv.hpp @@ -27,6 +27,8 @@ namespace boost { +#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION + namespace detail{ template @@ -49,7 +51,6 @@ struct rvalue_ref_filter_rem_cv } -#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION // convert a type T to a non-cv-qualified type - remove_cv BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_cv,T,typename boost::detail::rvalue_ref_filter_rem_cv::type) diff --git a/boost/boost/typeof/typeof.hpp b/boost/boost/typeof/typeof.hpp index 3e91649e2e..4d56964980 100644 --- a/boost/boost/typeof/typeof.hpp +++ b/boost/boost/typeof/typeof.hpp @@ -155,7 +155,22 @@ # else # error native typeof is not supported # endif - +#elif defined(__SUNPRO_CC) +# if (__SUNPRO_CC < 0x590 ) +# ifdef BOOST_TYPEOF_NATIVE +# error native typeof is not supported +# endif +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif +# endif #else //unknown compiler # ifndef BOOST_TYPEOF_NATIVE # ifndef BOOST_TYPEOF_EMULATION diff --git a/boost/boost/version.hpp b/boost/boost/version.hpp index 041e37d697..d15482fee9 100644 --- a/boost/boost/version.hpp +++ b/boost/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 104700 +#define BOOST_VERSION 104800 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,7 +27,7 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_47" +#define BOOST_LIB_VERSION "1_48" #endif diff --git a/boost/libs/regex/src/c_regex_traits.cpp b/boost/libs/regex/src/c_regex_traits.cpp index a99de14c62..6701020105 100644 --- a/boost/libs/regex/src/c_regex_traits.cpp +++ b/boost/libs/regex/src/c_regex_traits.cpp @@ -21,6 +21,7 @@ #include #include +#include "internals.hpp" #if !BOOST_WORKAROUND(__BORLANDC__, < 0x560) @@ -107,26 +108,6 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::transfo return result; } -enum -{ - char_class_space=1<<0, - char_class_print=1<<1, - char_class_cntrl=1<<2, - char_class_upper=1<<3, - char_class_lower=1<<4, - char_class_alpha=1<<5, - char_class_digit=1<<6, - char_class_punct=1<<7, - char_class_xdigit=1<<8, - char_class_alnum=char_class_alpha|char_class_digit, - char_class_graph=char_class_alnum|char_class_punct, - char_class_blank=1<<9, - char_class_word=1<<10, - char_class_unicode=1<<11, - char_class_horizontal=1<<12, - char_class_vertical=1<<13 -}; - c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits::lookup_classname(const char* p1, const char* p2) { static const char_class_type masks[] = diff --git a/boost/libs/regex/src/cregex.cpp b/boost/libs/regex/src/cregex.cpp index 5c27330c8e..8d69139f96 100644 --- a/boost/libs/regex/src/cregex.cpp +++ b/boost/libs/regex/src/cregex.cpp @@ -361,11 +361,24 @@ void BuildFileList(std::list* pl, const char* files, bool recurse) while(dstart != dend) { + // Verify that sprintf will not overflow: + if(std::strlen(dstart.path()) + std::strlen(directory_iterator::separator()) + std::strlen(ptr) >= MAX_PATH) + { + // Oops overflow, skip this item: + ++dstart; + continue; + } #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) - (::sprintf_s)(buf, sizeof(buf), "%s%s%s", dstart.path(), directory_iterator::separator(), ptr); + int r = (::sprintf_s)(buf, sizeof(buf), "%s%s%s", dstart.path(), directory_iterator::separator(), ptr); #else - (std::sprintf)(buf, "%s%s%s", dstart.path(), directory_iterator::separator(), ptr); + int r = (std::sprintf)(buf, "%s%s%s", dstart.path(), directory_iterator::separator(), ptr); #endif + if(r < 0) + { + // sprintf failed, skip this item: + ++dstart; + continue; + } BuildFileList(pl, buf, recurse); ++dstart; } diff --git a/boost/libs/regex/src/fileiter.cpp b/boost/libs/regex/src/fileiter.cpp index ff1d11198f..38c0d2c3a5 100644 --- a/boost/libs/regex/src/fileiter.cpp +++ b/boost/libs/regex/src/fileiter.cpp @@ -847,10 +847,16 @@ bool iswild(const char* mask, const char* name) unsigned _fi_attributes(const char* root, const char* name) { char buf[MAX_PATH]; + // verify that we can not overflow: + if(std::strlen(root) + std::strlen(_fi_sep) + std::strlen(name) >= MAX_PATH) + return 0; + int r; if( ( (root[0] == *_fi_sep) || (root[0] == *_fi_sep_alt) ) && (root[1] == '\0') ) - (std::sprintf)(buf, "%s%s", root, name); + r = (std::sprintf)(buf, "%s%s", root, name); else - (std::sprintf)(buf, "%s%s%s", root, _fi_sep, name); + r = (std::sprintf)(buf, "%s%s%s", root, _fi_sep, name); + if(r < 0) + return 0; // sprintf failed DIR* d = opendir(buf); if(d) { diff --git a/boost/libs/regex/src/internals.hpp b/boost/libs/regex/src/internals.hpp new file mode 100644 index 0000000000..3a15cc67cb --- /dev/null +++ b/boost/libs/regex/src/internals.hpp @@ -0,0 +1,35 @@ +/* + * + * Copyright (c) 2011 + * John Maddock + * + * Use, modification and distribution are 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) + * + */ + +#ifndef BOOST_REGEX_SRC_INTERNALS_HPP +#define BOOST_REGEX_SRC_INTERNALS_HPP + +enum +{ + char_class_space=1<<0, + char_class_print=1<<1, + char_class_cntrl=1<<2, + char_class_upper=1<<3, + char_class_lower=1<<4, + char_class_alpha=1<<5, + char_class_digit=1<<6, + char_class_punct=1<<7, + char_class_xdigit=1<<8, + char_class_alnum=char_class_alpha|char_class_digit, + char_class_graph=char_class_alnum|char_class_punct, + char_class_blank=1<<9, + char_class_word=1<<10, + char_class_unicode=1<<11, + char_class_horizontal=1<<12, + char_class_vertical=1<<13 +}; + +#endif // BOOST_REGEX_SRC_INTERNALS_HPP diff --git a/boost/libs/regex/src/posix_api.cpp b/boost/libs/regex/src/posix_api.cpp index 37ed4221be..abafd8f231 100644 --- a/boost/libs/regex/src/posix_api.cpp +++ b/boost/libs/regex/src/posix_api.cpp @@ -167,11 +167,17 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorA(int code, const regex_tA* { if(std::strcmp(e->re_endp, names[i]) == 0) { + // + // We're converting an integer i to a string, and since i <= REG_E_UNKNOWN + // a five character string is *always* large enough: + // #if BOOST_WORKAROUND(BOOST_MSVC, >= 1400) && !defined(_WIN32_WCE) && !defined(UNDER_CE) - (::sprintf_s)(localbuf, 5, "%d", i); + int r = (::sprintf_s)(localbuf, 5, "%d", i); #else - (std::sprintf)(localbuf, "%d", i); + int r = (std::sprintf)(localbuf, "%d", i); #endif + if(r < 0) + return 0; // sprintf failed if(std::strlen(localbuf) < buf_size) re_detail::strcpy_s(buf, buf_size, localbuf); return std::strlen(localbuf) + 1; diff --git a/boost/libs/regex/src/wc_regex_traits.cpp b/boost/libs/regex/src/wc_regex_traits.cpp index a9e96d9ec8..b3d2c5a2c7 100755 --- a/boost/libs/regex/src/wc_regex_traits.cpp +++ b/boost/libs/regex/src/wc_regex_traits.cpp @@ -22,6 +22,7 @@ #include #include #include +#include "internals.hpp" #if defined(_DLL_CPPLIB) && !defined(_M_CEE_PURE) && defined(_NATIVE_WCHAR_T_DEFINED) \ && !(defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION) || defined(__STD_RWCOMPILER_H__) || defined(_RWSTD_VER))\ @@ -147,26 +148,6 @@ c_regex_traits::string_type BOOST_REGEX_CALL c_regex_traits::t return result; } -enum -{ - char_class_space=1<<0, - char_class_print=1<<1, - char_class_cntrl=1<<2, - char_class_upper=1<<3, - char_class_lower=1<<4, - char_class_alpha=1<<5, - char_class_digit=1<<6, - char_class_punct=1<<7, - char_class_xdigit=1<<8, - char_class_alnum=char_class_alpha|char_class_digit, - char_class_graph=char_class_alnum|char_class_punct, - char_class_blank=1<<9, - char_class_word=1<<10, - char_class_unicode=1<<11, - char_class_horizontal=1<<12, - char_class_vertical=1<<13 -}; - c_regex_traits::char_class_type BOOST_REGEX_CALL c_regex_traits::lookup_classname(const wchar_t* p1, const wchar_t* p2) { static const char_class_type masks[] = diff --git a/boost/libs/regex/src/wide_posix_api.cpp b/boost/libs/regex/src/wide_posix_api.cpp index 3c693c6720..ff5c90d89a 100644 --- a/boost/libs/regex/src/wide_posix_api.cpp +++ b/boost/libs/regex/src/wide_posix_api.cpp @@ -74,7 +74,7 @@ const wchar_t* wnames[] = { }; } -typedef boost::basic_regex > c_regex_type; +typedef boost::basic_regex > wc_regex_type; BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wchar_t* ptr, int f) { @@ -84,7 +84,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha #ifndef BOOST_NO_EXCEPTIONS try{ #endif - expression->guts = new c_regex_type(); + expression->guts = new wc_regex_type(); #ifndef BOOST_NO_EXCEPTIONS } catch(...) { @@ -134,9 +134,9 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regcompW(regex_tW* expression, const wcha try{ #endif expression->re_magic = wmagic_value; - static_cast(expression->guts)->set_expression(ptr, p2, flags); - expression->re_nsub = static_cast(expression->guts)->mark_count() - 1; - result = static_cast(expression->guts)->error_code(); + static_cast(expression->guts)->set_expression(ptr, p2, flags); + expression->re_nsub = static_cast(expression->guts)->mark_count() - 1; + result = static_cast(expression->guts)->error_code(); #ifndef BOOST_NO_EXCEPTIONS } catch(const boost::regex_error& be) @@ -215,7 +215,7 @@ BOOST_REGEX_DECL regsize_t BOOST_REGEX_CCALL regerrorW(int code, const regex_tW* { std::string p; if((e) && (e->re_magic == wmagic_value)) - p = static_cast(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code)); + p = static_cast(e->guts)->get_traits().error_string(static_cast< ::boost::regex_constants::error_type>(code)); else { p = re_detail::get_default_error_string(static_cast< ::boost::regex_constants::error_type>(code)); @@ -264,7 +264,7 @@ BOOST_REGEX_DECL int BOOST_REGEX_CCALL regexecW(const regex_tW* expression, cons #endif if(expression->re_magic == wmagic_value) { - result = regex_search(start, end, m, *static_cast(expression->guts), flags); + result = regex_search(start, end, m, *static_cast(expression->guts), flags); } else return result; @@ -301,7 +301,7 @@ BOOST_REGEX_DECL void BOOST_REGEX_CCALL regfreeW(regex_tW* expression) { if(expression->re_magic == wmagic_value) { - delete static_cast(expression->guts); + delete static_cast(expression->guts); } expression->re_magic = 0; }