]> git.lyx.org Git - features.git/commitdiff
boost: update to 1.47.0
authorPeter Kümmel <syntheticpp@gmx.net>
Sat, 13 Aug 2011 10:34:13 +0000 (10:34 +0000)
committerPeter Kümmel <syntheticpp@gmx.net>
Sat, 13 Aug 2011 10:34:13 +0000 (10:34 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39481 a592a061-630c-0410-9148-cb99ea01b6c8

129 files changed:
boost/boost/array.hpp
boost/boost/config.hpp
boost/boost/config/compiler/borland.hpp
boost/boost/config/compiler/codegear.hpp
boost/boost/config/compiler/common_edg.hpp
boost/boost/config/compiler/digitalmars.hpp
boost/boost/config/compiler/gcc.hpp
boost/boost/config/compiler/gcc_xml.hpp
boost/boost/config/compiler/hp_acc.hpp
boost/boost/config/compiler/intel.hpp
boost/boost/config/compiler/metrowerks.hpp
boost/boost/config/compiler/mpw.hpp
boost/boost/config/compiler/pgi.hpp
boost/boost/config/compiler/sunpro_cc.hpp
boost/boost/config/compiler/vacpp.hpp
boost/boost/config/compiler/visualc.hpp
boost/boost/config/platform/linux.hpp
boost/boost/config/platform/macos.hpp
boost/boost/config/select_compiler_config.hpp
boost/boost/config/select_stdlib_config.hpp
boost/boost/config/stdlib/dinkumware.hpp
boost/boost/config/stdlib/libcomo.hpp
boost/boost/config/stdlib/libstdcpp3.hpp
boost/boost/config/stdlib/modena.hpp
boost/boost/config/stdlib/msl.hpp
boost/boost/config/stdlib/roguewave.hpp
boost/boost/config/stdlib/sgi.hpp
boost/boost/config/stdlib/stlport.hpp
boost/boost/config/stdlib/vacpp.hpp
boost/boost/config/suffix.hpp
boost/boost/config/warning_disable.hpp
boost/boost/detail/container_fwd.hpp
boost/boost/detail/interlocked.hpp
boost/boost/detail/lightweight_test.hpp
boost/boost/exception/detail/exception_ptr.hpp
boost/boost/exception/detail/type_info.hpp
boost/boost/exception/diagnostic_information.hpp
boost/boost/exception/errinfo_nested_exception.hpp
boost/boost/exception/exception.hpp
boost/boost/exception/info.hpp
boost/boost/function.hpp
boost/boost/function/function_base.hpp
boost/boost/function/function_template.hpp
boost/boost/integer_traits.hpp
boost/boost/iterator.hpp
boost/boost/iterator/iterator_adaptor.hpp
boost/boost/iterator/transform_iterator.hpp
boost/boost/iterator/zip_iterator.hpp
boost/boost/lexical_cast.hpp
boost/boost/make_shared.hpp [new file with mode: 0644]
boost/boost/none.hpp
boost/boost/numeric/conversion/bounds.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/cast.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/conversion_traits.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/converter.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/converter_policies.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/bounds.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/conversion_traits.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/converter.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/int_float_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/is_subranged.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/meta.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/old_numeric_cast.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/sign_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/int_float_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/int_float_mixture_enum.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/is_subranged.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/sign_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/sign_mixture_enum.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/udt_builtin_mixture.hpp [new file with mode: 0644]
boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp [new file with mode: 0644]
boost/boost/operators.hpp
boost/boost/optional/optional_fwd.hpp
boost/boost/preprocessor/seq/cat.hpp
boost/boost/preprocessor/seq/size.hpp
boost/boost/regex/config.hpp
boost/boost/regex/pending/object_cache.hpp
boost/boost/regex/pending/unicode_iterator.hpp
boost/boost/regex/v4/basic_regex.hpp
boost/boost/regex/v4/basic_regex_parser.hpp
boost/boost/regex/v4/cpp_regex_traits.hpp
boost/boost/regex/v4/u32regex_token_iterator.hpp
boost/boost/smart_ptr.hpp
boost/boost/smart_ptr/detail/shared_count.hpp
boost/boost/smart_ptr/detail/sp_counted_impl.hpp
boost/boost/smart_ptr/detail/sp_has_sync.hpp
boost/boost/smart_ptr/detail/spinlock.hpp
boost/boost/smart_ptr/detail/spinlock_pool.hpp
boost/boost/smart_ptr/intrusive_ptr.hpp
boost/boost/smart_ptr/make_shared.hpp
boost/boost/smart_ptr/shared_ptr.hpp
boost/boost/token_functions.hpp
boost/boost/tuple/tuple_io.hpp
boost/boost/type_traits/add_rvalue_reference.hpp
boost/boost/type_traits/alignment_of.hpp
boost/boost/type_traits/common_type.hpp
boost/boost/type_traits/detail/bool_trait_def.hpp
boost/boost/type_traits/detail/cv_traits_impl.hpp
boost/boost/type_traits/detail/size_t_trait_def.hpp
boost/boost/type_traits/detail/type_trait_def.hpp
boost/boost/type_traits/has_nothrow_assign.hpp
boost/boost/type_traits/has_nothrow_constructor.hpp
boost/boost/type_traits/has_nothrow_copy.hpp
boost/boost/type_traits/has_trivial_assign.hpp
boost/boost/type_traits/has_trivial_constructor.hpp
boost/boost/type_traits/has_trivial_copy.hpp
boost/boost/type_traits/has_trivial_destructor.hpp
boost/boost/type_traits/has_virtual_destructor.hpp
boost/boost/type_traits/integral_promotion.hpp
boost/boost/type_traits/intrinsics.hpp
boost/boost/type_traits/is_const.hpp
boost/boost/type_traits/is_convertible.hpp
boost/boost/type_traits/is_empty.hpp
boost/boost/type_traits/is_enum.hpp
boost/boost/type_traits/is_function.hpp
boost/boost/type_traits/is_fundamental.hpp
boost/boost/type_traits/is_member_function_pointer.hpp
boost/boost/type_traits/is_member_pointer.hpp
boost/boost/type_traits/is_pod.hpp
boost/boost/type_traits/is_pointer.hpp
boost/boost/type_traits/is_union.hpp
boost/boost/type_traits/is_virtual_base_of.hpp
boost/boost/type_traits/is_volatile.hpp
boost/boost/type_traits/msvc/typeof.hpp
boost/boost/type_traits/promote.hpp
boost/boost/type_traits/remove_pointer.hpp
boost/boost/type_traits/type_with_alignment.hpp
boost/boost/version.hpp

index 85b63a2800a93a332651aadfb42dd047713b4eb3..ffb504bdbb51920b0066529257372c3a07c52ac9 100644 (file)
@@ -322,7 +322,7 @@ namespace boost {
         static reference failed_rangecheck () {
                 std::out_of_range e("attempt to access element of an empty array");
                 boost::throw_exception(e);
-#if defined(BOOST_NO_EXCEPTIONS) || !defined(BOOST_MSVC)
+#if defined(BOOST_NO_EXCEPTIONS) || (!defined(BOOST_MSVC) && !defined(__PATHSCALE__))
                 //
                 // We need to return something here to keep
                 // some compilers happy: however we will never
index 055a27855b128e7614c3d99758bd899a8cd043b0..f37585ebb9b750cd541bfefa664eb355ea95009c 100644 (file)
@@ -36,7 +36,7 @@
 #endif
 
 // if we don't have a std library config set, try and find one:
-#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG)
+#if !defined(BOOST_STDLIB_CONFIG) && !defined(BOOST_NO_STDLIB_CONFIG) && !defined(BOOST_NO_CONFIG) && defined(__cplusplus)
 #  include <boost/config/select_stdlib_config.hpp>
 #endif
 // if we have a std library config, include it now:
index a989fd633b2b25b9337a62e14799803b65b2b9be..60f5505547c4fbda909717a1aaba6806286280b9 100644 (file)
 #  define BOOST_NO_CV_VOID_SPECIALIZATIONS
 #  define BOOST_NO_DEDUCED_TYPENAME
 // workaround for missing WCHAR_MAX/WCHAR_MIN:
+#ifdef __cplusplus
 #include <climits>
 #include <cwchar>
+#else
+#include <limits.h>
+#include <wchar.h>
+#endif // __cplusplus
 #ifndef WCHAR_MAX
 #  define WCHAR_MAX 0xffff
 #endif
@@ -69,7 +74,7 @@
 // Borland C++ Builder 6 and below:
 #if (__BORLANDC__ <= 0x564)
 
-#  ifdef NDEBUG
+#  if defined(NDEBUG) && defined(__cplusplus)
       // fix broken <cstring> so that Boost.test works:
 #     include <cstring>
 #     undef strcmp
 
 #define BOOST_NO_AUTO_DECLARATIONS
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS    // UTF-8 still not supported
 #define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_NOEXCEPT
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 #if __BORLANDC__ >= 0x590
 #  define BOOST_HAS_TR1_HASH
 
 
 
+
index f6dc4c02ba224598f7d0e42a22112f9fe7ad8043..f1887a0c0b47736ca47e6783b09b6a8a6e44a655 100644 (file)
@@ -60,7 +60,7 @@
 // (Niels Dekker, LKEB, April 2010)
 #  define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
 
-#  ifdef NDEBUG
+#  if defined(NDEBUG) && defined(__cplusplus)
       // fix broken <cstring> so that Boost.test works:
 #     include <cstring>
 #     undef strcmp
@@ -93,7 +93,6 @@
 
 #define BOOST_NO_AUTO_DECLARATIONS
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 //
 // TR1 macros:
index 9042578bfdab007c2fbea51f6f4d9b7955da41fb..c98c4751ebceec3102cff7f9282db872d912fa63 100644 (file)
@@ -74,7 +74,6 @@
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
@@ -82,6 +81,7 @@
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
@@ -91,6 +91,7 @@
 #define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 #ifdef c_plusplus
 // EDG has "long long" in non-strict mode
index 31c11bf0cea1ee9f05c01c77a107f73ef13b5ad0..27d6b8e498e6103fc5adca9237de5a25ab2e5df0 100644 (file)
@@ -44,7 +44,9 @@
 //
 // Is this really the best way to detect whether the std lib is in namespace std?
 //
+#ifdef __cplusplus
 #include <cstddef>
+#endif
 #if !defined(__STL_IMPORT_VENDOR_CSTD) && !defined(_STLP_IMPORT_VENDOR_CSTD)
 #  define BOOST_NO_STDC_NAMESPACE
 #endif
@@ -62,7 +64,6 @@
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
@@ -71,6 +72,7 @@
 #define BOOST_NO_EXTERN_TEMPLATE
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
@@ -80,6 +82,8 @@
 #define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+
 #if (__DMC__ < 0x812)
 #define BOOST_NO_VARIADIC_MACROS
 #endif
index f633647d65197fc1e18c0e89e6249e943e9448ee..90db8c56df1938846b8b92182a1027bc03c90cdd 100644 (file)
 
 // Variadic templates compiler: 
 //   http://www.generic-programming.org/~dgregor/cpp/variadic-templates.html
-#  ifdef __VARIADIC_TEMPLATES
+#  if defined(__VARIADIC_TEMPLATES) || (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4) && defined(__GXX_EXPERIMENTAL_CXX0X__))
 #    define BOOST_HAS_VARIADIC_TMPL
 #  else
 #    define BOOST_NO_VARIADIC_TEMPLATES
 #  define BOOST_NO_AUTO_MULTIDECLARATIONS
 #  define BOOST_NO_CHAR16_T
 #  define BOOST_NO_CHAR32_T
+#  define BOOST_NO_INITIALIZER_LISTS
 #  define BOOST_NO_DEFAULTED_FUNCTIONS
 #  define BOOST_NO_DELETED_FUNCTIONS
-#  define BOOST_NO_INITIALIZER_LISTS
-#  define BOOST_NO_SCOPED_ENUMS  
 #endif
 
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 4)
 #  define BOOST_NO_SFINAE_EXPR
 #endif
 
-// C++0x features in 4.4.1 and later
-//
-#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40401) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
-// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.4.1
-// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
-#  define BOOST_NO_SCOPED_ENUMS
-#endif
-
-// C++0x features in 4.5.n and later
+// C++0x features in 4.5.0 and later
 //
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #  define BOOST_NO_UNICODE_LITERALS
 #endif
 
-// C++0x features in 4.5.n and later
+// C++0x features in 4.5.1 and later
+//
+#if (__GNUC__*10000 + __GNUC_MINOR__*100 + __GNUC_PATCHLEVEL__ < 40501) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
+// scoped enums have a serious bug in 4.4.0, so define BOOST_NO_SCOPED_ENUMS before 4.5.1
+// See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
+#  define BOOST_NO_SCOPED_ENUMS
+#endif
+
+// C++0x features in 4.6.n and later
 //
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #define BOOST_NO_CONSTEXPR
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
+#endif
+
+#ifndef BOOST_COMPILER
+#  define BOOST_COMPILER "GNU C++ version " __VERSION__
 #endif
 
 // ConceptGCC compiler:
 #ifdef __GXX_CONCEPTS__
 #  define BOOST_HAS_CONCEPTS
 #  define BOOST_COMPILER "ConceptGCC version " __VERSION__
-#else
-#  define BOOST_NO_CONCEPTS
 #endif
 
-#ifndef BOOST_COMPILER
-#  define BOOST_COMPILER "GNU C++ version " __VERSION__
-#endif
-
-//
 // versions check:
 // we don't know gcc prior to version 2.90:
 #if (__GNUC__ == 2) && (__GNUC_MINOR__ < 90)
index a456463ce7a82076b8b53bbc2da8d23a57c236d3..54a9ae1bc66c45ed138cfbfa53d1fe40d854af00 100644 (file)
@@ -50,6 +50,8 @@
 #  define BOOST_NO_LAMBDAS
 #  define BOOST_NO_RAW_LITERALS
 #  define BOOST_NO_UNICODE_LITERALS
+#  define BOOST_NO_NOEXCEPT
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__
 
index d0b672ecaec3431b7b22b55249dcaa1c8b6497ac..cc0c0af5bc541f532a37a6c054be3bf72de68edd 100644 (file)
@@ -96,7 +96,6 @@
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
index f209ae776bd5d509a16100020951c9166bac8811..faa080fc6bc4c8996204aa96de218516227d63dd 100644 (file)
 // in type_traits code among other things, getting this correct
 // for the Intel compiler is actually remarkably fragile and tricky:
 //
+#ifdef __cplusplus
 #if defined(BOOST_NO_INTRINSIC_WCHAR_T)
 #include <cwchar>
 template< typename T > struct assert_no_intrinsic_wchar_t;
@@ -134,8 +135,9 @@ template<> struct assert_intrinsic_wchar_t<wchar_t> {};
 // if you see an error here then define BOOST_NO_INTRINSIC_WCHAR_T on the command line:
 template<> struct assert_intrinsic_wchar_t<unsigned short> {};
 #endif
+#endif
 
-#if _MSC_VER+0 >= 1000
+#if defined(_MSC_VER) && (_MSC_VER+0 >= 1000)
 #  if _MSC_VER >= 1200
 #     define BOOST_HAS_MS_INT64
 #  endif
@@ -209,7 +211,7 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
 
 #if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200)
 #  undef  BOOST_NO_RVALUE_REFERENCES
-#  undef  BOOST_NO_SCOPED_ENUMS
+//#  undef  BOOST_NO_SCOPED_ENUMS  // doesn't really work!!
 #  undef  BOOST_NO_DELETED_FUNCTIONS
 #  undef  BOOST_NO_DEFAULTED_FUNCTIONS
 #  undef  BOOST_NO_LAMBDAS
@@ -218,9 +220,16 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
 #  undef  BOOST_NO_AUTO_MULTIDECLARATIONS
 #endif
 
+#if (BOOST_INTEL_CXX_VERSION < 1200)
+//
+// fenv.h appears not to work with Intel prior to 12.0:
+//
+#  define BOOST_NO_FENV_H
+#endif
+
 //
 // last known and checked version:
-#if (BOOST_INTEL_CXX_VERSION > 1110)
+#if (BOOST_INTEL_CXX_VERSION > 1200)
 #  if defined(BOOST_ASSERT_CONFIG)
 #     error "Unknown compiler version - please run the configure tests and report the results"
 #  elif defined(_MSC_VER)
index 21083b7a1f12a18d7c923cd2a14b3ec39bf56bff..fb0401fea4cb42e1c2ba9f54ec6ec25c6b70cc44 100644 (file)
@@ -96,7 +96,6 @@
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION)
 
index ae12f801d5cbc24d764f538b88b48365a99d0360..e372f093ceb7f43546d684ad8c0f488a9fe1baba 100644 (file)
@@ -44,7 +44,6 @@
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
@@ -54,6 +53,7 @@
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
@@ -64,6 +64,7 @@
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 //
 // versions check:
index fb3a6c0b27a18a498c996e7401cddcb2cdec806f..3c803133448de9b7706b92a03f867013d815e023 100644 (file)
@@ -51,7 +51,6 @@
 //
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
@@ -61,6 +60,7 @@
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
@@ -71,6 +71,7 @@
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 //
 // version check:
index 85fa4625049eed870075d269c2f53e2863a0f708..206b53f0fd32215bde4e009d92b906f71f6c6a37 100644 (file)
 #define BOOST_NO_AUTO_MULTIDECLARATIONS
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DECLTYPE
 #define BOOST_NO_DEFAULTED_FUNCTIONS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_UNICODE_LITERALS
 #define BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_NO_VARIADIC_MACROS
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 
 //
 // Version
index 7ad616e44f0fa7d66b1a0b3185e29b0d8deaad16..52500202b4829bbbbb80e7e8b5217ae0ef8b3650 100644 (file)
@@ -78,7 +78,6 @@
 #  define BOOST_NO_CHAR16_T
 #  define BOOST_NO_CHAR32_T
 #endif
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #if ! __IBMCPP_DECLTYPE
 #  define BOOST_NO_DECLTYPE
 #endif
 #define BOOST_NO_INITIALIZER_LISTS
 #define BOOST_NO_LAMBDAS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_NULLPTR
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_SFINAE_EXPR
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 #if ! __IBMCPP_STATIC_ASSERT
 #  define BOOST_NO_STATIC_ASSERT
 #endif
index 38789367a863d6a1e7b34a64cb53357bcfa9fc60..d2dfa7ef0a274839e5bff2995e7c7fd02ebaca2d 100644 (file)
 #endif
 
 #if defined(_WIN32_WCE) || defined(UNDER_CE)
-#  define BOOST_NO_THREADEX
-#  define BOOST_NO_GETSYSTEMTIMEASFILETIME
 #  define BOOST_NO_SWPRINTF
 #endif
 
+// we have ThreadEx or GetSystemTimeAsFileTime unless we're running WindowsCE
+#if !defined(_WIN32_WCE) && !defined(UNDER_CE)
+#  define BOOST_HAS_THREADEX
+#  define BOOST_HAS_GETSYSTEMTIMEASFILETIME
+#endif
+
 //   
 // check for exception handling support:   
 #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
 #define BOOST_NO_RVALUE_REFERENCES
 #define BOOST_NO_STATIC_ASSERT
 #define BOOST_NO_NULLPTR
+#define BOOST_NO_DECLTYPE
 #endif // _MSC_VER < 1600
 
 #if _MSC_VER >= 1600
 // C++0x features not supported by any versions
 #define BOOST_NO_CHAR16_T
 #define BOOST_NO_CHAR32_T
-#define BOOST_NO_CONCEPTS
 #define BOOST_NO_CONSTEXPR
 #define BOOST_NO_DEFAULTED_FUNCTIONS
-#define BOOST_NO_DECLTYPE
 #define BOOST_NO_DELETED_FUNCTIONS
 #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
 #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
 #define BOOST_NO_INITIALIZER_LISTS
+#define BOOST_NO_NOEXCEPT
 #define BOOST_NO_RAW_LITERALS
 #define BOOST_NO_SCOPED_ENUMS
 #define BOOST_NO_TEMPLATE_ALIASES
 #define BOOST_NO_VARIADIC_TEMPLATES
 #define BOOST_NO_SFINAE_EXPR
 #define BOOST_NO_TWO_PHASE_NAME_LOOKUP
+#define BOOST_NO_UNIFIED_INITIALIZATION_SYNTAX
 //
 // prefix and suffix headers:
 //
index 51ae13347cdcbba4fde2c6bbfb68d877c49da62f..a02aff7856b7c9764cd54e6a83fd3d49a0368ab1 100644 (file)
 #define BOOST_PLATFORM "linux"
 
 // make sure we have __GLIBC_PREREQ if available at all
+#ifdef __cplusplus
 #include <cstdlib>
+#else
+#include <stdlib.h>
+#endif
 
 //
 // <stdint.h> added to glibc 2.1.1
@@ -68,6 +72,7 @@
 // boilerplate code:
 #define BOOST_HAS_UNISTD_H
 #include <boost/config/posix_features.hpp>
+#define BOOST_HAS_PTHREAD_YIELD
 
 #ifndef __GNUC__
 //
index 2780ef99e9e80e0d7731fdc4ae613ea1f023bfa7..6d876b12db3849ba3a27ba22959574d3127be277 100644 (file)
 #  if ( defined(TARGET_API_MAC_CARBON) && TARGET_API_MAC_CARBON ) || ( defined(TARGET_CARBON) && TARGET_CARBON )
 
 #  if !defined(BOOST_HAS_PTHREADS)
-#    define BOOST_HAS_MPTASKS
+// MPTasks support is deprecated/removed from Boost:
+//#    define BOOST_HAS_MPTASKS
 #  elif ( __dest_os == __mac_os_x )
 // We are doing a Carbon/Mach-O/MSL build which has pthreads, but only the
 // gettimeofday and no posix.
 #  define BOOST_HAS_GETTIMEOFDAY
 #  endif
 
-// The MP task implementation of Boost Threads aims to replace MP-unsafe
-// parts of the MSL, so we turn on threads unconditionally.
-#    define BOOST_HAS_THREADS
+#ifdef BOOST_HAS_PTHREADS
+#  define BOOST_HAS_THREADS
+#endif
 
 // The remote call manager depends on this.
 #    define BOOST_BIND_ENABLE_PASCAL
index e19469ae2125b212002e6493cf0986ab66f79d0c..34a4da5889d90e8a39a61caeb259214e20eb33db 100644 (file)
 
 //  See http://www.boost.org/ for most recent version.
 
-
-// one identification macro for each of the
-// compilers we support:
-
-#   define BOOST_CXX_GCCXML     0
-#   define BOOST_CXX_NVCC       0
-#   define BOOST_CXX_COMO       0
-#   define BOOST_CXX_PATHSCALE  0
-#   define BOOST_CXX_CLANG      0
-#   define BOOST_CXX_DMC        0
-#   define BOOST_CXX_INTEL      0
-#   define BOOST_CXX_GNUC       0
-#   define BOOST_CXX_KCC        0
-#   define BOOST_CXX_SGI        0
-#   define BOOST_CXX_TRU64      0
-#   define BOOST_CXX_GHS        0
-#   define BOOST_CXX_BORLAND    0
-#   define BOOST_CXX_CW         0
-#   define BOOST_CXX_SUNPRO     0
-#   define BOOST_CXX_HPACC      0
-#   define BOOST_CXX_MPW        0
-#   define BOOST_CXX_IBMCPP     0
-#   define BOOST_CXX_MSVC       0
-#   define BOOST_CXX_PGI        0
-#   define BOOST_CXX_NVCC       0
-
-
 // locate which compiler we are using and define
 // BOOST_COMPILER_CONFIG as needed: 
 
index f020482365e2ab3722288a8a77794c3ee25e77cf..96ede0022247247f9184ecef2bad3ecee8f7e52c 100644 (file)
 // First include <cstddef> to determine if some version of STLport is in use as the std lib
 // (do not rely on this header being included since users can short-circuit this header 
 //  if they know whose std lib they are using.)
-#include <cstddef>
+#ifdef __cplusplus
+#  include <cstddef>
+#else
+#  include <stddef.h>
+#endif
 
 #if defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
 // STLPort library; this _must_ come first, otherwise since
index a7579daa09c92d88d1d654dac880b5f66b758014..2da1bf72ec52db23097a231bb2ed2be6219190fe 100644 (file)
@@ -87,7 +87,7 @@
 #endif
 
 #include <typeinfo>
-#if !_HAS_EXCEPTIONS
+#if ( (!_HAS_EXCEPTIONS && !defined(__ghs__)) || (!_HAS_NAMESPACE && defined(__ghs__)) ) 
 #  define BOOST_NO_STD_TYPEINFO    
 #endif  
 
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_REGEX
 #  define BOOST_NO_0X_HDR_SYSTEM_ERROR
-#  define BOOST_NO_0X_HDR_TYPE_TRAITS
 #  define BOOST_NO_STD_UNORDERED        // deprecated; see following
 #  define BOOST_NO_0X_HDR_UNORDERED_MAP
 #  define BOOST_NO_0X_HDR_UNORDERED_SET
 #if !defined(_HAS_TR1_IMPORTS) && !defined(BOOST_NO_0X_HDR_TUPLE)
 #  define BOOST_NO_0X_HDR_TUPLE
 #endif
-
-//  C++0x headers not yet implemented
 //
+//  C++0x headers not yet (fully) implemented:
+//
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
 #  define BOOST_NO_0X_HDR_CHRONO
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FUTURE
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RATIO
 #  define BOOST_NO_0X_HDR_THREAD
index 16a842ae2eccb28b6bb86bddab2b15e19a8cba6b..341cf9708ab53cbf0fe0f3bf70ea54b39c59cb3f 100644 (file)
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index c048b89693cc649c50aff153c6e5fda73fa3e59d..52d5837349c57e55ba8d4b5d265b7dfd4f804294 100644 (file)
 //
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_0X_HDR_ARRAY
-#  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_REGEX
 #  define BOOST_NO_0X_HDR_TUPLE
-#  define BOOST_NO_0X_HDR_TYPE_TRAITS
 #  define BOOST_NO_STD_UNORDERED  // deprecated; see following
 #  define BOOST_NO_0X_HDR_UNORDERED_MAP
 #  define BOOST_NO_0X_HDR_UNORDERED_SET
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RATIO
 #  define BOOST_NO_0X_HDR_SYSTEM_ERROR
-#  define BOOST_NO_0X_HDR_THREAD
+#else
+#  define BOOST_HAS_TR1_COMPLEX_INVERSE_TRIG 
+#  define BOOST_HAS_TR1_COMPLEX_OVERLOADS 
+#endif
+
+#if (!defined(_GLIBCXX_HAS_GTHREADS) || !defined(_GLIBCXX_USE_C99_STDINT_TR1)) && (!defined(BOOST_NO_0X_HDR_CONDITION_VARIABLE) || !defined(BOOST_NO_0X_HDR_MUTEX))
+#  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
+#  define BOOST_NO_0X_HDR_MUTEX
 #endif
 
 //  C++0x features in GCC 4.5.0 and later
 //
 #if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_NUMERIC_LIMITS_LOWEST
+#  define BOOST_NO_0X_HDR_FUTURE
+#  define BOOST_NO_0X_HDR_RANDOM
 #endif
 
-//  C++0x headers not yet implemented
+//  C++0x features in GCC 4.5.0 and later
 //
-#  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
-#  define BOOST_NO_0X_HDR_FUTURE
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
 #  define BOOST_NO_0X_HDR_TYPEINDEX
+#endif
+//  C++0x headers not yet (fully!) implemented
+//
+#  define BOOST_NO_0X_HDR_THREAD
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+#  define BOOST_NO_0X_HDR_CODECVT
 
 //  --- end ---
index 147060d9f7e313aa499d1a0b7fc4e3fcd0167d51..626e712b5d2b9be6c8152f0a8ca9a6b20736a44f 100644 (file)
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index 8185e351ea0c90a8a6950d65e7a1d06375129179..adb3d4787db19823aea6979481363e45a3f9e6c5 100644 (file)
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index b43623b58bb0f11303597dcffaf41cdf17a2339d..95ac36c6b832a75f6387e01725becc03b9a45728 100644 (file)
 #  endif
 #endif
 
-//  C++0x headers not yet implemented
-//
 #if _RWSTD_VER < 0x05000000
 #  define BOOST_NO_0X_HDR_ARRAY
-#  define BOOST_NO_0X_HDR_TYPE_TRAITS
 #endif
+// type_traits header is incomplete:
+#  define BOOST_NO_0X_HDR_TYPE_TRAITS
+//
+//  C++0x headers not yet implemented
+//
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index 5731fe5eb62de28e44c0752636235230bd405925..c8d77d55d4d41896cc2d12f6a8066d11a69a11e4 100644 (file)
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index 85176a4d92124bf7015c1a2deb1bc5d78a9930a5..d3069992210782e8e6d580ebdfd38113b021271a 100644 (file)
@@ -215,14 +215,10 @@ namespace boost { using std::min; using std::max; }
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index 3fcf6e05bc5750cfa96c5f1e8318f01387a02812..32a1fc08b707f0f4b9f42ae7cc0f7b5c48b8c042 100644 (file)
 #  define BOOST_NO_0X_HDR_ARRAY
 #  define BOOST_NO_0X_HDR_CHRONO
 #  define BOOST_NO_0X_HDR_CODECVT
-#  define BOOST_NO_0X_HDR_CONCEPTS
 #  define BOOST_NO_0X_HDR_CONDITION_VARIABLE
-#  define BOOST_NO_0X_HDR_CONTAINER_CONCEPTS
 #  define BOOST_NO_0X_HDR_FORWARD_LIST
 #  define BOOST_NO_0X_HDR_FUTURE
 #  define BOOST_NO_0X_HDR_INITIALIZER_LIST
-#  define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
-#  define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
 #  define BOOST_NO_0X_HDR_MUTEX
 #  define BOOST_NO_0X_HDR_RANDOM
 #  define BOOST_NO_0X_HDR_RATIO
index 9cce6fd73657847e4e8bf29ba7a8aeb26719256f..30622872bc379696177be7c99cfc320a3b343005 100644 (file)
 #if defined(BOOST_NO_0X_HDR_INITIALIZER_LIST) && !defined(BOOST_NO_INITIALIZER_LISTS)
 #  define BOOST_NO_INITIALIZER_LISTS
 #endif
+#if defined(BOOST_NO_INITIALIZER_LISTS) && !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+#  define BOOST_NO_0X_HDR_INITIALIZER_LIST
+#endif
 
 //
 // Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
 //  works as expected with standard conforming compilers.  The resulting
 //  double inclusion of <cstddef> is harmless.
 
-# ifdef BOOST_NO_STDC_NAMESPACE
+# if defined(BOOST_NO_STDC_NAMESPACE) && defined(__cplusplus)
 #   include <cstddef>
     namespace std { using ::ptrdiff_t; using ::size_t; }
 # endif
 
 //  BOOST_NO_STD_MIN_MAX workaround  -----------------------------------------//
 
-#  ifdef BOOST_NO_STD_MIN_MAX
+#  if defined(BOOST_NO_STD_MIN_MAX) && defined(__cplusplus)
 
 namespace std {
   template <class _Tp>
@@ -506,7 +509,7 @@ namespace std {
 // but it's use may generate either warnings (with -ansi), or errors
 // (with -pedantic -ansi) unless it's use is prefixed by __extension__
 //
-#if defined(BOOST_HAS_LONG_LONG)
+#if defined(BOOST_HAS_LONG_LONG) && defined(__cplusplus)
 namespace boost{
 #  ifdef __GNUC__
    __extension__ typedef long long long_long_type;
@@ -560,7 +563,7 @@ namespace boost{
 //
 
 
-#if defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
+#if defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS) && defined(__cplusplus)
 
 #  include "boost/type.hpp"
 #  include "boost/non_type.hpp"
@@ -598,7 +601,7 @@ namespace boost{
 
 // When BOOST_NO_STD_TYPEINFO is defined, we can just import
 // the global definition into std namespace:
-#ifdef BOOST_NO_STD_TYPEINFO
+#if defined(BOOST_NO_STD_TYPEINFO) && defined(__cplusplus)
 #include <typeinfo>
 namespace std{ using ::type_info; }
 #endif
index 26ff1323c0379541707c737ad4d1f5e9077f3dc8..fea8e829f149b22c282f4362e6310b965afc18ff 100644 (file)
@@ -23,7 +23,7 @@
 //  Note that THIS HEADER MUST NOT INCLUDE ANY OTHER HEADERS:
 //  not even std library ones!  Doing so may turn the warning
 //  off too late to be of any use.  For example the VC++ C4996
-//  warning can be omitted from <iosfwd> if that header is included
+//  warning can be emitted from <iosfwd> if that header is included
 //  before or by this one :-(
 //
 
index 9a2125230f270444d4db8d38d5a6e3378fc1f6a9..1a58935a7eeb962596ffa5783a3e7eb538899b01 100644 (file)
@@ -18,7 +18,8 @@
         && (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(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) \
+    || (defined(_LIBCPP_VERSION))
 
 #include <deque>
 #include <list>
index fccebc3f707cdec7688303f17f9e3bb22d31e641..5889ccb92824b47c3928a2259e92d8fd6e30f8d6 100644 (file)
@@ -106,17 +106,29 @@ extern "C" void* __cdecl _InterlockedExchangePointer( void* volatile *, void* );
 
 #elif defined( WIN32 ) || defined( _WIN32 ) || defined( __WIN32__ ) || defined( __CYGWIN__ )
 
+#if defined(__MINGW64__)
+#define BOOST_INTERLOCKED_IMPORT
+#else
+#define BOOST_INTERLOCKED_IMPORT __declspec(dllimport)
+#endif
+
+
 namespace boost
 {
 
 namespace detail
 {
 
-extern "C" __declspec(dllimport) long __stdcall InterlockedIncrement( long volatile * );
-extern "C" __declspec(dllimport) long __stdcall InterlockedDecrement( long volatile * );
-extern "C" __declspec(dllimport) long __stdcall InterlockedCompareExchange( long volatile *, long, long );
-extern "C" __declspec(dllimport) long __stdcall InterlockedExchange( long volatile *, long );
-extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long volatile *, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedIncrement( long volatile * );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedDecrement( long volatile * );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedCompareExchange( long volatile *, long, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchange( long volatile *, long );
+extern "C"BOOST_INTERLOCKED_IMPORT long __stdcall InterlockedExchangeAdd( long volatile *, long );
+
+# if defined(_M_IA64) || defined(_M_AMD64)
+extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedCompareExchangePointer( void* volatile *, void*, void* );
+extern "C"BOOST_INTERLOCKED_IMPORT void* __stdcall InterlockedExchangePointer( void* volatile *, void* );
+# endif
 
 } // namespace detail
 
@@ -128,10 +140,15 @@ extern "C" __declspec(dllimport) long __stdcall InterlockedExchangeAdd( long vol
 # define BOOST_INTERLOCKED_EXCHANGE ::boost::detail::InterlockedExchange
 # define BOOST_INTERLOCKED_EXCHANGE_ADD ::boost::detail::InterlockedExchangeAdd
 
-# define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
+# if defined(_M_IA64) || defined(_M_AMD64)
+#  define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER ::boost::detail::InterlockedCompareExchangePointer
+#  define BOOST_INTERLOCKED_EXCHANGE_POINTER ::boost::detail::InterlockedExchangePointer
+# else
+#  define BOOST_INTERLOCKED_COMPARE_EXCHANGE_POINTER(dest,exchange,compare) \
     ((void*)BOOST_INTERLOCKED_COMPARE_EXCHANGE((long volatile*)(dest),(long)(exchange),(long)(compare)))
-# define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
+#  define BOOST_INTERLOCKED_EXCHANGE_POINTER(dest,exchange) \
     ((void*)BOOST_INTERLOCKED_EXCHANGE((long volatile*)(dest),(long)(exchange)))
+# endif
 
 #else
 
index 8add322630a591fbe72109ffe8032a7adbfc9efa..dbd99b97e9af8fa6a20ada9b9aae131934a99b90 100755 (executable)
@@ -11,6 +11,7 @@
 //  boost/detail/lightweight_test.hpp - lightweight test library
 //
 //  Copyright (c) 2002, 2009 Peter Dimov
+//  Copyright (2) Beman Dawes 2010, 2011
 //
 //  Distributed under the Boost Software License, Version 1.0.
 //  See accompanying file LICENSE_1_0.txt or copy at
 //  int boost::report_errors()
 //
 
+#include <iostream>
 #include <boost/current_function.hpp>
 #include <boost/assert.hpp>
-#include <iostream>
+
+//  IDE's like Visual Studio perform better if output goes to std::cout or
+//  some other stream, so allow user to configure output stream:
+#ifndef BOOST_LIGHTWEIGHT_TEST_OSTREAM
+# define BOOST_LIGHTWEIGHT_TEST_OSTREAM std::cerr
+#endif
 
 namespace boost
 {
@@ -58,30 +65,52 @@ inline int & test_errors()
 
 inline void test_failed_impl(char const * expr, char const * file, int line, char const * function)
 {
-    std::cerr << file << "(" << line << "): test '" << expr << "' failed in function '" << function << "'" << std::endl;
+    BOOST_LIGHTWEIGHT_TEST_OSTREAM
+      << file << "(" << line << "): test '" << expr << "' failed in function '"
+      << function << "'" << std::endl;
     ++test_errors();
 }
 
 inline void error_impl(char const * msg, char const * file, int line, char const * function)
 {
-    std::cerr << file << "(" << line << "): " << msg << " in function '" << function << "'" << std::endl;
+    BOOST_LIGHTWEIGHT_TEST_OSTREAM
+      << file << "(" << line << "): " << msg << " in function '"
+      << function << "'" << std::endl;
     ++test_errors();
 }
 
-template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2, char const * file, int line, char const * function, T const & t, U const & u )
+template<class T, class U> inline void test_eq_impl( char const * expr1, char const * expr2,
+  char const * file, int line, char const * function, T const & t, U const & u )
 {
     if( t == u )
     {
     }
     else
     {
-        std::cerr << file << "(" << line << "): test '" << expr1 << " == " << expr2
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+            << file << "(" << line << "): test '" << expr1 << " == " << expr2
             << "' failed in function '" << function << "': "
             << "'" << t << "' != '" << u << "'" << std::endl;
         ++test_errors();
     }
 }
 
+template<class T, class U> inline void test_ne_impl( char const * expr1, char const * expr2,
+  char const * file, int line, char const * function, T const & t, U const & u )
+{
+    if( t != u )
+    {
+    }
+    else
+    {
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+            << file << "(" << line << "): test '" << expr1 << " != " << expr2
+            << "' failed in function '" << function << "': "
+            << "'" << t << "' == '" << u << "'" << std::endl;
+        ++test_errors();
+    }
+}
+
 } // namespace detail
 
 inline int report_errors()
@@ -92,12 +121,14 @@ inline int report_errors()
 
     if( errors == 0 )
     {
-        std::cerr << "No errors detected." << std::endl;
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+          << "No errors detected." << std::endl;
         return 0;
     }
     else
     {
-        std::cerr << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
+        BOOST_LIGHTWEIGHT_TEST_OSTREAM
+          << errors << " error" << (errors == 1? "": "s") << " detected." << std::endl;
         return 1;
     }
 }
@@ -107,5 +138,6 @@ inline int report_errors()
 #define BOOST_TEST(expr) ((expr)? (void)0: ::boost::detail::test_failed_impl(#expr, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION))
 #define BOOST_ERROR(msg) ::boost::detail::error_impl(msg, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION)
 #define BOOST_TEST_EQ(expr1,expr2) ( ::boost::detail::test_eq_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
+#define BOOST_TEST_NE(expr1,expr2) ( ::boost::detail::test_ne_impl(#expr1, #expr2, __FILE__, __LINE__, BOOST_CURRENT_FUNCTION, expr1, expr2) )
 
 #endif // #ifndef BOOST_DETAIL_LIGHTWEIGHT_TEST_HPP_INCLUDED
index 0510fe2dfd6854fe73aa6aca891bb1ec7b7cf5b7..b6ccf7e18c52ac5b0e02d6ae3cdb26dac05f0cf1 100644 (file)
 #include <boost/exception/info.hpp>
 #include <boost/exception/diagnostic_information.hpp>
 #include <boost/exception/detail/type_info.hpp>
+#include <boost/exception/detail/clone_current_exception.hpp>
 #include <boost/shared_ptr.hpp>
 #include <stdexcept>
 #include <new>
 #include <ios>
+#include <cstdlib>
 
 namespace
 boost
     {
-    typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
-
+    class exception_ptr;
+    BOOST_ATTRIBUTE_NORETURN void rethrow_exception( exception_ptr const & );
     exception_ptr current_exception();
 
+    class
+    exception_ptr
+        {
+        typedef boost::shared_ptr<exception_detail::clone_base const> impl;
+        impl ptr_;
+        friend void rethrow_exception( exception_ptr const & );
+        typedef exception_detail::clone_base const * (impl::*unspecified_bool_type)() const;
+        public:
+        exception_ptr()
+            {
+            }
+        explicit
+        exception_ptr( impl const & ptr ):
+            ptr_(ptr)
+            {
+            }
+        bool
+        operator==( exception_ptr const & other ) const
+            {
+            return ptr_==other.ptr_;
+            }
+        bool
+        operator!=( exception_ptr const & other ) const
+            {
+            return ptr_!=other.ptr_;
+            }
+        operator unspecified_bool_type() const
+            {
+            return ptr_?&impl::get:0;
+            }
+        };
+
     template <class T>
     inline
     exception_ptr
@@ -67,35 +101,49 @@ boost
             boost::exception,
             std::bad_alloc
                 {
+                ~bad_alloc_() throw() { }
                 };
 
-        template <int Dummy>
+        struct
+        bad_exception_:
+            boost::exception,
+            std::bad_exception
+                {
+                ~bad_exception_() throw() { }
+                };
+
+        template <class Exception>
         exception_ptr
-        get_bad_alloc()
+        get_static_exception_object()
             {
-            bad_alloc_ ba;
-            exception_detail::clone_impl<bad_alloc_> c(ba);
+            Exception ba;
+            exception_detail::clone_impl<Exception> c(ba);
             c <<
                 throw_function(BOOST_CURRENT_FUNCTION) <<
                 throw_file(__FILE__) <<
                 throw_line(__LINE__);
-            static exception_ptr ep(new exception_detail::clone_impl<bad_alloc_>(c));
+            static exception_ptr ep(shared_ptr<exception_detail::clone_base const>(new exception_detail::clone_impl<Exception>(c)));
             return ep;
             }
 
-        template <int Dummy>
+        template <class Exception>
         struct
-        exception_ptr_bad_alloc
+        exception_ptr_static_exception_object
             {
             static exception_ptr const e;
             };
 
-        template <int Dummy>
+        template <class Exception>
         exception_ptr const
-        exception_ptr_bad_alloc<Dummy>::
-        e = get_bad_alloc<Dummy>();
+        exception_ptr_static_exception_object<Exception>::
+        e = get_static_exception_object<Exception>();
         }
 
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
     class
     unknown_exception:
         public boost::exception,
@@ -135,6 +183,11 @@ boost
 #endif
             }
         };
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
 
     namespace
     exception_detail
@@ -244,101 +297,131 @@ boost
         exception_ptr
         current_exception_impl()
             {
-            try
-                {
-                throw;
-                }
-            catch(
-            exception_detail::clone_base & e )
-                {
-                return exception_ptr(e.clone());
-                }
-            catch(
-            std::domain_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::invalid_argument & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::length_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::out_of_range & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::logic_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::range_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::overflow_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::underflow_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::ios_base::failure & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::runtime_error & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::bad_alloc & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
+            exception_detail::clone_base const * e=0;
+            switch(
+            exception_detail::clone_current_exception(e) )
+                {
+                case exception_detail::clone_current_exception_result::
+                success:
+                    {
+                    BOOST_ASSERT(e!=0);
+                    return exception_ptr(shared_ptr<exception_detail::clone_base const>(e));
+                    }
+                case exception_detail::clone_current_exception_result::
+                bad_alloc:
+                    {
+                    BOOST_ASSERT(!e);
+                    return exception_detail::exception_ptr_static_exception_object<bad_alloc_>::e;
+                    }
+                case exception_detail::clone_current_exception_result::
+                bad_exception:
+                    {
+                    BOOST_ASSERT(!e);
+                    return exception_detail::exception_ptr_static_exception_object<bad_exception_>::e;
+                    }
+                default:
+                    BOOST_ASSERT(0);
+                case exception_detail::clone_current_exception_result::
+                not_supported:
+                    {
+                    BOOST_ASSERT(!e);
+                    try
+                        {
+                        throw;
+                        }
+                    catch(
+                    exception_detail::clone_base & e )
+                        {
+                        return exception_ptr(shared_ptr<exception_detail::clone_base const>(e.clone()));
+                        }
+                    catch(
+                    std::domain_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::invalid_argument & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::length_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::out_of_range & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::logic_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::range_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::overflow_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::underflow_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::ios_base::failure & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::runtime_error & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::bad_alloc & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
 #ifndef BOOST_NO_TYPEID
-            catch(
-            std::bad_cast & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::bad_typeid & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
+                    catch(
+                    std::bad_cast & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::bad_typeid & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
 #endif
-            catch(
-            std::bad_exception & e )
-                {
-                return exception_detail::current_exception_std_exception(e);
-                }
-            catch(
-            std::exception & e )
-                {
-                return exception_detail::current_exception_unknown_std_exception(e);
-                }
-            catch(
-            boost::exception & e )
-                {
-                return exception_detail::current_exception_unknown_boost_exception(e);
-                }
-            catch(
-            ... )
-                {
-                return exception_detail::current_exception_unknown_exception();
+                    catch(
+                    std::bad_exception & e )
+                        {
+                        return exception_detail::current_exception_std_exception(e);
+                        }
+                    catch(
+                    std::exception & e )
+                        {
+                        return exception_detail::current_exception_unknown_std_exception(e);
+                        }
+                    catch(
+                    boost::exception & e )
+                        {
+                        return exception_detail::current_exception_unknown_boost_exception(e);
+                        }
+                    catch(
+                    ... )
+                        {
+                        return exception_detail::current_exception_unknown_exception();
+                        }
+                    }
                 }
             }
         }
@@ -348,7 +431,6 @@ boost
     current_exception()
         {
         exception_ptr ret;
-        BOOST_ASSERT(!ret);
         try
             {
             ret=exception_detail::current_exception_impl();
@@ -356,36 +438,26 @@ boost
         catch(
         std::bad_alloc & )
             {
-            ret=exception_detail::exception_ptr_bad_alloc<42>::e;
+            ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_alloc_>::e;
             }
         catch(
         ... )
             {
-            try
-                {
-                ret=exception_detail::current_exception_std_exception(std::bad_exception());
-                }
-            catch(
-            std::bad_alloc & )
-                {
-                ret=exception_detail::exception_ptr_bad_alloc<42>::e;
-                }
-            catch(
-            ... )
-                {
-                BOOST_ASSERT(0);
-                }
+            ret=exception_detail::exception_ptr_static_exception_object<exception_detail::bad_exception_>::e;
             }
         BOOST_ASSERT(ret);
         return ret;
         }
 
+    BOOST_ATTRIBUTE_NORETURN
     inline
     void
     rethrow_exception( exception_ptr const & p )
         {
         BOOST_ASSERT(p);
-        p->rethrow();
+        p.ptr_->rethrow();
+        BOOST_ASSERT(0);
+        std::abort();
         }
 
     inline
index 9ab1c57f539585421741f906aa6529d5d52b8423..92f846468c9f35369fde787ec88a2ee9fc52c534 100644 (file)
@@ -53,11 +53,11 @@ boost
         struct
         type_info_
             {
-            detail::sp_typeinfo const & type_;
+            detail::sp_typeinfo const * type_;
 
             explicit
             type_info_( detail::sp_typeinfo const & type ):
-                type_(type)
+                type_(&type)
                 {
                 }
 
@@ -65,7 +65,7 @@ boost
             bool
             operator<( type_info_ const & a, type_info_ const & b )
                 {
-                return 0!=(a.type_.before(b.type_));
+                return 0!=(a.type_->before(*b.type_));
                 }
             };
         }
index 229767636d43d4035daeeb7167baf5e650d62b3a..ef89d731442f0585be008ade959680f0633f4d2d 100755 (executable)
@@ -14,6 +14,7 @@
 
 #include <boost/config.hpp>
 #include <boost/exception/get_error_info.hpp>
+#include <boost/exception/info.hpp>
 #include <boost/utility/enable_if.hpp>
 #ifndef BOOST_NO_RTTI
 #include <boost/units/detail/utility.hpp>
@@ -85,19 +86,23 @@ boost
         char const *
         get_diagnostic_information( exception const & x, char const * header )
             {
-            if( error_info_container * c=x.data_.get() )
 #ifndef BOOST_NO_EXCEPTIONS
-                try
-                    {
+            try
+                {
 #endif
-                    return c->diagnostic_information(header);
+                error_info_container * c=x.data_.get();
+                if( !c )
+                    x.data_.adopt(c=new exception_detail::error_info_container_impl);
+                char const * di=c->diagnostic_information(header);
+                BOOST_ASSERT(di!=0);
+                return di;
 #ifndef BOOST_NO_EXCEPTIONS
-                    }
-                catch(...)
-                    {
-                    }
+                }
+            catch(...)
+                {
+                return 0;
+                }
 #endif
-            return 0;
             }
 
         inline
@@ -122,22 +127,30 @@ boost
             std::ostringstream tmp;
             if( be )
                 {
-                if( char const * const * f=get_error_info<throw_file>(*be) )
+                char const * const * f=get_error_info<throw_file>(*be);
+                int const * l=get_error_info<throw_line>(*be);
+                char const * const * fn=get_error_info<throw_function>(*be);
+                if( !f && !l && !fn )
+                    tmp << "Throw location unknown (consider using BOOST_THROW_EXCEPTION)\n";
+                else
                     {
-                    tmp << *f;
-                    if( int const * l=get_error_info<throw_line>(*be) )
-                        tmp << '(' << *l << "): ";
+                    if( f )
+                        {
+                        tmp << *f;
+                        if( int const * l=get_error_info<throw_line>(*be) )
+                            tmp << '(' << *l << "): ";
+                        }
+                    tmp << "Throw in function ";
+                    if( char const * const * fn=get_error_info<throw_function>(*be) )
+                        tmp << *fn;
+                    else
+                        tmp << "(unknown)";
+                    tmp << '\n';
                     }
-                tmp << "Throw in function ";
-                if( char const * const * fn=get_error_info<throw_function>(*be) )
-                    tmp << *fn;
-                else
-                    tmp << "(unknown)";
-                tmp << '\n';
                 }
 #ifndef BOOST_NO_RTTI
             tmp << std::string("Dynamic exception type: ") <<
-                units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_.name()) << '\n';
+                units::detail::demangle((be?(BOOST_EXCEPTION_DYNAMIC_TYPEID(*be)):(BOOST_EXCEPTION_DYNAMIC_TYPEID(*se))).type_->name()) << '\n';
 #endif
             if( with_what && se )
                 tmp << "std::exception::what: " << wh << '\n';
@@ -166,7 +179,10 @@ boost
             {
 #endif
             (void) exception_detail::diagnostic_information_impl(&e,0,false);
-            return exception_detail::get_diagnostic_information(e,0);
+            if( char const * di=exception_detail::get_diagnostic_information(e,0) )
+                return di;
+            else
+                return "Failed to produce boost::diagnostic_information_what()";
 #ifndef BOOST_NO_EXCEPTIONS
             }
         catch(
index e4e75d9eefd407bd5e98c868fc8371c43b895130..c3299d1475ff76dc0916259361190ff00d386796 100644 (file)
@@ -9,10 +9,9 @@
 namespace
 boost
     {
-    namespace exception_detail { class clone_base; };
+    namespace exception_detail { class clone_base; }
     template <class Tag,class T> class error_info;
-    template <class T> class shared_ptr;
-    typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
+    class exception_ptr;
     typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception;
     }
 
index adaac687bb627a73db4ee99b66915f1932b44192..9cdfd5c6e8cd6e6ecdb0d3d5b049cb2311f131a8 100755 (executable)
@@ -132,7 +132,17 @@ boost
             }
         };
 
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
     class exception;
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
 
     template <class T>
     class shared_ptr;
@@ -189,6 +199,11 @@ boost
         E const & set_info( E const &, throw_line const & );
         }
 
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility push (default)
+# endif
+#endif
     class
     exception
         {
@@ -250,6 +265,11 @@ boost
         mutable char const * throw_file_;
         mutable int throw_line_;
         };
+#if defined(__GNUC__)
+# if (__GNUC__ == 4 && __GNUC_MINOR__ >= 1) || (__GNUC__ > 4)
+#  pragma GCC visibility pop
+# endif
+#endif
 
     inline
     exception::
@@ -334,7 +354,7 @@ boost
         struct
         enable_error_info_return_type
             {
-            typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception((T*)0))>::type type;
+            typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception(static_cast<T *>(0)))>::type type;
             };
         }
 
index c918dbd34139838b884be485acd68f7ab3251f82..5530746223e54eef8c6a101b5492861051cad91b 100755 (executable)
@@ -109,7 +109,6 @@ boost
                 {
                 if( header )
                     {
-                    BOOST_ASSERT(*header!=0);
                     std::ostringstream tmp;
                     tmp << header;
                     for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
index bdb27691dfb92e1e7396c7109b67c187a047ed1f..b72842bb3b65120b4ceccb3bd51d1c65bbb8293f 100644 (file)
@@ -23,8 +23,8 @@
 // in anything that may be included by function_template.hpp doesn't break
 #include <boost/function/detail/prologue.hpp>
 
-// Visual Age C++ doesn't handle the file iteration well
-#if BOOST_WORKAROUND(__IBMCPP__, >= 500)
+// Older Visual Age C++ version do not handle the file iteration well
+#if BOOST_WORKAROUND(__IBMCPP__, >= 500) && BOOST_WORKAROUND(__IBMCPP__, < 800)
 #  if BOOST_FUNCTION_MAX_ARGS >= 0
 #    include <boost/function/function0.hpp>
 #  endif
index fe9bbbe3591a27f7f96e2a5198393b4cc714109e..78b7dd1e998fc2b07b22e53e087ce0e8e673bdb3 100644 (file)
@@ -203,11 +203,11 @@ namespace boost {
         {
           switch (op) {
           case clone_functor_tag: 
-            out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
+            out_buffer.obj_ref = in_buffer.obj_ref;
             return;
 
           case move_functor_tag:
-            out_buffer.obj_ref.obj_ptr = in_buffer.obj_ref.obj_ptr;
+            out_buffer.obj_ref = in_buffer.obj_ref;
             in_buffer.obj_ref.obj_ptr = 0;
             return;
 
@@ -315,14 +315,18 @@ namespace boost {
           if (op == clone_functor_tag || op == move_functor_tag) {
             const functor_type* in_functor = 
               reinterpret_cast<const functor_type*>(&in_buffer.data);
-            new ((void*)&out_buffer.data) functor_type(*in_functor);
+            new (reinterpret_cast<void*>(&out_buffer.data)) functor_type(*in_functor);
 
             if (op == move_functor_tag) {
-              reinterpret_cast<functor_type*>(&in_buffer.data)->~Functor();
+              functor_type* f = reinterpret_cast<functor_type*>(&in_buffer.data);
+              (void)f; // suppress warning about the value of f not being used (MSVC)
+              f->~Functor();
             }
           } else if (op == destroy_functor_tag) {
             // Some compilers (Borland, vc6, ...) are unhappy with ~functor_type.
-            reinterpret_cast<functor_type*>(&out_buffer.data)->~Functor();
+             functor_type* f = reinterpret_cast<functor_type*>(&out_buffer.data);
+             (void)f; // suppress warning about the value of f not being used (MSVC)
+             f->~Functor();
           } else if (op == check_functor_type_tag) {
             const detail::sp_typeinfo& check_type 
               = *out_buffer.type.type;
@@ -369,8 +373,10 @@ namespace boost {
             // Clone the functor
             // GCC 2.95.3 gets the CV qualifiers wrong here, so we
             // can't do the static_cast that we should do.
+            // jewillco: Changing this to static_cast because GCC 2.95.3 is
+            // obsolete.
             const functor_type* f =
-              (const functor_type*)(in_buffer.obj_ptr);
+              static_cast<const functor_type*>(in_buffer.obj_ptr);
             functor_type* new_f = new functor_type(*f);
             out_buffer.obj_ptr = new_f;
           } else if (op == move_functor_tag) {
@@ -474,7 +480,7 @@ namespace boost {
             // GCC 2.95.3 gets the CV qualifiers wrong here, so we
             // can't do the static_cast that we should do.
             const functor_wrapper_type* f =
-              (const functor_wrapper_type*)(in_buffer.obj_ptr);
+              static_cast<const functor_wrapper_type*>(in_buffer.obj_ptr);
             wrapper_allocator_type wrapper_allocator(static_cast<Allocator const &>(*f));
             wrapper_allocator_pointer_type copy = wrapper_allocator.allocate(1);
             wrapper_allocator.construct(copy, *f);
@@ -671,7 +677,7 @@ public:
                       detail::function::check_functor_type_tag);
       // GCC 2.95.3 gets the CV qualifiers wrong here, so we
       // can't do the static_cast that we should do.
-      return (const Functor*)(type_result.obj_ptr);
+      return static_cast<const Functor*>(type_result.obj_ptr);
     }
 
   template<typename F>
@@ -715,7 +721,7 @@ public:
 public: // should be protected, but GCC 2.95.3 will fail to allow access
   detail::function::vtable_base* get_vtable() const {
     return reinterpret_cast<detail::function::vtable_base*>(
-             reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
+             reinterpret_cast<std::size_t>(vtable) & ~static_cast<std::size_t>(0x01));
   }
 
   bool has_trivial_copy_and_destroy() const {
index 6a99109ab12737141a0960281afa51bd952ecc5d..3514e28821fe0c49ef445353f0c01f76ab50566c 100644 (file)
@@ -486,19 +486,19 @@ namespace boost {
                                             BOOST_FUNCTION_TEMPLATE_ARGS);
 
         template<typename F>
-        bool assign_to(F f, function_buffer& functor)
+        bool assign_to(F f, function_buffer& functor) const
         {
           typedef typename get_function_tag<F>::type tag;
           return assign_to(f, functor, tag());
         }
         template<typename F,typename Allocator>
-        bool assign_to_a(F f, function_buffer& functor, Allocator a)
+        bool assign_to_a(F f, function_buffer& functor, Allocator a) const
         {
           typedef typename get_function_tag<F>::type tag;
           return assign_to_a(f, functor, a, tag());
         }
 
-        void clear(function_buffer& functor)
+        void clear(function_buffer& functor) const
         {
           if (base.manager)
             base.manager(functor, functor, destroy_functor_tag);
@@ -508,13 +508,13 @@ namespace boost {
         // Function pointers
         template<typename FunctionPtr>
         bool 
-        assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag)
+        assign_to(FunctionPtr f, function_buffer& functor, function_ptr_tag) const
         {
           this->clear(functor);
           if (f) {
             // should be a reinterpret cast, but some compilers insist
             // on giving cv-qualifiers to free functions
-            functor.func_ptr = (void (*)())(f);
+            functor.func_ptr = reinterpret_cast<void (*)()>(f);
             return true;
           } else {
             return false;
@@ -522,7 +522,7 @@ namespace boost {
         }
         template<typename FunctionPtr,typename Allocator>
         bool 
-        assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag)
+        assign_to_a(FunctionPtr f, function_buffer& functor, Allocator, function_ptr_tag) const
         {
           return assign_to(f,functor,function_ptr_tag());
         }
@@ -530,26 +530,26 @@ namespace boost {
         // Member pointers
 #if BOOST_FUNCTION_NUM_ARGS > 0
         template<typename MemberPtr>
-        bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag)
+        bool assign_to(MemberPtr f, function_buffer& functor, member_ptr_tag) const
         {
           // DPG TBD: Add explicit support for member function
           // objects, so we invoke through mem_fn() but we retain the
           // right target_type() values.
           if (f) {
-            this->assign_to(mem_fn(f), functor);
+            this->assign_to(boost::mem_fn(f), functor);
             return true;
           } else {
             return false;
           }
         }
         template<typename MemberPtr,typename Allocator>
-        bool assign_to_a(MemberPtr f, function_buffer& functor, Allocator a, member_ptr_tag)
+        bool assign_to_a(MemberPtr f, function_buffer& functor, Allocator a, member_ptr_tag) const
         {
           // DPG TBD: Add explicit support for member function
           // objects, so we invoke through mem_fn() but we retain the
           // right target_type() values.
           if (f) {
-            this->assign_to_a(mem_fn(f), functor, a);
+            this->assign_to_a(boost::mem_fn(f), functor, a);
             return true;
           } else {
             return false;
@@ -561,13 +561,13 @@ namespace boost {
         // Assign to a function object using the small object optimization
         template<typename FunctionObj>
         void 
-        assign_functor(FunctionObj f, function_buffer& functor, mpl::true_)
+        assign_functor(FunctionObj f, function_buffer& functor, mpl::true_) const
         {
-          new ((void*)&functor.data) FunctionObj(f);
+          new (reinterpret_cast<void*>(&functor.data)) FunctionObj(f);
         }
         template<typename FunctionObj,typename Allocator>
         void 
-        assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_)
+        assign_functor_a(FunctionObj f, function_buffer& functor, Allocator, mpl::true_) const
         {
           assign_functor(f,functor,mpl::true_());
         }
@@ -575,13 +575,13 @@ namespace boost {
         // Assign to a function object allocated on the heap.
         template<typename FunctionObj>
         void 
-        assign_functor(FunctionObj f, function_buffer& functor, mpl::false_)
+        assign_functor(FunctionObj f, function_buffer& functor, mpl::false_) const
         {
           functor.obj_ptr = new FunctionObj(f);
         }
         template<typename FunctionObj,typename Allocator>
         void 
-        assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_)
+        assign_functor_a(FunctionObj f, function_buffer& functor, Allocator a, mpl::false_) const
         {
           typedef functor_wrapper<FunctionObj,Allocator> functor_wrapper_type;
           typedef typename Allocator::template rebind<functor_wrapper_type>::other
@@ -596,7 +596,7 @@ namespace boost {
 
         template<typename FunctionObj>
         bool 
-        assign_to(FunctionObj f, function_buffer& functor, function_obj_tag)
+        assign_to(FunctionObj f, function_buffer& functor, function_obj_tag) const
         {
           if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
             assign_functor(f, functor, 
@@ -608,7 +608,7 @@ namespace boost {
         }
         template<typename FunctionObj,typename Allocator>
         bool 
-        assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag)
+        assign_to_a(FunctionObj f, function_buffer& functor, Allocator a, function_obj_tag) const
         {
           if (!boost::detail::function::has_empty_target(boost::addressof(f))) {
             assign_functor_a(f, functor, a,
@@ -623,9 +623,9 @@ namespace boost {
         template<typename FunctionObj>
         bool 
         assign_to(const reference_wrapper<FunctionObj>& f, 
-                  function_buffer& functor, function_obj_ref_tag)
+                  function_buffer& functor, function_obj_ref_tag) const
         {
-          functor.obj_ref.obj_ptr = (void *)f.get_pointer();
+          functor.obj_ref.obj_ptr = (void *)(f.get_pointer());
           functor.obj_ref.is_const_qualified = is_const<FunctionObj>::value;
           functor.obj_ref.is_volatile_qualified = is_volatile<FunctionObj>::value;
           return true;
@@ -633,7 +633,7 @@ namespace boost {
         template<typename FunctionObj,typename Allocator>
         bool 
         assign_to_a(const reference_wrapper<FunctionObj>& f, 
-                  function_buffer& functor, Allocator, function_obj_ref_tag)
+                  function_buffer& functor, Allocator, function_obj_ref_tag) const
         {
           return assign_to(f,functor,function_obj_ref_tag());
         }
@@ -677,7 +677,7 @@ namespace boost {
 
     vtable_type* get_vtable() const {
       return reinterpret_cast<vtable_type*>(
-               reinterpret_cast<std::size_t>(vtable) & ~(std::size_t)0x01);
+               reinterpret_cast<std::size_t>(vtable) & ~static_cast<size_t>(0x01));
     }
 
     struct clear_type {};
@@ -751,9 +751,6 @@ namespace boost {
 
     ~BOOST_FUNCTION_FUNCTION() { clear(); }
 
-#if BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-    // MSVC 6.0 and prior require all definitions to be inline, but
-    // these definitions can become very costly.
     result_type operator()(BOOST_FUNCTION_PARMS) const
     {
       if (this->empty())
@@ -762,9 +759,6 @@ namespace boost {
       return get_vtable()->invoker
                (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
     }
-#else
-    result_type operator()(BOOST_FUNCTION_PARMS) const;
-#endif
 
     // The distinction between when to use BOOST_FUNCTION_FUNCTION and
     // when to use self_type is obnoxious. MSVC cannot handle self_type as
@@ -909,7 +903,7 @@ namespace boost {
       // static initialization. Otherwise, we will have a race
       // condition here in multi-threaded code. See
       // http://thread.gmane.org/gmane.comp.lib.boost.devel/164902/.
-      static vtable_type stored_vtable = 
+      static const vtable_type stored_vtable = 
         { { &manager_type::manage }, &invoker_type::invoke };
 
       if (stored_vtable.assign_to(f, functor)) {
@@ -917,7 +911,7 @@ namespace boost {
         if (boost::has_trivial_copy_constructor<Functor>::value &&
             boost::has_trivial_destructor<Functor>::value &&
             detail::function::function_allows_small_object_optimization<Functor>::value)
-          value |= (std::size_t)0x01;
+          value |= static_cast<size_t>(0x01);
         vtable = reinterpret_cast<detail::function::vtable_base *>(value);
       } else 
         vtable = 0;
@@ -943,7 +937,7 @@ namespace boost {
       // static initialization. Otherwise, we will have a race
       // condition here in multi-threaded code. See
       // http://thread.gmane.org/gmane.comp.lib.boost.devel/164902/.
-      static vtable_type stored_vtable =
+      static const vtable_type stored_vtable =
         { { &manager_type::manage }, &invoker_type::invoke };
 
       if (stored_vtable.assign_to_a(f, functor, a)) { 
@@ -951,7 +945,7 @@ namespace boost {
         if (boost::has_trivial_copy_constructor<Functor>::value &&
             boost::has_trivial_destructor<Functor>::value &&
             detail::function::function_allows_small_object_optimization<Functor>::value)
-          value |= (std::size_t)0x01;
+          value |= static_cast<std::size_t>(0x01);
         vtable = reinterpret_cast<detail::function::vtable_base *>(value);
       } else 
         vtable = 0;
@@ -998,22 +992,6 @@ namespace boost {
     f1.swap(f2);
   }
 
-#if !BOOST_WORKAROUND(BOOST_MSVC, < 1300)
-  template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS>
-  typename BOOST_FUNCTION_FUNCTION<
-      R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>::result_type
-  inline 
-  BOOST_FUNCTION_FUNCTION<R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_ARGS>
-  ::operator()(BOOST_FUNCTION_PARMS) const
-  {
-    if (this->empty())
-      boost::throw_exception(bad_function_call());
-
-    return get_vtable()->invoker
-             (this->functor BOOST_FUNCTION_COMMA BOOST_FUNCTION_ARGS);
-  }
-#endif
-
 // Poison comparisons between boost::function objects of the same type.
 template<typename R BOOST_FUNCTION_COMMA BOOST_FUNCTION_TEMPLATE_PARMS>
   void operator==(const BOOST_FUNCTION_FUNCTION<
index 129ce82c65375180deea6af122dee7fa90945ec1..774d0588756ac51fcf48f5a33e626c7fc8c879ac 100644 (file)
@@ -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 58381 2009-12-14 18:14:48Z johnmaddock $
+ * $Id: integer_traits.hpp 72951 2011-07-07 04:57:37Z steven_watanabe $
  *
  * Idea by Beman Dawes, Ed Brey, Steve Cleary, and Nathan Myers
  */
@@ -227,7 +227,7 @@ class integer_traits< ::boost::ulong_long_type>
 template<>
 class integer_traits< ::boost::long_long_type>
   : public std::numeric_limits< ::boost::long_long_type>,
-    public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) - 1)), ~(1LL << (sizeof(::boost::long_long_type) - 1))>
+    public detail::integer_traits_base< ::boost::long_long_type, (1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1)), ~(1LL << (sizeof(::boost::long_long_type) * CHAR_BIT - 1))>
 { };
 
 template<>
index a43cfe138e9644f8bccdf3fb7596c2f2a845c412..6adab0e6959987d5c700e72057778ea5e3e760e9 100644 (file)
@@ -1,4 +1,4 @@
-//  interator.hpp workarounds for non-conforming standard libraries  ---------//
+//  iterator.hpp workarounds for non-conforming standard libraries  ---------//
 
 //  (C) Copyright Beman Dawes 2000. Distributed under the Boost
 //  Software License, Version 1.0. (See accompanying file
index 27b08ff018e05e3d992035f538d8d0ec61271732..9f2fbb0efef15d723abaed46d055a7a70419fc76 100644 (file)
 
 #ifdef BOOST_ITERATOR_REF_CONSTNESS_KILLS_WRITABILITY
 # include <boost/type_traits/remove_reference.hpp>
-
-# if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
-#   include <boost/type_traits/add_reference.hpp>
-# endif
-
-#else
-# include <boost/type_traits/add_reference.hpp>
 #endif
 
+#include <boost/type_traits/add_reference.hpp>
 #include <boost/iterator/detail/config_def.hpp>
 
 #include <boost/iterator/iterator_traits.hpp>
index c365fe0175fb5dd6f66cde42b13d4cc9dfd89116..86565b8365d15df1e2653feb930d13ce0eba94b6 100644 (file)
@@ -20,6 +20,8 @@
 #include <boost/type_traits/is_reference.hpp>
 #include <boost/type_traits/remove_const.hpp>
 #include <boost/type_traits/remove_reference.hpp>
+#include <boost/utility/result_of.hpp>
+
 
 #if BOOST_WORKAROUND(BOOST_MSVC, BOOST_TESTED_AT(1310))
 # include <boost/type_traits/is_base_and_derived.hpp>
@@ -35,33 +37,16 @@ namespace boost
 
   namespace detail 
   {
-
-    template <class UnaryFunc>
-    struct function_object_result
-    {
-      typedef typename UnaryFunc::result_type type;
-    };
-
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-    template <class Return, class Argument>
-    struct function_object_result<Return(*)(Argument)>
-    {
-      typedef Return type;
-    };
-#endif
-
     // Compute the iterator_adaptor instantiation to be used for transform_iterator
     template <class UnaryFunc, class Iterator, class Reference, class Value>
     struct transform_iterator_base
     {
      private:
         // By default, dereferencing the iterator yields the same as
-        // the function.  Do we need to adjust the way
-        // function_object_result is computed for the standard
-        // proposal (e.g. using Doug's result_of)?
+        // the function.
         typedef typename ia_dflt_help<
             Reference
-          , function_object_result<UnaryFunc>
+          , result_of<UnaryFunc(typename std::iterator_traits<Iterator>::reference)>
         >::type reference;
 
         // To get the default for Value: remove any reference on the
@@ -113,7 +98,7 @@ namespace boost
 #endif 
     }
 
-    template<
+    template <
         class OtherUnaryFunction
       , class OtherIterator
       , class OtherReference
index f3896ad955176aa7328000db280d9d7b0d72b70a..a46807012ae875036e668ff3f0605d32e69b8cc0 100644 (file)
@@ -357,7 +357,7 @@ namespace boost {
     {
       typedef typename tuple_impl_specific::tuple_meta_transform<
           IteratorTuple
-        , iterator_traversal<>
+        , pure_traversal_tag<iterator_traversal<> >
       >::type tuple_of_traversal_tags;
           
       typedef typename tuple_impl_specific::tuple_meta_accumulate<
index d7d90521a1a7b6a1db903b765832e14cf4bfe1c6..ddd739809368798982688d20c7191cb70010ccf8 100644 (file)
@@ -11,8 +11,8 @@
 //        enhanced with contributions from Terje Slettebo,
 //        with additional fixes and suggestions from Gennaro Prota,
 //        Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov,
-//        Alexander Nasonov and other Boosters
-// when:  November 2000, March 2003, June 2005, June 2006
+//        Alexander Nasonov, Antony Polukhin and other Boosters
+// when:  November 2000, March 2003, June 2005, June 2006, March 2011
 
 #include <climits>
 #include <cstddef>
 #include <string>
 #include <typeinfo>
 #include <exception>
+#include <cmath>
 #include <boost/config.hpp>
 #include <boost/limits.hpp>
 #include <boost/mpl/if.hpp>
 #include <boost/throw_exception.hpp>
 #include <boost/type_traits/is_pointer.hpp>
+#include <boost/type_traits/is_integral.hpp>
+#include <boost/type_traits/is_arithmetic.hpp>
+#include <boost/numeric/conversion/cast.hpp>
+#include <boost/type_traits/ice.hpp>
 #include <boost/type_traits/make_unsigned.hpp>
+#include <boost/type_traits/is_signed.hpp>
 #include <boost/call_traits.hpp>
 #include <boost/static_assert.hpp>
 #include <boost/detail/lcast_precision.hpp>
 namespace boost
 {
     // exception used to indicate runtime lexical_cast failure
-    class bad_lexical_cast : public std::bad_cast
+    class bad_lexical_cast :
+    // workaround MSVC bug with std::bad_cast when _HAS_EXCEPTIONS == 0 
+#if defined(BOOST_MSVC) && defined(_HAS_EXCEPTIONS) && !_HAS_EXCEPTIONS 
+        public std::exception 
+#else 
+        public std::bad_cast 
+#endif 
 
 #if defined(__BORLANDC__) && BOOST_WORKAROUND( __BORLANDC__, < 0x560 )
         // under bcc32 5.5.1 bad_cast doesn't derive from exception
@@ -235,13 +247,42 @@ namespace boost
             static void check_coverage() {}
         };
 
-        // No specializations for:
-        // lcast_src_length<char, signed char>
-        // lcast_src_length<char, unsigned char>
-        // lcast_src_length<char, signed char*>
-        // lcast_src_length<char, unsigned char*>
-        // lcast_src_length<char, signed char const*>
-        // lcast_src_length<char, unsigned char const*>
+        template<>
+        struct lcast_src_length<char, signed char>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
+        template<>
+        struct lcast_src_length<char, unsigned char>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
+        template<>
+        struct lcast_src_length<char, signed char*>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
+        template<>
+        struct lcast_src_length<char, unsigned char*>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
+        template<>
+        struct lcast_src_length<char, signed char const*>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
+        template<>
+        struct lcast_src_length<char, unsigned char const*>
+        {
+            BOOST_STATIC_CONSTANT(std::size_t, value = 1);
+            static void check_coverage() {}
+        };
 
 #ifndef BOOST_LCAST_NO_WCHAR_T
         template<>
@@ -451,7 +492,7 @@ namespace boost
 #endif // #ifndef BOOST_LCAST_NO_COMPILE_TIME_PRECISION
     }
 
-    namespace detail // '0' and '-' constants
+    namespace detail // '0', '+' and '-' constants
     {
         template<typename CharT> struct lcast_char_constants;
 
@@ -460,6 +501,7 @@ namespace boost
         {
             BOOST_STATIC_CONSTANT(char, zero  = '0');
             BOOST_STATIC_CONSTANT(char, minus = '-');
+            BOOST_STATIC_CONSTANT(char, plus = '+');
         };
 
 #ifndef BOOST_LCAST_NO_WCHAR_T
@@ -468,6 +510,7 @@ namespace boost
         {
             BOOST_STATIC_CONSTANT(wchar_t, zero  = L'0');
             BOOST_STATIC_CONSTANT(wchar_t, minus = L'-');
+            BOOST_STATIC_CONSTANT(wchar_t, plus = L'+');
         };
 #endif
     }
@@ -512,6 +555,10 @@ namespace boost
             BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
 #endif
 
+            typedef typename Traits::int_type int_type;
+            CharT const czero = lcast_char_constants<CharT>::zero;
+            int_type const zero = Traits::to_int_type(czero);
+
 #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
             // TODO: use BOOST_NO_STD_LOCALE
             std::locale loc;
@@ -519,50 +566,156 @@ namespace boost
             numpunct const& np = BOOST_USE_FACET(numpunct, loc);
             std::string const& grouping = np.grouping();
             std::string::size_type const grouping_size = grouping.size();
-            CharT thousands_sep = grouping_size ? np.thousands_sep() : 0;
-            std::string::size_type group = 0; // current group number
-            char last_grp_size = grouping[0] <= 0 ? CHAR_MAX : grouping[0];
-            // a) Since grouping is const, grouping[grouping.size()] returns 0.
-            // b) It's safe to assume here and below that CHAR_MAX
-            //    is equivalent to unlimited grouping:
+
+            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<T>::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;
+
+                do
+                {
+                    if(left == 0)
+                    {
+                        ++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);
+                    }
 
-            char left = last_grp_size;
+                    --left;
+
+                    --finish;
+                    int_type const digit = static_cast<int_type>(n % 10U);
+                    Traits::assign(*finish, Traits::to_char_type(zero + digit));
+                    n /= 10;
+                } while(n);
+
+            } else
 #endif
+            {
+                do
+                {
+                    --finish;
+                    int_type const digit = static_cast<int_type>(n % 10U);
+                    Traits::assign(*finish, Traits::to_char_type(zero + digit));
+                    n /= 10;
+                } while(n);
+            }
 
+            return finish;
+        }
+    }
+
+    namespace detail // lcast_ret_unsigned
+    {
+        template<class Traits, class T, class CharT>
+        inline bool lcast_ret_unsigned(T& value, const CharT* const begin, const CharT* end)
+        {
+#ifndef BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS
+            BOOST_STATIC_ASSERT(!std::numeric_limits<T>::is_signed);
+#endif
             typedef typename Traits::int_type int_type;
             CharT const czero = lcast_char_constants<CharT>::zero;
-            int_type const zero = Traits::to_int_type(czero);
+            --end;
+            value = 0;
+
+            if ( *end < czero || *end >= czero + 10 || begin > end)
+                return false;
+            value = *end - czero;
+            --end;
+            T multiplier = 1;
 
-            do
-            {
 #ifndef BOOST_LEXICAL_CAST_ASSUME_C_LOCALE
-                if(left == 0)
+            // TODO: use BOOST_NO_STD_LOCALE
+            std::locale loc;
+            typedef std::numpunct<CharT> 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)
                 {
-                    ++group;
-                    if(group < grouping_size)
-                    {
-                        char const grp_size = grouping[group];
-                        last_grp_size = grp_size <= 0 ? CHAR_MAX : grp_size;
+                    if (remained) {
+                        T const new_sub_value = multiplier * 10 * (*end - czero);
+
+                        if (*end < czero || *end >= czero + 10
+                                /* detecting overflow */
+                                || new_sub_value/10 != multiplier * (*end - czero)
+                                || static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
+                                )
+                            return false;
+
+                        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<numpunct<charT> >(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];
+                        }
                     }
-
-                    left = last_grp_size;
-                    --finish;
-                    Traits::assign(*finish, thousands_sep);
                 }
 
-                --left;
+                if (shall_we_return) return true;
+            }
 #endif
-
-                --finish;
-                int_type const digit = static_cast<int_type>(n % 10U);
-                Traits::assign(*finish, Traits::to_char_type(zero + digit));
-                n /= 10;
-            } while(n);
-
-            return finish;
+            {
+                while ( begin <= end )
+                {
+                    T const new_sub_value = multiplier * 10 * (*end - czero);
+
+                    if (*end < czero || *end >= czero + 10
+                            /* detecting overflow */
+                            || new_sub_value/10 != multiplier * (*end - czero)
+                            || static_cast<T>((std::numeric_limits<T>::max)()-new_sub_value) < value
+                            )
+                        return false;
+
+                    value += new_sub_value;
+                    multiplier *= 10;
+                    --end;
+                }
+            }
+            return true;
         }
     }
 
@@ -728,9 +881,13 @@ namespace boost
 
             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);
 #endif
+            bool operator<<(unsigned char const*);
+            bool operator<<(signed char const*);
             bool operator<<(CharT const*);
             bool operator<<(short);
             bool operator<<(int);
@@ -751,8 +908,178 @@ namespace boost
             bool operator<<(double);
             bool operator<<(long double);
 
+        private:
+
+            template <typename Type>
+            bool input_operator_helper_unsigned(Type& output)
+            {
+                CharT const minus = lcast_char_constants<CharT>::minus;
+                CharT const plus = lcast_char_constants<CharT>::plus;
+                bool has_minus = false;
+
+                /* We won`t use `start' any more, so no need in decrementing it after */
+                if ( Traits::eq(minus,*start) )
+                {
+                    ++start;
+                    has_minus = true;
+                } else if ( Traits::eq( plus, *start ) )
+                {
+                    ++start;
+                }
+
+                bool const succeed = lcast_ret_unsigned<Traits>(output, start, finish);
+#if (defined _MSC_VER)
+# pragma warning( push )
+// C4146: unary minus operator applied to unsigned type, result still unsigned
+# pragma warning( disable : 4146 )
+#elif defined( __BORLANDC__ )
+# pragma option push -w-8041
+#endif
+                if (has_minus) output = static_cast<Type>(-output);
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#elif defined( __BORLANDC__ )
+# pragma option pop
+#endif
+                return succeed;
+            }
+
+            template <typename Type>
+            bool input_operator_helper_signed(Type& output)
+            {
+                CharT const minus = lcast_char_constants<CharT>::minus;
+                CharT const plus = lcast_char_constants<CharT>::plus;
+                typedef BOOST_DEDUCED_TYPENAME make_unsigned<Type>::type utype;
+                utype out_tmp =0;
+                bool has_minus = false;
+
+                /* We won`t use `start' any more, so no need in decrementing it after */
+                if ( Traits::eq(minus,*start) )
+                {
+                    ++start;
+                    has_minus = true;
+                } else if ( Traits::eq(plus, *start) )
+                {
+                    ++start;
+                }
+
+                bool succeed = lcast_ret_unsigned<Traits>(out_tmp, start, finish);
+                if (has_minus) {
+#if (defined _MSC_VER)
+# pragma warning( push )
+// C4146: unary minus operator applied to unsigned type, result still unsigned
+# pragma warning( disable : 4146 )
+#elif defined( __BORLANDC__ )
+# pragma option push -w-8041
+#endif
+                    utype const comp_val = static_cast<utype>(-(std::numeric_limits<Type>::min)());
+                    succeed = succeed && out_tmp<=comp_val;
+                    output = -out_tmp;
+#if (defined _MSC_VER)
+# pragma warning( pop )
+#elif defined( __BORLANDC__ )
+# pragma option pop
+#endif
+                } else {
+                    utype const comp_val = static_cast<utype>((std::numeric_limits<Type>::max)());
+                    succeed = succeed && out_tmp<=comp_val;
+                    output = out_tmp;
+                }
+                return succeed;
+            }
+
         public: // input
 
+            bool operator>>(unsigned short& output)
+            {
+                return input_operator_helper_unsigned(output);
+            }
+
+            bool operator>>(unsigned int& output)
+            {
+                return input_operator_helper_unsigned(output);
+            }
+
+            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);
+            }
+
+
+#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);
+            }
+
+#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);
+            }
+
+#endif
+
+            /*
+             * case "-0" || "0" || "+0" :   output = false; return true;
+             * case "1" || "+1":            output = true;  return true;
+             * default:                     return false;
+             */
+            bool operator>>(bool& output)
+            {
+                CharT const zero = lcast_char_constants<CharT>::zero;
+                CharT const plus = lcast_char_constants<CharT>::plus;
+                CharT const minus = lcast_char_constants<CharT>::minus;
+
+                switch(finish-start)
+                {
+                    case 1:
+                        output = Traits::eq(start[0],  zero+1);
+                        return output || Traits::eq(start[0], zero );
+                    case 2:
+                        if ( Traits::eq( plus, *start) )
+                        {
+                            ++start;
+                            output = Traits::eq(start[0], zero +1);
+                            return output || Traits::eq(start[0], zero );
+                        } else
+                        {
+                            output = false;
+                            return Traits::eq( minus, *start)
+                                && Traits::eq( zero, start[1]);
+                        }
+                    default:
+                        output = false; // Suppress warning about uninitalized variable
+                        return false;
+                }
+            }
+
+
             // Generic istream-based algorithm.
             // lcast_streambuf_for_target<InputStreamable>::value is true.
             template<typename InputStreamable>
@@ -787,6 +1114,8 @@ namespace boost
             }
 
             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
@@ -828,6 +1157,34 @@ namespace boost
             return true;
         }
 
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+               unsigned char ch)
+        {
+            return ((*this) << static_cast<char>(ch));
+        }
+
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+               signed char ch)
+        {
+            return ((*this) << static_cast<char>(ch));
+        }
+
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+               unsigned char const* ch)
+        {
+            return ((*this) << reinterpret_cast<char const*>(ch));
+        }
+
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
+               signed char const* ch)
+        {
+            return ((*this) << reinterpret_cast<char const*>(ch));
+        }
+
 #if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
         template<typename CharT, class Base, class Traits>
         inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator<<(
@@ -993,6 +1350,34 @@ namespace boost
             return ok;
         }
 
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::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<signed char>(out);
+            }
+            return ok;
+        }
+
+        template<typename CharT, class Base, class Traits>
+        inline bool lexical_stream_limited_src<CharT,Base,Traits>::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<signed char>(out);
+            }
+            return ok;
+        }
+
 #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
         template<typename CharT, class Base, class Traits>
         inline bool lexical_stream_limited_src<CharT,Base,Traits>::operator>>(
@@ -1048,23 +1433,13 @@ namespace boost
         template<class Target>
         struct lcast_streambuf_for_target
         {
-            BOOST_STATIC_CONSTANT(bool, value = true);
-        };
-
-        template<>
-        struct lcast_streambuf_for_target<char>
-        {
-            BOOST_STATIC_CONSTANT(bool, value = false);
+            BOOST_STATIC_CONSTANT(bool, value =
+                (
+                 ::boost::type_traits::ice_not< is_integral<Target>::value >::value
+                )
+            );
         };
 
-#if !defined(BOOST_LCAST_NO_WCHAR_T) && !defined(BOOST_NO_INTRINSIC_WCHAR_T)
-        template<>
-        struct lcast_streambuf_for_target<wchar_t>
-        {
-            BOOST_STATIC_CONSTANT(bool, value = false);
-        };
-#endif
-
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
         template<class Traits, class Alloc>
         struct lcast_streambuf_for_target<
@@ -1120,6 +1495,7 @@ namespace boost
 # 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
@@ -1149,29 +1525,292 @@ namespace boost
 
             Target result;
             if(!(interpreter << arg && interpreter >> result))
-                BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+              BOOST_LCAST_THROW_BAD_CAST(Source, Target);
             return result;
         }
 #if (defined _MSC_VER)
 # pragma warning( pop )
 #endif
+
+        template<typename T>
+        struct is_stdstring
+        {
+            BOOST_STATIC_CONSTANT(bool, value = false );
+        };
+
+        template<typename CharT, typename Traits, typename Alloc>
+        struct is_stdstring< std::basic_string<CharT, Traits, Alloc> >
+        {
+            BOOST_STATIC_CONSTANT(bool, value = true );
+        };
+
+        template<typename T>
+        struct is_char_or_wchar
+        {
+#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
+                    )
+            );
+#else
+            BOOST_STATIC_CONSTANT(bool, value =
+                    (
+                    ::boost::type_traits::ice_or<
+                         is_same< T, char >::value,
+                         is_same< T, unsigned char >::value,
+                         is_same< T, signed char >::value
+                    >::value
+                    )
+            );
+#endif
+        };
+
+        template<typename Target, typename Source>
+        struct is_arithmetic_and_not_xchars
+        {
+            BOOST_STATIC_CONSTANT(bool, value =
+               (
+                   ::boost::type_traits::ice_and<
+                           is_arithmetic<Source>::value,
+                           is_arithmetic<Target>::value,
+                           ::boost::type_traits::ice_not<
+                                detail::is_char_or_wchar<Target>::value
+                           >::value,
+                           ::boost::type_traits::ice_not<
+                                detail::is_char_or_wchar<Source>::value
+                           >::value
+                   >::value
+               )
+            );
+        };
+
+        /*
+         * is_xchar_to_xchar<Target, Source>::value is true, when
+         * Target and Souce are the same char types, or when
+         * Target and Souce are char types of the same size.
+         */
+        template<typename Target, typename Source>
+        struct is_xchar_to_xchar
+        {
+            BOOST_STATIC_CONSTANT(bool, value =
+                (
+                    ::boost::type_traits::ice_or<
+                        ::boost::type_traits::ice_and<
+                             is_same<Source,Target>::value,
+                             is_char_or_wchar<Target>::value
+                        >::value,
+                        ::boost::type_traits::ice_and<
+                             ::boost::type_traits::ice_eq< sizeof(char),sizeof(Target)>::value,
+                             ::boost::type_traits::ice_eq< sizeof(char),sizeof(Source)>::value,
+                             is_char_or_wchar<Target>::value,
+                             is_char_or_wchar<Source>::value
+                        >::value
+                    >::value
+                )
+            );
+        };
+
+        template<typename Target, typename Source>
+        struct is_char_array_to_stdstring
+        {
+            BOOST_STATIC_CONSTANT(bool, value = false );
+        };
+
+        template<typename CharT, typename Traits, typename Alloc>
+        struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, CharT* >
+        {
+            BOOST_STATIC_CONSTANT(bool, value = true );
+        };
+
+        template<typename CharT, typename Traits, typename Alloc>
+        struct is_char_array_to_stdstring< std::basic_string<CharT, Traits, Alloc>, const CharT* >
+        {
+            BOOST_STATIC_CONSTANT(bool, value = true );
+        };
+
+        template<typename Target, typename Source>
+        struct lexical_cast_do_cast
+        {
+            static inline Target lexical_cast_impl(const Source &arg)
+            {
+                typedef typename detail::array_to_pointer_decay<Source>::type src;
+
+                typedef typename detail::widest_char<
+                typename detail::stream_char<Target>::type
+                , typename detail::stream_char<src>::type
+                >::type char_type;
+
+                typedef detail::lcast_src_length<char_type, src> 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<Target, src, !src_len>(arg, buf, src_len);
+            }
+        };
+
+        template<typename Source>
+        struct lexical_cast_copy
+        {
+            static inline Source lexical_cast_impl(const Source &arg)
+            {
+                return arg;
+            }
+        };
+
+        class precision_loss_error : public boost::numeric::bad_numeric_cast
+        {
+         public:
+            virtual const char * what() const throw()
+             {  return "bad numeric conversion: precision loss error"; }
+        };
+
+        template<class S >
+        struct throw_on_precision_loss
+        {
+         typedef boost::numeric::Trunc<S> Rounder;
+         typedef S source_type ;
+
+         typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+         static source_type nearbyint ( argument_type s )
+         {
+            source_type orig_div_round = s / Rounder::nearbyint(s);
+
+            if ( (orig_div_round > 1 ? orig_div_round - 1 : 1 - orig_div_round) > std::numeric_limits<source_type>::epsilon() )
+               BOOST_THROW_EXCEPTION( precision_loss_error() );
+            return s ;
+         }
+
+         typedef typename Rounder::round_style round_style;
+        } ;
+
+        template<typename Target, typename Source>
+        struct lexical_cast_dynamic_num_not_ignoring_minus
+        {
+            static inline Target lexical_cast_impl(const Source &arg)
+            {
+                try{
+                    typedef boost::numeric::converter<
+                            Target,
+                            Source,
+                            boost::numeric::conversion_traits<Target,Source>,
+                            boost::numeric::def_overflow_handler,
+                            throw_on_precision_loss<Source>
+                    > Converter ;
+
+                    return Converter::convert(arg);
+                } catch( ::boost::numeric::bad_numeric_cast const& ) {
+                    BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+                }
+            }
+        };
+
+        template<typename Target, typename Source>
+        struct lexical_cast_dynamic_num_ignoring_minus
+        {
+            static inline Target lexical_cast_impl(const Source &arg)
+            {
+                try{
+                    typedef boost::numeric::converter<
+                            Target,
+                            Source,
+                            boost::numeric::conversion_traits<Target,Source>,
+                            boost::numeric::def_overflow_handler,
+                            throw_on_precision_loss<Source>
+                    > Converter ;
+
+                    bool has_minus = ( arg < 0);
+                    if ( has_minus ) {
+                        return static_cast<Target>(-Converter::convert(-arg));
+                    } else {
+                        return Converter::convert(arg);
+                    }
+                } catch( ::boost::numeric::bad_numeric_cast const& ) {
+                    BOOST_LCAST_THROW_BAD_CAST(Source, Target);
+                }
+            }
+        };
+
+        /*
+         * lexical_cast_dynamic_num follows the rules:
+         * 1) If Source can be converted to Target without precision loss and
+         * without overflows, then assign Source to Target and return
+         *
+         * 2) If Source is less than 0 and Target is an unsigned integer,
+         * then negate Source, check the requirements of rule 1) and if
+         * successful, assign static_casted Source to Target and return
+         *
+         * 3) Otherwise throw a bad_lexical_cast exception
+         *
+         *
+         * Rule 2) required because boost::lexical_cast has the behavior of
+         * stringstream, which uses the rules of scanf for conversions. And
+         * in the C99 standard for unsigned input value minus sign is
+         * optional, so if a negative number is read, no errors will arise
+         * and the result will be the two's complement.
+         */
+        template<typename Target, typename Source>
+        struct lexical_cast_dynamic_num
+        {
+            static inline Target lexical_cast_impl(const Source &arg)
+            {
+                typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
+                    ::boost::type_traits::ice_and<
+                        ::boost::type_traits::ice_or<
+                            ::boost::is_signed<Source>::value,
+                            ::boost::is_float<Source>::value
+                        >::value,
+                        ::boost::type_traits::ice_not<
+                            is_same<Source, bool>::value
+                        >::value,
+                        ::boost::type_traits::ice_not<
+                            is_same<Target, bool>::value
+                        >::value,
+                        ::boost::is_unsigned<Target>::value
+                    >::value,
+                    lexical_cast_dynamic_num_ignoring_minus<Target, Source>,
+                    lexical_cast_dynamic_num_not_ignoring_minus<Target, Source>
+                >::type caster_type;
+
+                return caster_type::lexical_cast_impl(arg);
+            }
+        };
     }
 
     template<typename Target, typename Source>
     inline Target lexical_cast(const Source &arg)
     {
-        typedef typename detail::array_to_pointer_decay<Source>::type src;
-
-        typedef typename detail::widest_char<
-            typename detail::stream_char<Target>::type
-          , typename detail::stream_char<src>::type
-          >::type char_type;
-
-        typedef detail::lcast_src_length<char_type, src> 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<Target, src, !src_len>(arg, buf, src_len);
+        typedef BOOST_DEDUCED_TYPENAME detail::array_to_pointer_decay<Source>::type src;
+
+        typedef BOOST_DEDUCED_TYPENAME ::boost::type_traits::ice_or<
+                detail::is_xchar_to_xchar<Target, src>::value,
+                detail::is_char_array_to_stdstring<Target,src>::value,
+                ::boost::type_traits::ice_and<
+                     is_same<Target, src>::value,
+                     detail::is_stdstring<Target>::value
+                >::value
+        > do_copy_type;
+
+        typedef BOOST_DEDUCED_TYPENAME
+                detail::is_arithmetic_and_not_xchars<Target, src> do_copy_with_dynamic_check_type;
+
+        typedef BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
+            do_copy_type::value,
+            detail::lexical_cast_copy<src>,
+            BOOST_DEDUCED_TYPENAME ::boost::mpl::if_c<
+                 do_copy_with_dynamic_check_type::value,
+                 detail::lexical_cast_dynamic_num<Target, src>,
+                 detail::lexical_cast_do_cast<Target, src>
+            >::type
+        >::type caster_type;
+
+        return caster_type::lexical_cast_impl(arg);
     }
 
     #else
@@ -1191,11 +1830,7 @@ namespace boost
         Target result;
 
         if(!(interpreter << arg && interpreter >> result))
-#ifndef BOOST_NO_TYPEID
-            throw_exception(bad_lexical_cast(typeid(Source), typeid(Target)));
-#else
-            throw_exception(bad_lexical_cast());
-#endif
+          BOOST_LCAST_THROW_BAD_CAST(Source, Target);
         return result;
     }
 
@@ -1203,7 +1838,8 @@ namespace boost
 }
 
 // Copyright Kevlin Henney, 2000-2005.
-// Copyright Alexander Nasonov, 2006-2007.
+// Copyright Alexander Nasonov, 2006-2010.
+// Copyright Antony Polukhin, 2011.
 //
 // Distributed under the Boost Software License, Version 1.0. (See
 // accompanying file LICENSE_1_0.txt or copy at
diff --git a/boost/boost/make_shared.hpp b/boost/boost/make_shared.hpp
new file mode 100644 (file)
index 0000000..c04938f
--- /dev/null
@@ -0,0 +1,17 @@
+#ifndef BOOST_MAKE_SHARED_HPP_INCLUDED
+#define BOOST_MAKE_SHARED_HPP_INCLUDED
+
+//  make_shared.hpp
+//
+//  Copyright (c) 2007, 2008 Peter Dimov
+//
+//  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/smart_ptr/make_shared.html
+//  for documentation.
+
+#include <boost/smart_ptr/make_shared.hpp>
+
+#endif // #ifndef BOOST_MAKE_SHARED_HPP_INCLUDED
index bd342da30ad6b875f221e271e06bf44754109782..e9fc0627fe94789997cd34de32a774399c1a0476 100755 (executable)
@@ -20,7 +20,7 @@
 
 namespace boost {
 
-none_t const none = ((none_t)0) ;
+none_t const none = (static_cast<none_t>(0)) ;
 
 } // namespace boost
 
diff --git a/boost/boost/numeric/conversion/bounds.hpp b/boost/boost/numeric/conversion/bounds.hpp
new file mode 100644 (file)
index 0000000..e4c7c7d
--- /dev/null
@@ -0,0 +1,24 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_BOUNDS_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/bounds.hpp"
+
+namespace boost { namespace numeric 
+{
+
+template<class N>
+struct bounds : boundsdetail::get_impl<N>::type
+{} ;
+
+} } // namespace boost::numeric
+
+#endif
diff --git a/boost/boost/numeric/conversion/cast.hpp b/boost/boost/numeric/conversion/cast.hpp
new file mode 100644 (file)
index 0000000..aa518e8
--- /dev/null
@@ -0,0 +1,51 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+//
+//  Revision History
+//
+//    19 Nov 2001 Syntatic changes as suggested by Darin Adler (Fernando Cacciola)
+//    08 Nov 2001 Fixes to accommodate MSVC (Fernando Cacciola)
+//    04 Nov 2001 Fixes to accommodate gcc2.92 (Fernando Cacciola)
+//    30 Oct 2001 Some fixes suggested by Daryle Walker (Fernando Cacciola)
+//    25 Oct 2001 Initial boostification (Fernando Cacciola)
+//    23 Jan 2004 Inital add to cvs (post review)s
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP
+#define BOOST_NUMERIC_CONVERSION_CAST_25OCT2001_HPP
+
+#include <boost/detail/workaround.hpp>
+
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1300) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+
+#  include<boost/numeric/conversion/detail/old_numeric_cast.hpp>
+
+#else
+
+#include <boost/type.hpp>
+#include <boost/numeric/conversion/converter.hpp>
+
+namespace boost
+{
+  template<typename Target, typename Source>
+  inline
+  Target numeric_cast ( Source arg )
+  {
+    typedef boost::numeric::converter<Target,Source> Converter ;
+    return Converter::convert(arg);
+  }
+
+  using numeric::bad_numeric_cast;
+
+} // namespace boost
+
+#endif
+
+
+#endif
diff --git a/boost/boost/numeric/conversion/conversion_traits.hpp b/boost/boost/numeric/conversion/conversion_traits.hpp
new file mode 100644 (file)
index 0000000..6da6178
--- /dev/null
@@ -0,0 +1,39 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/conversion_traits.hpp"
+#include "boost/detail/workaround.hpp"
+#include "boost/config.hpp"
+
+namespace boost { namespace numeric
+{
+
+template<class T, class S>
+struct conversion_traits 
+    : convdetail::get_conversion_traits<T,S>::type 
+{
+#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
+    typedef typename convdetail::get_conversion_traits<T,S>::type base_;
+    typedef typename base_::target_type     target_type;
+    typedef typename base_::source_type     source_type;
+    typedef typename base_::result_type     result_type;
+    typedef typename base_::argument_type   argument_type;
+#endif
+} ;
+
+} } // namespace boost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/converter.hpp b/boost/boost/numeric/conversion/converter.hpp
new file mode 100644 (file)
index 0000000..331cadd
--- /dev/null
@@ -0,0 +1,68 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERTER_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/conversion_traits.hpp"
+#include "boost/numeric/conversion/converter_policies.hpp"
+
+#include "boost/numeric/conversion/detail/converter.hpp"
+
+namespace boost { namespace numeric 
+{
+
+template<class T,
+         class S,
+         class Traits           = conversion_traits<T,S>,
+         class OverflowHandler  = def_overflow_handler,
+         class Float2IntRounder = Trunc< BOOST_DEDUCED_TYPENAME Traits::source_type>  ,
+         class RawConverter     = raw_converter<Traits>,
+         class UserRangeChecker = UseInternalRangeChecker
+        >
+struct converter : convdetail::get_converter_impl<Traits,
+                                                  OverflowHandler,
+                                                  Float2IntRounder,
+                                                  RawConverter,
+                                                  UserRangeChecker
+                                                 >::type
+{
+  typedef Traits traits ;
+
+  typedef typename Traits::argument_type argument_type ;
+  typedef typename Traits::result_type   result_type   ;
+
+  result_type operator() ( argument_type s ) const { return this->convert(s) ; }
+} ;
+
+
+
+template<class S,
+         class OverflowHandler  = def_overflow_handler,
+         class Float2IntRounder = Trunc<S>  ,
+         class UserRangeChecker = UseInternalRangeChecker
+        >
+struct make_converter_from
+{
+  template<class T,
+           class Traits       = conversion_traits<T,S>,
+           class RawConverter = raw_converter<Traits>
+          > 
+  struct to
+  {
+    typedef converter<T,S,Traits,OverflowHandler,Float2IntRounder,RawConverter,UserRangeChecker> type ;
+  } ;
+
+} ;
+
+} } // namespace boost::numeric
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/converter_policies.hpp b/boost/boost/numeric/conversion/converter_policies.hpp
new file mode 100644 (file)
index 0000000..b0d741b
--- /dev/null
@@ -0,0 +1,186 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_CONVERTER_POLICIES_FLC_12NOV2002_HPP
+
+#include <typeinfo> // for std::bad_cast
+
+#include <boost/config/no_tr1/cmath.hpp> // for std::floor and std::ceil
+
+#include <functional>
+
+#include "boost/type_traits/is_arithmetic.hpp"
+
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/integral_c.hpp"
+
+namespace boost { namespace numeric
+{
+
+template<class S>
+struct Trunc
+{
+  typedef S source_type ;
+
+  typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+  static source_type nearbyint ( argument_type s )
+  {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+    using std::floor ;
+    using std::ceil  ;
+#endif
+
+    return s < static_cast<S>(0) ? ceil(s) : floor(s) ;
+  }
+
+  typedef mpl::integral_c< std::float_round_style, std::round_toward_zero> round_style ;
+} ;
+
+
+
+template<class S>
+struct Floor
+{
+  typedef S source_type ;
+
+  typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+  static source_type nearbyint ( argument_type s )
+  {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+    using std::floor ;
+#endif
+
+    return floor(s) ;
+  }
+
+  typedef mpl::integral_c< std::float_round_style, std::round_toward_neg_infinity> round_style ;
+} ;
+
+template<class S>
+struct Ceil
+{
+  typedef S source_type ;
+
+  typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+  static source_type nearbyint ( argument_type s )
+  {
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+    using std::ceil ;
+#endif
+
+    return ceil(s) ;
+  }
+
+  typedef mpl::integral_c< std::float_round_style, std::round_toward_infinity> round_style ;
+} ;
+
+template<class S>
+struct RoundEven
+{
+  typedef S source_type ;
+
+  typedef typename mpl::if_< is_arithmetic<S>,S,S const&>::type argument_type ;
+
+  static source_type nearbyint ( argument_type s )
+  {
+    // Algorithm contributed by Guillaume Melquiond
+
+#if !defined(BOOST_NO_STDC_NAMESPACE)
+    using std::floor ;
+    using std::ceil  ;
+#endif
+
+    // only works inside the range not at the boundaries
+    S prev = floor(s);
+    S next = ceil(s);
+
+    S rt = (s - prev) - (next - s); // remainder type
+
+    S const zero(0.0);
+    S const two(2.0);
+
+    if ( rt < zero )
+      return prev;
+    else if ( rt > zero )
+      return next;
+    else
+    {
+      bool is_prev_even = two * floor(prev / two) == prev ;
+      return ( is_prev_even ? prev : next ) ;
+    }
+  }
+
+  typedef mpl::integral_c< std::float_round_style, std::round_to_nearest> round_style ;
+} ;
+
+
+enum range_check_result
+{
+  cInRange     = 0 ,
+  cNegOverflow = 1 ,
+  cPosOverflow = 2
+} ;
+
+class bad_numeric_cast : public std::bad_cast
+{
+  public:
+
+    virtual const char * what() const throw()
+      {  return "bad numeric conversion: overflow"; }
+};
+
+class negative_overflow : public bad_numeric_cast
+{
+  public:
+
+    virtual const char * what() const throw()
+      {  return "bad numeric conversion: negative overflow"; }
+};
+class positive_overflow : public bad_numeric_cast
+{
+  public:
+
+    virtual const char * what() const throw()
+      { return "bad numeric conversion: positive overflow"; }
+};
+
+struct def_overflow_handler
+{
+  void operator() ( range_check_result r ) // throw(negative_overflow,positive_overflow)
+  {
+    if ( r == cNegOverflow )
+      throw negative_overflow() ;
+    else if ( r == cPosOverflow )
+           throw positive_overflow() ;
+  }
+} ;
+
+struct silent_overflow_handler
+{
+  void operator() ( range_check_result ) {} // throw()
+} ;
+
+template<class Traits>
+struct raw_converter
+{
+  typedef typename Traits::result_type   result_type   ;
+  typedef typename Traits::argument_type argument_type ;
+
+  static result_type low_level_convert ( argument_type s ) { return static_cast<result_type>(s) ; }
+} ;
+
+struct UseInternalRangeChecker {} ;
+
+} } // namespace boost::numeric
+
+#endif
diff --git a/boost/boost/numeric/conversion/detail/bounds.hpp b/boost/boost/numeric/conversion/detail/bounds.hpp
new file mode 100644 (file)
index 0000000..67342b8
--- /dev/null
@@ -0,0 +1,58 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_BOUNDS_DETAIL_FLC_12NOV2002_HPP
+
+#include "boost/limits.hpp"
+#include "boost/config.hpp"
+#include "boost/mpl/if.hpp"
+
+namespace boost { namespace numeric { namespace boundsdetail
+{
+  template<class N>
+  class Integral
+  {
+      typedef std::numeric_limits<N> limits ;
+
+    public :
+    
+      static N lowest  () { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+      static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+      static N smallest() { return static_cast<N>(1); }
+  } ;
+
+  template<class N>
+  class Float
+  {
+      typedef std::numeric_limits<N> limits ;
+
+    public :
+    
+      static N lowest  () { return static_cast<N>(-limits::max BOOST_PREVENT_MACRO_SUBSTITUTION ()) ; }
+      static N highest () { return limits::max BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+      static N smallest() { return limits::min BOOST_PREVENT_MACRO_SUBSTITUTION (); }
+  } ;
+
+  template<class N>
+  struct get_impl
+  {
+    typedef mpl::bool_< ::std::numeric_limits<N>::is_integer > is_int ;
+
+    typedef Integral<N> impl_int   ;
+    typedef Float   <N> impl_float ;
+
+    typedef typename mpl::if_<is_int,impl_int,impl_float>::type type ;
+  } ;
+
+} } } // namespace boost::numeric::boundsdetail.
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/boost/boost/numeric/conversion/detail/conversion_traits.hpp b/boost/boost/numeric/conversion/detail/conversion_traits.hpp
new file mode 100644 (file)
index 0000000..ed25349
--- /dev/null
@@ -0,0 +1,97 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERSION_TRAITS_FLC_12NOV2002_HPP
+
+#include "boost/type_traits/is_arithmetic.hpp"
+#include "boost/type_traits/is_same.hpp"
+#include "boost/type_traits/remove_cv.hpp"
+
+#include "boost/numeric/conversion/detail/meta.hpp"
+#include "boost/numeric/conversion/detail/int_float_mixture.hpp"
+#include "boost/numeric/conversion/detail/sign_mixture.hpp"
+#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp"
+#include "boost/numeric/conversion/detail/is_subranged.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  //-------------------------------------------------------------------
+  // Implementation of the Conversion Traits for T != S
+  //
+  // This is a VISIBLE base class of the user-level conversion_traits<> class.
+  //-------------------------------------------------------------------
+  template<class T,class S>
+  struct non_trivial_traits_impl
+  {
+    typedef typename get_int_float_mixture   <T,S>::type int_float_mixture ;
+    typedef typename get_sign_mixture        <T,S>::type sign_mixture ;
+    typedef typename get_udt_builtin_mixture <T,S>::type udt_builtin_mixture ;
+
+    typedef typename get_is_subranged<T,S>::type subranged ;
+
+    typedef mpl::false_ trivial ;
+
+    typedef T target_type ;
+    typedef S source_type ;
+    typedef T result_type ;
+
+    typedef typename mpl::if_< is_arithmetic<S>, S, S const&>::type argument_type ;
+
+    typedef typename mpl::if_<subranged,S,T>::type supertype ;
+    typedef typename mpl::if_<subranged,T,S>::type subtype   ;
+  } ;
+
+  //-------------------------------------------------------------------
+  // Implementation of the Conversion Traits for T == S
+  //
+  // This is a VISIBLE base class of the user-level conversion_traits<> class.
+  //-------------------------------------------------------------------
+  template<class N>
+  struct trivial_traits_impl
+  {
+    typedef typename get_int_float_mixture  <N,N>::type int_float_mixture ;
+    typedef typename get_sign_mixture       <N,N>::type sign_mixture ;
+    typedef typename get_udt_builtin_mixture<N,N>::type udt_builtin_mixture ;
+
+    typedef mpl::false_ subranged ;
+    typedef mpl::true_  trivial ;
+
+    typedef N        target_type ;
+    typedef N        source_type ;
+    typedef N const& result_type ;
+    typedef N const& argument_type ;
+
+    typedef N supertype ;
+    typedef N subtype  ;
+
+  } ;
+
+  //-------------------------------------------------------------------
+  // Top level implementation selector.
+  //-------------------------------------------------------------------
+  template<class T, class S>
+  struct get_conversion_traits
+  {
+    typedef typename remove_cv<T>::type target_type ;
+    typedef typename remove_cv<S>::type source_type ;
+
+    typedef typename is_same<target_type,source_type>::type is_trivial ;
+
+    typedef trivial_traits_impl    <target_type>             trivial_imp ;
+    typedef non_trivial_traits_impl<target_type,source_type> non_trivial_imp ;
+
+    typedef typename mpl::if_<is_trivial,trivial_imp,non_trivial_imp>::type type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/detail/converter.hpp b/boost/boost/numeric/conversion/detail/converter.hpp
new file mode 100644 (file)
index 0000000..10550f8
--- /dev/null
@@ -0,0 +1,602 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+//
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_CONVERTER_FLC_12NOV2002_HPP
+
+#include <functional>
+
+#include "boost/numeric/conversion/detail/meta.hpp"
+#include "boost/numeric/conversion/detail/conversion_traits.hpp"
+#include "boost/numeric/conversion/bounds.hpp"
+
+#include "boost/type_traits/is_same.hpp"
+
+#include "boost/mpl/integral_c.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  // Integral Constants representing rounding modes
+  typedef mpl::integral_c<std::float_round_style, std::round_toward_zero>         round2zero_c ;
+  typedef mpl::integral_c<std::float_round_style, std::round_to_nearest>          round2nearest_c ;
+  typedef mpl::integral_c<std::float_round_style, std::round_toward_infinity>     round2inf_c ;
+  typedef mpl::integral_c<std::float_round_style, std::round_toward_neg_infinity> round2neg_inf_c ;
+
+  // Metafunction:
+  //
+  //   for_round_style<RoundStyle,RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf>::type
+  //
+  // {RoundStyle} Integral Constant specifying a round style as declared above.
+  // {RoundToZero,RoundToNearest,RoundToInf,RoundToNegInf} arbitrary types.
+  //
+  // Selects one of the 4 types according to the value of RoundStyle.
+  //
+  template<class RoundStyle,class RoundToZero,class RoundToNearest,class RoundToInf,class RoundToNegInf>
+  struct for_round_style
+  {
+    typedef ct_switch4<RoundStyle
+                       , round2zero_c, round2nearest_c, round2inf_c // round2neg_inf_c
+                       , RoundToZero , RoundToNearest , RoundToInf , RoundToNegInf
+                      > selector ;
+
+    typedef typename selector::type type ;
+  } ;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------------------------------------------------------------------
+//                             Range Checking Logic.
+//
+// The range checking logic is built up by combining 1 or 2 predicates.
+// Each predicate is encapsulated in a template class and exposes
+// the static member function 'apply'.
+//
+//--------------------------------------------------------------------------
+
+
+  // Because a particular logic can combine either 1 or two predicates, the following
+  // tags are used to allow the predicate applier to receive 2 preds, but optimize away
+  // one of them if it is 'non-applicable'
+  struct non_applicable { typedef mpl::false_ do_apply ; } ;
+  struct applicable     { typedef mpl::true_  do_apply ; } ;
+
+
+  //--------------------------------------------------------------------------
+  //
+  //                      Range Checking Logic implementations.
+  //
+  // The following classes, collectivelly named 'Predicates', are instantiated within
+  // the corresponding range checkers.
+  // Their static member function 'apply' is called to perform the actual range checking logic.
+  //--------------------------------------------------------------------------
+
+    // s < Lowest(T) ? cNegOverflow : cInRange
+    //
+    template<class Traits>
+    struct LT_LoT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s < static_cast<S>(bounds<T>::lowest()) ? cNegOverflow : cInRange ;
+      }
+    } ;
+
+    // s < 0 ? cNegOverflow : cInRange
+    //
+    template<class Traits>
+    struct LT_Zero : applicable
+    {
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s < static_cast<S>(0) ? cNegOverflow : cInRange ;
+      }
+    } ;
+
+    // s <= Lowest(T)-1 ? cNegOverflow : cInRange
+    //
+    template<class Traits>
+    struct LE_PrevLoT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s <= static_cast<S>(bounds<T>::lowest()) - static_cast<S>(1.0)
+                 ? cNegOverflow : cInRange ;
+      }
+    } ;
+
+    // s < Lowest(T)-0.5 ? cNegOverflow : cInRange
+    //
+    template<class Traits>
+    struct LT_HalfPrevLoT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s < static_cast<S>(bounds<T>::lowest()) - static_cast<S>(0.5)
+                 ? cNegOverflow : cInRange ;
+      }
+    } ;
+
+    // s > Highest(T) ? cPosOverflow : cInRange
+    //
+    template<class Traits>
+    struct GT_HiT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s > static_cast<S>(bounds<T>::highest())
+                 ? cPosOverflow : cInRange ;
+      }
+    } ;
+
+    // s >= Lowest(T) + 1 ? cPosOverflow : cInRange
+    //
+    template<class Traits>
+    struct GE_SuccHiT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(1.0)
+                 ? cPosOverflow : cInRange ;
+      }
+    } ;
+
+    // s >= Lowest(T) + 0.5 ? cPosgOverflow : cInRange
+    //
+    template<class Traits>
+    struct GT_HalfSuccHiT : applicable
+    {
+      typedef typename Traits::target_type T ;
+      typedef typename Traits::source_type S ;
+      typedef typename Traits::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        return s >= static_cast<S>(bounds<T>::highest()) + static_cast<S>(0.5)
+                 ? cPosOverflow : cInRange ;
+      }
+    } ;
+
+
+  //--------------------------------------------------------------------------
+  //
+  // Predicate Combiner.
+  //
+  // This helper classes are used to possibly combine the range checking logic
+  // individually performed by the predicates
+  //
+  //--------------------------------------------------------------------------
+
+
+    // Applies both predicates: first 'PredA', and if it equals 'cInRange', 'PredB'
+    template<class PredA, class PredB>
+    struct applyBoth
+    {
+      typedef typename PredA::argument_type argument_type ;
+
+      static range_check_result apply ( argument_type s )
+      {
+        range_check_result r = PredA::apply(s) ;
+        if ( r == cInRange )
+          r = PredB::apply(s);
+        return r ;
+      }
+    } ;
+
+    template<class PredA, class PredB>
+    struct combine
+    {
+      typedef applyBoth<PredA,PredB> Both ;
+      typedef void                   NNone ; // 'None' is defined as a macro in (/usr/X11R6/include/X11/X.h)
+
+      typedef typename PredA::do_apply do_applyA ;
+      typedef typename PredB::do_apply do_applyB ;
+
+      typedef typename for_both<do_applyA, do_applyB, Both, PredA, PredB, NNone>::type type ;
+    } ;
+
+
+
+
+
+
+
+
+
+
+
+
+//--------------------------------------------------------------------------
+//                             Range Checker classes.
+//
+// The following classes are VISIBLE base classes of the user-level converter<> class.
+// They supply the optimized 'out_of_range()' and 'validate_range()' static member functions
+// visible in the user interface.
+//
+//--------------------------------------------------------------------------
+
+  // Dummy range checker.
+  template<class Traits>
+  struct dummy_range_checker
+  {
+    typedef typename Traits::argument_type argument_type ;
+
+    static range_check_result out_of_range ( argument_type ) { return cInRange ; }
+    static void validate_range ( argument_type ) {}
+  } ;
+
+  // Generic range checker.
+  //
+  // All the range checking logic for all possible combinations of source and target
+  // can be arranged in terms of one or two predicates, which test overflow on both neg/pos 'sides'
+  // of the ranges.
+  //
+  // These predicates are given here as IsNegOverflow and IsPosOverflow.
+  //
+  template<class Traits, class IsNegOverflow, class IsPosOverflow, class OverflowHandler>
+  struct generic_range_checker
+  {
+    typedef OverflowHandler overflow_handler ;
+
+    typedef typename Traits::argument_type argument_type ;
+
+    static range_check_result out_of_range ( argument_type s )
+    {
+      typedef typename combine<IsNegOverflow,IsPosOverflow>::type Predicate ;
+
+      return Predicate::apply(s);
+    }
+
+    static void validate_range ( argument_type s )
+      { OverflowHandler()( out_of_range(s) ) ; }
+  } ;
+
+
+
+//--------------------------------------------------------------------------
+//
+// Selectors for the optimized Range Checker class.
+//
+//--------------------------------------------------------------------------
+
+  template<class Traits,class OverflowHandler>
+  struct GetRC_Sig2Sig_or_Unsig2Unsig
+  {
+    typedef dummy_range_checker<Traits> Dummy ;
+
+    typedef LT_LoT<Traits> Pred1 ;
+    typedef GT_HiT<Traits> Pred2 ;
+
+    typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
+
+    typedef typename Traits::subranged subranged ;
+
+    typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
+  } ;
+
+  template<class Traits, class OverflowHandler>
+  struct GetRC_Sig2Unsig
+  {
+    typedef LT_Zero<Traits> Pred1 ;
+    typedef GT_HiT <Traits> Pred2 ;
+
+    typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ChoiceA ;
+
+    typedef generic_range_checker<Traits,Pred1,non_applicable,OverflowHandler> ChoiceB ;
+
+    typedef typename Traits::target_type T ;
+    typedef typename Traits::source_type S ;
+
+    typedef typename subranged_Unsig2Sig<S,T>::type oposite_subranged ;
+
+    typedef typename mpl::not_<oposite_subranged>::type positively_subranged ;
+
+    typedef typename mpl::if_<positively_subranged,ChoiceA,ChoiceB>::type type ;
+  } ;
+
+  template<class Traits, class OverflowHandler>
+  struct GetRC_Unsig2Sig
+  {
+    typedef GT_HiT<Traits> Pred1 ;
+
+    typedef generic_range_checker<Traits,non_applicable,Pred1,OverflowHandler> type ;
+  } ;
+
+  template<class Traits,class OverflowHandler>
+  struct GetRC_Int2Int
+  {
+    typedef GetRC_Sig2Sig_or_Unsig2Unsig<Traits,OverflowHandler> Sig2SigQ     ;
+    typedef GetRC_Sig2Unsig             <Traits,OverflowHandler> Sig2UnsigQ   ;
+    typedef GetRC_Unsig2Sig             <Traits,OverflowHandler> Unsig2SigQ   ;
+    typedef Sig2SigQ                                             Unsig2UnsigQ ;
+
+    typedef typename Traits::sign_mixture sign_mixture ;
+
+    typedef typename
+      for_sign_mixture<sign_mixture,Sig2SigQ,Sig2UnsigQ,Unsig2SigQ,Unsig2UnsigQ>::type
+        selector ;
+
+    typedef typename selector::type type ;
+  } ;
+
+  template<class Traits>
+  struct GetRC_Int2Float
+  {
+    typedef dummy_range_checker<Traits> type ;
+  } ;
+
+  template<class Traits, class OverflowHandler, class Float2IntRounder>
+  struct GetRC_Float2Int
+  {
+    typedef LE_PrevLoT    <Traits> Pred1 ;
+    typedef GE_SuccHiT    <Traits> Pred2 ;
+    typedef LT_HalfPrevLoT<Traits> Pred3 ;
+    typedef GT_HalfSuccHiT<Traits> Pred4 ;
+    typedef GT_HiT        <Traits> Pred5 ;
+    typedef LT_LoT        <Traits> Pred6 ;
+
+    typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> ToZero    ;
+    typedef generic_range_checker<Traits,Pred3,Pred4,OverflowHandler> ToNearest ;
+    typedef generic_range_checker<Traits,Pred1,Pred5,OverflowHandler> ToInf     ;
+    typedef generic_range_checker<Traits,Pred6,Pred2,OverflowHandler> ToNegInf  ;
+
+    typedef typename Float2IntRounder::round_style round_style ;
+
+    typedef typename for_round_style<round_style,ToZero,ToNearest,ToInf,ToNegInf>::type type ;
+  } ;
+
+  template<class Traits, class OverflowHandler>
+  struct GetRC_Float2Float
+  {
+    typedef dummy_range_checker<Traits> Dummy ;
+
+    typedef LT_LoT<Traits> Pred1 ;
+    typedef GT_HiT<Traits> Pred2 ;
+
+    typedef generic_range_checker<Traits,Pred1,Pred2,OverflowHandler> Normal ;
+
+    typedef typename Traits::subranged subranged ;
+
+    typedef typename mpl::if_<subranged,Normal,Dummy>::type type ;
+  } ;
+
+  template<class Traits, class OverflowHandler, class Float2IntRounder>
+  struct GetRC_BuiltIn2BuiltIn
+  {
+    typedef GetRC_Int2Int<Traits,OverflowHandler>                    Int2IntQ ;
+    typedef GetRC_Int2Float<Traits>                                  Int2FloatQ ;
+    typedef GetRC_Float2Int<Traits,OverflowHandler,Float2IntRounder> Float2IntQ ;
+    typedef GetRC_Float2Float<Traits,OverflowHandler>                Float2FloatQ ;
+
+    typedef typename Traits::int_float_mixture int_float_mixture ;
+
+    typedef typename for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ>::type selector ;
+
+    typedef typename selector::type type ;
+  } ;
+
+  template<class Traits, class OverflowHandler, class Float2IntRounder>
+  struct GetRC
+  {
+    typedef GetRC_BuiltIn2BuiltIn<Traits,OverflowHandler,Float2IntRounder> BuiltIn2BuiltInQ ;
+
+    typedef dummy_range_checker<Traits> Dummy ;
+
+    typedef mpl::identity<Dummy> DummyQ ;
+
+    typedef typename Traits::udt_builtin_mixture udt_builtin_mixture ;
+
+    typedef typename for_udt_builtin_mixture<udt_builtin_mixture,BuiltIn2BuiltInQ,DummyQ,DummyQ,DummyQ>::type selector ;
+
+    typedef typename selector::type type ;
+  } ;
+
+
+
+
+//--------------------------------------------------------------------------
+//                             Converter classes.
+//
+// The following classes are VISIBLE base classes of the user-level converter<> class.
+// They supply the optimized 'nearbyint()' and 'convert()' static member functions
+// visible in the user interface.
+//
+//--------------------------------------------------------------------------
+
+  //
+  // Trivial Converter : used when (cv-unqualified) T == (cv-unqualified)  S
+  //
+  template<class Traits>
+  struct trivial_converter_impl : public std::unary_function<  BOOST_DEDUCED_TYPENAME Traits::argument_type
+                                                              ,BOOST_DEDUCED_TYPENAME Traits::result_type
+                                                            >
+                                 ,public dummy_range_checker<Traits>
+  {
+    typedef Traits traits ;
+
+    typedef typename Traits::source_type   source_type   ;
+    typedef typename Traits::argument_type argument_type ;
+    typedef typename Traits::result_type   result_type   ;
+
+    static result_type low_level_convert ( argument_type s ) { return s ; }
+    static source_type nearbyint         ( argument_type s ) { return s ; }
+    static result_type convert           ( argument_type s ) { return s ; }
+  } ;
+
+
+  //
+  // Rounding Converter : used for float to integral conversions.
+  //
+  template<class Traits,class RangeChecker,class RawConverter,class Float2IntRounder>
+  struct rounding_converter : public std::unary_function<  BOOST_DEDUCED_TYPENAME Traits::argument_type
+                                                          ,BOOST_DEDUCED_TYPENAME Traits::result_type
+                                                        >
+                             ,public RangeChecker
+                             ,public Float2IntRounder
+                             ,public RawConverter
+  {
+    typedef RangeChecker     RangeCheckerBase ;
+    typedef Float2IntRounder Float2IntRounderBase ;
+    typedef RawConverter     RawConverterBase ;
+
+    typedef Traits traits ;
+
+    typedef typename Traits::source_type   source_type   ;
+    typedef typename Traits::argument_type argument_type ;
+    typedef typename Traits::result_type   result_type   ;
+
+    static result_type convert ( argument_type s )
+    {
+      RangeCheckerBase::validate_range(s);
+      source_type s1 = Float2IntRounderBase::nearbyint(s);
+      return RawConverterBase::low_level_convert(s1);
+    }
+  } ;
+
+
+  //
+  // Non-Rounding Converter : used for all other conversions.
+  //
+  template<class Traits,class RangeChecker,class RawConverter>
+  struct non_rounding_converter : public std::unary_function< BOOST_DEDUCED_TYPENAME Traits::argument_type
+                                                             ,BOOST_DEDUCED_TYPENAME Traits::result_type
+                                                           >
+                                 ,public RangeChecker
+                                 ,public RawConverter
+  {
+    typedef RangeChecker RangeCheckerBase ;
+    typedef RawConverter RawConverterBase ;
+
+    typedef Traits traits ;
+
+    typedef typename Traits::source_type   source_type   ;
+    typedef typename Traits::argument_type argument_type ;
+    typedef typename Traits::result_type   result_type   ;
+
+    static source_type nearbyint ( argument_type s ) { return s ; }
+
+    static result_type convert ( argument_type s )
+    {
+      RangeCheckerBase::validate_range(s);
+      return RawConverterBase::low_level_convert(s);
+    }
+  } ;
+
+
+
+
+//--------------------------------------------------------------------------
+//
+// Selectors for the optimized Converter class.
+//
+//--------------------------------------------------------------------------
+
+  template<class Traits,class OverflowHandler,class Float2IntRounder,class RawConverter, class UserRangeChecker>
+  struct get_non_trivial_converter
+  {
+    typedef GetRC<Traits,OverflowHandler,Float2IntRounder> InternalRangeCheckerQ ;
+
+    typedef is_same<UserRangeChecker,UseInternalRangeChecker> use_internal_RC ;
+
+    typedef mpl::identity<UserRangeChecker> UserRangeCheckerQ ;
+
+    typedef typename
+      mpl::eval_if<use_internal_RC,InternalRangeCheckerQ,UserRangeCheckerQ>::type
+        RangeChecker ;
+
+    typedef non_rounding_converter<Traits,RangeChecker,RawConverter>              NonRounding ;
+    typedef rounding_converter<Traits,RangeChecker,RawConverter,Float2IntRounder> Rounding ;
+
+    typedef mpl::identity<NonRounding> NonRoundingQ ;
+    typedef mpl::identity<Rounding>    RoundingQ    ;
+
+    typedef typename Traits::int_float_mixture int_float_mixture ;
+
+    typedef typename
+      for_int_float_mixture<int_float_mixture, NonRoundingQ, NonRoundingQ, RoundingQ, NonRoundingQ>::type
+        selector ;
+
+    typedef typename selector::type type ;
+  } ;
+
+  template< class Traits
+           ,class OverflowHandler
+           ,class Float2IntRounder
+           ,class RawConverter
+           ,class UserRangeChecker
+          >
+  struct get_converter_impl
+  {
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x0561 ) )
+    // bcc55 prefers sometimes template parameters to be explicit local types.
+    // (notice that is is illegal to reuse the names like this)
+    typedef Traits           Traits ;
+    typedef OverflowHandler  OverflowHandler ;
+    typedef Float2IntRounder Float2IntRounder ;
+    typedef RawConverter     RawConverter ;
+    typedef UserRangeChecker UserRangeChecker ;
+#endif
+
+    typedef trivial_converter_impl<Traits> Trivial ;
+    typedef mpl::identity        <Trivial> TrivialQ ;
+
+    typedef get_non_trivial_converter< Traits
+                                      ,OverflowHandler
+                                      ,Float2IntRounder
+                                      ,RawConverter
+                                      ,UserRangeChecker
+                                     > NonTrivialQ ;
+
+    typedef typename Traits::trivial trivial ;
+
+    typedef typename mpl::eval_if<trivial,TrivialQ,NonTrivialQ>::type type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/detail/int_float_mixture.hpp b/boost/boost/numeric/conversion/detail/int_float_mixture.hpp
new file mode 100644 (file)
index 0000000..464e527
--- /dev/null
@@ -0,0 +1,72 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/config.hpp"
+#include "boost/limits.hpp"
+
+#include "boost/numeric/conversion/int_float_mixture_enum.hpp"
+#include "boost/numeric/conversion/detail/meta.hpp"
+
+#include "boost/mpl/integral_c.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  // Integral Constants for 'IntFloatMixture'
+  typedef mpl::integral_c<int_float_mixture_enum, integral_to_integral> int2int_c ;
+  typedef mpl::integral_c<int_float_mixture_enum, integral_to_float>    int2float_c ;
+  typedef mpl::integral_c<int_float_mixture_enum, float_to_integral>    float2int_c ;
+  typedef mpl::integral_c<int_float_mixture_enum, float_to_float>       float2float_c ;
+
+  // Metafunction:
+  //
+  //   get_int_float_mixture<T,S>::type
+  //
+  // Selects the appropriate Int-Float Mixture Integral Constant for the combination T,S.
+  //
+  template<class T,class S>
+  struct get_int_float_mixture
+  {
+    typedef mpl::bool_< ::std::numeric_limits<S>::is_integer > S_int ;
+    typedef mpl::bool_< ::std::numeric_limits<T>::is_integer > T_int ;
+
+    typedef typename
+      for_both<S_int, T_int, int2int_c, int2float_c, float2int_c, float2float_c>::type
+        type ;
+  } ;
+
+  // Metafunction:
+  //
+  //   for_int_float_mixture<Mixture,int_int,int_float,float_int,float_float>::type
+  //
+  // {Mixture} is one of the Integral Constants for Mixture, declared above.
+  // {int_int,int_float,float_int,float_float} are aribtrary types. (not metafunctions)
+  //
+  // According to the value of 'IntFloatMixture', selects the corresponding type.
+  //
+  template<class IntFloatMixture, class Int2Int, class Int2Float, class Float2Int, class Float2Float>
+  struct for_int_float_mixture
+  {
+    typedef typename
+      ct_switch4<IntFloatMixture
+                 ,int2int_c, int2float_c, float2int_c  // default
+                 ,Int2Int  , Int2Float  , Float2Int  , Float2Float
+                >::type
+        type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/detail/is_subranged.hpp b/boost/boost/numeric/conversion/detail/is_subranged.hpp
new file mode 100644 (file)
index 0000000..b5e7fe8
--- /dev/null
@@ -0,0 +1,234 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_IS_SUBRANGED_FLC_12NOV2002_HPP
+
+#include "boost/config.hpp"
+#include "boost/limits.hpp"
+
+#include "boost/mpl/int.hpp"
+#include "boost/mpl/multiplies.hpp"
+#include "boost/mpl/less.hpp"
+#include "boost/mpl/equal_to.hpp"
+
+#include "boost/type_traits/is_same.hpp"
+
+#include "boost/numeric/conversion/detail/meta.hpp"
+#include "boost/numeric/conversion/detail/int_float_mixture.hpp"
+#include "boost/numeric/conversion/detail/sign_mixture.hpp"
+#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  //---------------------------------------------------------------
+  // Implementations of the compile time predicate "T is subranged"
+  //---------------------------------------------------------------
+
+    // for integral to integral conversions
+    template<class T,class S>
+    struct subranged_Sig2Unsig
+    {
+      // Signed to unsigned conversions are 'subranged' because of possible loose
+      // of negative values.
+      typedef mpl::true_ type ;
+    } ;
+
+    // for unsigned integral to signed integral conversions
+    template<class T,class S>
+    struct subranged_Unsig2Sig
+    {
+       // IMPORTANT NOTE:
+       //
+       // This code assumes that signed/unsigned integral values are represented
+       // such that:
+       //
+       //  numeric_limits<signed T>::digits + 1 == numeric_limits<unsigned T>::digits
+       //
+       // The '+1' is required since numeric_limits<>::digits gives 1 bit less for signed integral types.
+       //
+       // This fact is used by the following logic:
+       //
+       //  if ( (numeric_limits<T>::digits+1) < (2*numeric_limits<S>::digits) )
+       //    then the conversion is subranged.
+       //
+
+       typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
+       typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
+
+       // T is signed, so take digits+1
+       typedef typename T_digits::next u_T_digits ;
+
+       typedef mpl::int_<2> Two ;
+
+       typedef typename mpl::multiplies<S_digits,Two>::type S_digits_times_2 ;
+
+       typedef typename mpl::less<u_T_digits,S_digits_times_2>::type type ;
+    } ;
+
+    // for integral to integral conversions of the same sign.
+    template<class T,class S>
+    struct subranged_SameSign
+    {
+       // An integral conversion of the same sign is subranged if digits(T) < digits(S).
+
+       typedef mpl::int_< ::std::numeric_limits<S>::digits > S_digits ;
+       typedef mpl::int_< ::std::numeric_limits<T>::digits > T_digits ;
+
+       typedef typename mpl::less<T_digits,S_digits>::type type ;
+    } ;
+
+    // for integral to float conversions
+    template<class T,class S>
+    struct subranged_Int2Float
+    {
+      typedef mpl::false_ type ;
+    } ;
+
+    // for float to integral conversions
+    template<class T,class S>
+    struct subranged_Float2Int
+    {
+      typedef mpl::true_ type ;
+    } ;
+
+    // for float to float conversions
+    template<class T,class S>
+    struct subranged_Float2Float
+    {
+      // If both T and S are floats,
+      // compare exponent bits and if they match, mantisa bits.
+
+      typedef mpl::int_< ::std::numeric_limits<S>::digits > S_mantisa ;
+      typedef mpl::int_< ::std::numeric_limits<T>::digits > T_mantisa ;
+
+      typedef mpl::int_< ::std::numeric_limits<S>::max_exponent > S_exponent ;
+      typedef mpl::int_< ::std::numeric_limits<T>::max_exponent > T_exponent ;
+
+      typedef typename mpl::less<T_exponent,S_exponent>::type T_smaller_exponent ;
+
+      typedef typename mpl::equal_to<T_exponent,S_exponent>::type equal_exponents ;
+
+      typedef mpl::less<T_mantisa,S_mantisa> T_smaller_mantisa ;
+
+      typedef mpl::eval_if<equal_exponents,T_smaller_mantisa,mpl::false_> not_bigger_exponent_case ;
+
+      typedef typename
+        mpl::eval_if<T_smaller_exponent,mpl::true_,not_bigger_exponent_case>::type
+          type ;
+    } ;
+
+    // for Udt to built-in conversions
+    template<class T,class S>
+    struct subranged_Udt2BuiltIn
+    {
+      typedef mpl::true_ type ;
+    } ;
+
+    // for built-in to Udt conversions
+    template<class T,class S>
+    struct subranged_BuiltIn2Udt
+    {
+      typedef mpl::false_ type ;
+    } ;
+
+    // for Udt to Udt conversions
+    template<class T,class S>
+    struct subranged_Udt2Udt
+    {
+      typedef mpl::false_ type ;
+    } ;
+
+  //-------------------------------------------------------------------
+  // Selectors for the implementations of the subranged predicate
+  //-------------------------------------------------------------------
+
+    template<class T,class S>
+    struct get_subranged_Int2Int
+    {
+      typedef subranged_SameSign<T,S>  Sig2Sig     ;
+      typedef subranged_Sig2Unsig<T,S> Sig2Unsig   ;
+      typedef subranged_Unsig2Sig<T,S> Unsig2Sig   ;
+      typedef Sig2Sig                  Unsig2Unsig ;
+
+      typedef typename get_sign_mixture<T,S>::type sign_mixture ;
+
+      typedef typename
+        for_sign_mixture<sign_mixture, Sig2Sig, Sig2Unsig, Unsig2Sig, Unsig2Unsig>::type
+           type ;
+    } ;
+
+    template<class T,class S>
+    struct get_subranged_BuiltIn2BuiltIn
+    {
+      typedef get_subranged_Int2Int<T,S> Int2IntQ ;
+
+      typedef subranged_Int2Float  <T,S> Int2Float   ;
+      typedef subranged_Float2Int  <T,S> Float2Int   ;
+      typedef subranged_Float2Float<T,S> Float2Float ;
+
+      typedef mpl::identity<Int2Float  > Int2FloatQ   ;
+      typedef mpl::identity<Float2Int  > Float2IntQ   ;
+      typedef mpl::identity<Float2Float> Float2FloatQ ;
+
+      typedef typename get_int_float_mixture<T,S>::type int_float_mixture ;
+
+      typedef for_int_float_mixture<int_float_mixture, Int2IntQ, Int2FloatQ, Float2IntQ, Float2FloatQ> for_ ;
+
+      typedef typename for_::type selected ;
+
+      typedef typename selected::type type ;
+    } ;
+
+    template<class T,class S>
+    struct get_subranged
+    {
+      typedef get_subranged_BuiltIn2BuiltIn<T,S> BuiltIn2BuiltInQ ;
+
+      typedef subranged_BuiltIn2Udt<T,S> BuiltIn2Udt ;
+      typedef subranged_Udt2BuiltIn<T,S> Udt2BuiltIn ;
+      typedef subranged_Udt2Udt<T,S>     Udt2Udt ;
+
+      typedef mpl::identity<BuiltIn2Udt> BuiltIn2UdtQ ;
+      typedef mpl::identity<Udt2BuiltIn> Udt2BuiltInQ ;
+      typedef mpl::identity<Udt2Udt    > Udt2UdtQ     ;
+
+      typedef typename get_udt_builtin_mixture<T,S>::type udt_builtin_mixture ;
+      
+      typedef typename
+        for_udt_builtin_mixture<udt_builtin_mixture, BuiltIn2BuiltInQ, BuiltIn2UdtQ, Udt2BuiltInQ, Udt2UdtQ>::type
+          selected ;
+
+      typedef typename selected::type selected2 ;
+      typedef typename selected2::type type ;
+    } ;
+
+
+  //-------------------------------------------------------------------
+  // Top level implementation selector.
+  //-------------------------------------------------------------------
+  template<class T, class S>
+  struct get_is_subranged
+  {
+    typedef get_subranged<T,S>         non_trivial_case ;
+    typedef mpl::identity<mpl::false_> trivial_case ;
+
+    typedef is_same<T,S> is_trivial ;
+   
+    typedef typename mpl::if_<is_trivial,trivial_case,non_trivial_case>::type selected ;
+    
+    typedef typename selected::type type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/detail/meta.hpp b/boost/boost/numeric/conversion/detail/meta.hpp
new file mode 100644 (file)
index 0000000..246a1b4
--- /dev/null
@@ -0,0 +1,120 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_META_FLC_12NOV2002_HPP
+
+#include "boost/type_traits/remove_cv.hpp"
+
+#include "boost/mpl/if.hpp"
+#include "boost/mpl/eval_if.hpp"
+#include "boost/mpl/equal_to.hpp"
+#include "boost/mpl/not.hpp"
+#include "boost/mpl/and.hpp"
+#include "boost/mpl/bool.hpp"
+#include "boost/mpl/identity.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+   template< class T1, class T2>
+   struct equal_to
+   {
+   #if !defined(__BORLANDC__)
+   
+       enum { x = ( BOOST_MPL_AUX_VALUE_WKND(T1)::value == BOOST_MPL_AUX_VALUE_WKND(T2)::value ) };
+           
+       BOOST_STATIC_CONSTANT(bool, value = x);
+           
+       typedef mpl::bool_<value> type;
+       
+   #else
+   
+       BOOST_STATIC_CONSTANT(bool, value = (
+             BOOST_MPL_AUX_VALUE_WKND(T1)::value 
+               == BOOST_MPL_AUX_VALUE_WKND(T2)::value
+           ));
+           
+       typedef mpl::bool_<(
+             BOOST_MPL_AUX_VALUE_WKND(T1)::value 
+               == BOOST_MPL_AUX_VALUE_WKND(T2)::value
+           )> type;
+   #endif
+   };
+    
+// Metafunction:
+  //
+  //   ct_switch4<Value,Case0Val,Case1Val,Case2Val,Case0Type,Case1Type,Case2Type,DefaultType>::type
+  //
+  // {Value,Case(X)Val} are Integral Constants (such as: mpl::int_<>)
+  // {Case(X)Type,DefaultType} are arbitrary types. (not metafunctions)
+  //
+  // Returns Case(X)Type if Val==Case(X)Val; DefaultType otherwise.
+  //
+  template<class Value,
+           class Case0Val,
+           class Case1Val,
+           class Case2Val,
+           class Case0Type,
+           class Case1Type,
+           class Case2Type,
+           class DefaultType
+          >
+  struct ct_switch4
+  {
+    typedef mpl::identity<Case0Type> Case0TypeQ ;
+    typedef mpl::identity<Case1Type> Case1TypeQ ;
+
+    typedef equal_to<Value,Case0Val> is_case0 ;
+    typedef equal_to<Value,Case1Val> is_case1 ;
+    typedef equal_to<Value,Case2Val> is_case2 ;
+
+    typedef mpl::if_<is_case2,Case2Type,DefaultType> choose_2_3Q ;
+    typedef mpl::eval_if<is_case1,Case1TypeQ,choose_2_3Q> choose_1_2_3Q ;
+
+    typedef typename
+      mpl::eval_if<is_case0,Case0TypeQ,choose_1_2_3Q>::type
+        type ;
+  } ;
+
+
+
+
+  // Metafunction:
+  //
+  //   for_both<expr0,expr1,TT,TF,FT,FF>::type
+  //
+  // {exp0,expr1} are Boolean Integral Constants
+  // {TT,TF,FT,FF} are aribtrary types. (not metafunctions)
+  //
+  // According to the combined boolean value of 'expr0 && expr1', selects the corresponding type.
+  //
+  template<class expr0, class expr1, class TT, class TF, class FT, class FF>
+  struct for_both
+  {
+    typedef mpl::identity<TF> TF_Q ;
+    typedef mpl::identity<TT> TT_Q ;
+
+    typedef typename mpl::not_<expr0>::type not_expr0 ;
+    typedef typename mpl::not_<expr1>::type not_expr1 ;
+
+    typedef typename mpl::and_<expr0,expr1>::type     caseTT ;
+    typedef typename mpl::and_<expr0,not_expr1>::type caseTF ;
+    typedef typename mpl::and_<not_expr0,expr1>::type caseFT ;
+
+    typedef mpl::if_<caseFT,FT,FF>                    choose_FT_FF_Q ;
+    typedef mpl::eval_if<caseTF,TF_Q,choose_FT_FF_Q> choose_TF_FT_FF_Q ;
+
+    typedef typename mpl::eval_if<caseTT,TT_Q,choose_TF_FT_FF_Q>::type type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp b/boost/boost/numeric/conversion/detail/old_numeric_cast.hpp
new file mode 100644 (file)
index 0000000..47b86d2
--- /dev/null
@@ -0,0 +1,339 @@
+//  boost cast.hpp header file  ----------------------------------------------//
+
+//  (C) Copyright Kevlin Henney and Dave Abrahams 1999.
+//  Distributed under the Boost
+//  Software License, Version 1.0. (See accompanying file
+//  LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+
+//  See http://www.boost.org/libs/conversion for Documentation.
+
+//  Revision History
+//  23 JUN 05  Code extracted from /boost/cast.hpp into this new header.
+//             Keeps this legacy version of numeric_cast<> for old compilers
+//             wich can't compile the new version in /boost/numeric/conversion/cast.hpp
+//             (Fernando Cacciola)
+//  02 Apr 01  Removed BOOST_NO_LIMITS workarounds and included
+//             <boost/limits.hpp> instead (the workaround did not
+//             actually compile when BOOST_NO_LIMITS was defined in
+//             any case, so we loose nothing). (John Maddock)
+//  21 Jan 01  Undid a bug I introduced yesterday. numeric_cast<> never
+//             worked with stock GCC; trying to get it to do that broke
+//             vc-stlport.
+//  20 Jan 01  Moved BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS to config.hpp.
+//             Removed unused BOOST_EXPLICIT_TARGET macro. Moved
+//             boost::detail::type to boost/type.hpp. Made it compile with
+//             stock gcc again (Dave Abrahams)
+//  29 Nov 00  Remove nested namespace cast, cleanup spacing before Formal
+//             Review (Beman Dawes)
+//  19 Oct 00  Fix numeric_cast for floating-point types (Dave Abrahams)
+//  15 Jul 00  Suppress numeric_cast warnings for GCC, Borland and MSVC
+//             (Dave Abrahams)
+//  30 Jun 00  More MSVC6 wordarounds.  See comments below.  (Dave Abrahams)
+//  28 Jun 00  Removed implicit_cast<>.  See comment below. (Beman Dawes)
+//  27 Jun 00  More MSVC6 workarounds
+//  15 Jun 00  Add workarounds for MSVC6
+//   2 Feb 00  Remove bad_numeric_cast ";" syntax error (Doncho Angelov)
+//  26 Jan 00  Add missing throw() to bad_numeric_cast::what(0 (Adam Levar)
+//  29 Dec 99  Change using declarations so usages in other namespaces work
+//             correctly (Dave Abrahams)
+//  23 Sep 99  Change polymorphic_downcast assert to also detect M.I. errors
+//             as suggested Darin Adler and improved by Valentin Bonnard.
+//   2 Sep 99  Remove controversial asserts, simplify, rename.
+//  30 Aug 99  Move to cast.hpp, replace value_cast with numeric_cast,
+//             place in nested namespace.
+//   3 Aug 99  Initial version
+
+#ifndef BOOST_OLD_NUMERIC_CAST_HPP
+#define BOOST_OLD_NUMERIC_CAST_HPP
+
+# include <boost/config.hpp>
+# include <cassert>
+# include <typeinfo>
+# include <boost/type.hpp>
+# include <boost/limits.hpp>
+# include <boost/numeric/conversion/converter_policies.hpp>
+
+//  It has been demonstrated numerous times that MSVC 6.0 fails silently at link
+//  time if you use a template function which has template parameters that don't
+//  appear in the function's argument list.
+//
+//  TODO: Add this to config.hpp?
+//  FLC: This macro is repeated in boost/cast.hpp but only locally (is undefined at the bottom)
+//       so is OK to reproduce it here.
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+#  define BOOST_EXPLICIT_DEFAULT_TARGET , ::boost::type<Target>* = 0
+# else
+#  define BOOST_EXPLICIT_DEFAULT_TARGET
+# endif
+
+namespace boost
+{
+  using numeric::bad_numeric_cast;
+
+//  LEGACY numeric_cast [only for some old broken compilers] --------------------------------------//
+
+//  Contributed by Kevlin Henney
+
+//  numeric_cast  ------------------------------------------------------------//
+
+#if !defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) || defined(BOOST_SGI_CPP_LIMITS)
+
+    namespace detail
+    {
+      template <class T>
+      struct signed_numeric_limits : std::numeric_limits<T>
+      {
+             static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+         {
+             return (std::numeric_limits<T>::min)() >= 0
+                     // unary minus causes integral promotion, thus the static_cast<>
+                     ? static_cast<T>(-(std::numeric_limits<T>::max)())
+                     : (std::numeric_limits<T>::min)();
+         };
+      };
+
+      // Move to namespace boost in utility.hpp?
+      template <class T, bool specialized>
+      struct fixed_numeric_limits_base
+          : public if_true< std::numeric_limits<T>::is_signed >
+           ::BOOST_NESTED_TEMPLATE then< signed_numeric_limits<T>,
+                            std::numeric_limits<T>
+                   >::type
+      {};
+
+      template <class T>
+      struct fixed_numeric_limits
+          : fixed_numeric_limits_base<T,(std::numeric_limits<T>::is_specialized)>
+      {};
+
+# ifdef BOOST_HAS_LONG_LONG
+      // cover implementations which supply no specialization for long
+      // long / unsigned long long. Not intended to be full
+      // numeric_limits replacements, but good enough for numeric_cast<>
+      template <>
+      struct fixed_numeric_limits_base< ::boost::long_long_type, false>
+      {
+          BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+          BOOST_STATIC_CONSTANT(bool, is_signed = true);
+          static  ::boost::long_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+          {
+#  ifdef LONGLONG_MAX
+              return LONGLONG_MAX;
+#  else
+              return 9223372036854775807LL; // hope this is portable
+#  endif
+          }
+
+          static  ::boost::long_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+          {
+#  ifdef LONGLONG_MIN
+              return LONGLONG_MIN;
+#  else
+               return -( 9223372036854775807LL )-1; // hope this is portable
+#  endif
+          }
+      };
+
+      template <>
+      struct fixed_numeric_limits_base< ::boost::ulong_long_type, false>
+      {
+          BOOST_STATIC_CONSTANT(bool, is_specialized = true);
+          BOOST_STATIC_CONSTANT(bool, is_signed = false);
+          static  ::boost::ulong_long_type max BOOST_PREVENT_MACRO_SUBSTITUTION ()
+          {
+#  ifdef ULONGLONG_MAX
+              return ULONGLONG_MAX;
+#  else
+              return 0xffffffffffffffffULL; // hope this is portable
+#  endif
+          }
+
+          static  ::boost::ulong_long_type min BOOST_PREVENT_MACRO_SUBSTITUTION () { return 0; }
+      };
+# endif
+    } // namespace detail
+
+// less_than_type_min -
+  //    x_is_signed should be numeric_limits<X>::is_signed
+  //    y_is_signed should be numeric_limits<Y>::is_signed
+  //    y_min should be numeric_limits<Y>::min()
+  //
+  //    check(x, y_min) returns true iff x < y_min without invoking comparisons
+  //    between signed and unsigned values.
+  //
+  //    "poor man's partial specialization" is in use here.
+    template <bool x_is_signed, bool y_is_signed>
+    struct less_than_type_min
+    {
+        template <class X, class Y>
+        static bool check(X x, Y y_min)
+            { return x < y_min; }
+    };
+
+    template <>
+    struct less_than_type_min<false, true>
+    {
+        template <class X, class Y>
+        static bool check(X, Y)
+            { return false; }
+    };
+
+    template <>
+    struct less_than_type_min<true, false>
+    {
+        template <class X, class Y>
+        static bool check(X x, Y)
+            { return x < 0; }
+    };
+
+  // greater_than_type_max -
+  //    same_sign should be:
+  //            numeric_limits<X>::is_signed == numeric_limits<Y>::is_signed
+  //    y_max should be numeric_limits<Y>::max()
+  //
+  //    check(x, y_max) returns true iff x > y_max without invoking comparisons
+  //    between signed and unsigned values.
+  //
+  //    "poor man's partial specialization" is in use here.
+    template <bool same_sign, bool x_is_signed>
+    struct greater_than_type_max;
+
+    template<>
+    struct greater_than_type_max<true, true>
+    {
+        template <class X, class Y>
+        static inline bool check(X x, Y y_max)
+            { return x > y_max; }
+    };
+
+    template <>
+    struct greater_than_type_max<false, true>
+    {
+        // What does the standard say about this? I think it's right, and it
+        // will work with every compiler I know of.
+        template <class X, class Y>
+        static inline bool check(X x, Y)
+            { return x >= 0 && static_cast<X>(static_cast<Y>(x)) != x; }
+
+# if defined(BOOST_MSVC) && BOOST_MSVC < 1300
+        // MSVC6 can't static_cast  unsigned __int64 -> floating types
+#  define BOOST_UINT64_CAST(src_type)                                   \
+        static inline bool check(src_type x, unsigned __int64)          \
+        {                                                               \
+            if (x < 0) return false;                                    \
+            unsigned __int64 y = static_cast<unsigned __int64>(x);      \
+            bool odd = y & 0x1;                                         \
+            __int64 div2 = static_cast<__int64>(y >> 1);                \
+            return ((static_cast<src_type>(div2) * 2.0) + odd) != x;    \
+        }
+
+        BOOST_UINT64_CAST(long double);
+        BOOST_UINT64_CAST(double);
+        BOOST_UINT64_CAST(float);
+#  undef BOOST_UINT64_CAST
+# endif
+    };
+
+    template<>
+    struct greater_than_type_max<true, false>
+    {
+        template <class X, class Y>
+        static inline bool check(X x, Y y_max)
+            { return x > y_max; }
+    };
+
+    template <>
+    struct greater_than_type_max<false, false>
+    {
+        // What does the standard say about this? I think it's right, and it
+        // will work with every compiler I know of.
+        template <class X, class Y>
+        static inline bool check(X x, Y)
+            { return static_cast<X>(static_cast<Y>(x)) != x; }
+    };
+
+#else // use #pragma hacks if available
+
+  namespace detail
+  {
+# if BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable : 4018)
+#  pragma warning(disable : 4146)
+#elif defined(__BORLANDC__)
+#  pragma option push -w-8041
+# endif
+
+       // Move to namespace boost in utility.hpp?
+       template <class T>
+       struct fixed_numeric_limits : public std::numeric_limits<T>
+       {
+           static inline T min BOOST_PREVENT_MACRO_SUBSTITUTION ()
+           {
+               return std::numeric_limits<T>::is_signed && (std::numeric_limits<T>::min)() >= 0
+                   ? T(-(std::numeric_limits<T>::max)()) : (std::numeric_limits<T>::min)();
+           }
+       };
+
+# if BOOST_MSVC
+#  pragma warning(pop)
+#elif defined(__BORLANDC__)
+#  pragma option pop
+# endif
+  } // namespace detail
+
+#endif
+
+    template<typename Target, typename Source>
+    inline Target numeric_cast(Source arg BOOST_EXPLICIT_DEFAULT_TARGET)
+    {
+        // typedefs abbreviating respective trait classes
+        typedef detail::fixed_numeric_limits<Source> arg_traits;
+        typedef detail::fixed_numeric_limits<Target> result_traits;
+
+#if defined(BOOST_STRICT_CONFIG) \
+    || (!defined(__HP_aCC) || __HP_aCC > 33900) \
+         && (!defined(BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS) \
+             || defined(BOOST_SGI_CPP_LIMITS))
+        // typedefs that act as compile time assertions
+        // (to be replaced by boost compile time assertions
+        // as and when they become available and are stable)
+        typedef bool argument_must_be_numeric[arg_traits::is_specialized];
+        typedef bool result_must_be_numeric[result_traits::is_specialized];
+
+        const bool arg_is_signed = arg_traits::is_signed;
+        const bool result_is_signed = result_traits::is_signed;
+        const bool same_sign = arg_is_signed == result_is_signed;
+
+        if (less_than_type_min<arg_is_signed, result_is_signed>::check(arg, (result_traits::min)())
+            || greater_than_type_max<same_sign, arg_is_signed>::check(arg, (result_traits::max)())
+            )
+
+#else // We need to use #pragma hacks if available
+
+# if BOOST_MSVC
+#  pragma warning(push)
+#  pragma warning(disable : 4018)
+#elif defined(__BORLANDC__)
+#pragma option push -w-8012
+# endif
+        if ((arg < 0 && !result_traits::is_signed)  // loss of negative range
+             || (arg_traits::is_signed && arg < (result_traits::min)())  // underflow
+             || arg > (result_traits::max)())            // overflow
+# if BOOST_MSVC
+#  pragma warning(pop)
+#elif defined(__BORLANDC__)
+#pragma option pop
+# endif
+#endif
+        {
+            throw bad_numeric_cast();
+        }
+        return static_cast<Target>(arg);
+    } // numeric_cast
+
+#  undef BOOST_EXPLICIT_DEFAULT_TARGET
+
+} // namespace boost
+
+#endif  // BOOST_OLD_NUMERIC_CAST_HPP
diff --git a/boost/boost/numeric/conversion/detail/sign_mixture.hpp b/boost/boost/numeric/conversion/detail/sign_mixture.hpp
new file mode 100644 (file)
index 0000000..c7f9e42
--- /dev/null
@@ -0,0 +1,72 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_SIGN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/config.hpp"
+#include "boost/limits.hpp"
+
+#include "boost/numeric/conversion/sign_mixture_enum.hpp"
+#include "boost/numeric/conversion/detail/meta.hpp"
+
+#include "boost/mpl/integral_c.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  // Integral Constants for 'SignMixture'
+  typedef mpl::integral_c<sign_mixture_enum, unsigned_to_unsigned> unsig2unsig_c ;
+  typedef mpl::integral_c<sign_mixture_enum, signed_to_signed>     sig2sig_c ;
+  typedef mpl::integral_c<sign_mixture_enum, signed_to_unsigned>   sig2unsig_c ;
+  typedef mpl::integral_c<sign_mixture_enum, unsigned_to_signed>   unsig2sig_c ;
+
+  // Metafunction:
+  //
+  //   get_sign_mixture<T,S>::type
+  //
+  // Selects the appropriate SignMixture Integral Constant for the combination T,S.
+  //
+  template<class T,class S>
+  struct get_sign_mixture
+  {
+    typedef mpl::bool_< ::std::numeric_limits<S>::is_signed > S_signed ;
+    typedef mpl::bool_< ::std::numeric_limits<T>::is_signed > T_signed ;
+
+    typedef typename
+      for_both<S_signed, T_signed, sig2sig_c, sig2unsig_c, unsig2sig_c, unsig2unsig_c>::type
+        type ;
+  } ;
+
+  // Metafunction:
+  //
+  //   for_sign_mixture<SignMixture,Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig>::type
+  //
+  // {SignMixture} is one of the Integral Constants for SignMixture, declared above.
+  // {Sig2Sig,Sig2Unsig,Unsig2Sig,Unsig2Unsig} are aribtrary types. (not metafunctions)
+  //
+  // According to the value of 'SignMixture', selects the corresponding type.
+  //
+  template<class SignMixture, class Sig2Sig, class Sig2Unsig, class Unsig2Sig, class Unsig2Unsig>
+  struct for_sign_mixture
+  {
+    typedef typename
+      ct_switch4<SignMixture
+                 , sig2sig_c, sig2unsig_c, unsig2sig_c  // default
+                 , Sig2Sig  , Sig2Unsig  , Unsig2Sig  , Unsig2Unsig
+                >::type
+        type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp b/boost/boost/numeric/conversion/detail/udt_builtin_mixture.hpp
new file mode 100644 (file)
index 0000000..36dbc49
--- /dev/null
@@ -0,0 +1,69 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_DETAIL_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/type_traits/is_arithmetic.hpp"
+
+#include "boost/numeric/conversion/udt_builtin_mixture_enum.hpp"
+#include "boost/numeric/conversion/detail/meta.hpp"
+
+#include "boost/mpl/integral_c.hpp"
+
+namespace boost { namespace numeric { namespace convdetail
+{
+  // Integral Constants for 'UdtMixture'
+  typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_builtin> builtin2builtin_c ;
+  typedef mpl::integral_c<udt_builtin_mixture_enum, builtin_to_udt>     builtin2udt_c ;
+  typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_builtin>     udt2builtin_c ;
+  typedef mpl::integral_c<udt_builtin_mixture_enum, udt_to_udt>         udt2udt_c ;
+
+  // Metafunction:
+  //
+  //   for_udt_mixture<UdtMixture,BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt>::type
+  //
+  // {UdtMixture} is one of the Integral Constants for UdMixture, declared above.
+  // {BuiltIn2BuiltIn,BuiltIn2Udt,Udt2BuiltIn,Udt2Udt} are aribtrary types. (not metafunctions)
+  //
+  // According to the value of 'UdtMixture', selects the corresponding type.
+  //
+  template<class UdtMixture, class BuiltIn2BuiltIn, class BuiltIn2Udt, class Udt2BuiltIn, class Udt2Udt>
+  struct for_udt_builtin_mixture
+  {
+    typedef typename
+      ct_switch4<UdtMixture
+                 , builtin2builtin_c, builtin2udt_c, udt2builtin_c // default
+                 , BuiltIn2BuiltIn  , BuiltIn2Udt  , Udt2BuiltIn  , Udt2Udt
+                >::type
+        type ;
+  } ;
+
+  // Metafunction:
+  //
+  //   get_udt_mixture<T,S>::type
+  //
+  // Selects the appropriate UdtMixture Integral Constant for the combination T,S.
+  //
+  template<class T,class S>
+  struct get_udt_builtin_mixture
+  {
+    typedef is_arithmetic<S> S_builtin ;
+    typedef is_arithmetic<T> T_builtin ;
+
+    typedef typename
+      for_both<S_builtin, T_builtin, builtin2builtin_c, builtin2udt_c, udt2builtin_c, udt2udt_c>::type
+        type ;
+  } ;
+
+} } } // namespace boost::numeric::convdetail
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/int_float_mixture.hpp b/boost/boost/numeric/conversion/int_float_mixture.hpp
new file mode 100644 (file)
index 0000000..d6dd5ab
--- /dev/null
@@ -0,0 +1,30 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/int_float_mixture.hpp"
+
+namespace boost { namespace numeric
+{
+
+template<class T, class S>
+struct int_float_mixture
+  : convdetail::get_int_float_mixture<  BOOST_DEDUCED_TYPENAME remove_cv<T>::type
+                                       ,BOOST_DEDUCED_TYPENAME remove_cv<S>::type
+                                     >::type {} ;
+
+} } // namespace boost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/int_float_mixture_enum.hpp b/boost/boost/numeric/conversion/int_float_mixture_enum.hpp
new file mode 100644 (file)
index 0000000..d0c2daa
--- /dev/null
@@ -0,0 +1,29 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_INT_FLOAT_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace boost { namespace numeric
+{
+  enum int_float_mixture_enum
+  {
+     integral_to_integral
+    ,integral_to_float
+    ,float_to_integral
+    ,float_to_float
+  } ;
+
+} } // namespace boost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/is_subranged.hpp b/boost/boost/numeric/conversion/is_subranged.hpp
new file mode 100644 (file)
index 0000000..c5fa0dd
--- /dev/null
@@ -0,0 +1,27 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_IS_SUBRANGED_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_IS_SUBRANGED_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/is_subranged.hpp"
+
+namespace boost { namespace numeric {
+
+template<class T, class S>
+struct is_subranged
+  : convdetail::get_is_subranged<  BOOST_DEDUCED_TYPENAME remove_cv<T>::type
+                                  ,BOOST_DEDUCED_TYPENAME remove_cv<S>::type
+                                >::type {} ;
+
+} } // namespace boost::numeric
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/sign_mixture.hpp b/boost/boost/numeric/conversion/sign_mixture.hpp
new file mode 100644 (file)
index 0000000..1201814
--- /dev/null
@@ -0,0 +1,30 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/sign_mixture.hpp"
+
+namespace boost { namespace numeric
+{
+
+template<class T, class S>
+struct sign_mixture
+  : convdetail::get_sign_mixture<  BOOST_DEDUCED_TYPENAME remove_cv<T>::type
+                                  ,BOOST_DEDUCED_TYPENAME remove_cv<S>::type
+                                >::type {} ;
+
+} } // namespace boost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/sign_mixture_enum.hpp b/boost/boost/numeric/conversion/sign_mixture_enum.hpp
new file mode 100644 (file)
index 0000000..1525f8d
--- /dev/null
@@ -0,0 +1,29 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_SIGN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace boost { namespace numeric
+{
+  enum sign_mixture_enum
+  {
+     unsigned_to_unsigned
+    ,signed_to_signed
+    ,signed_to_unsigned
+    ,unsigned_to_signed
+  } ;
+
+} } // namespace boost::numeric
+
+#endif
+//
+///////////////////////////////////////////////////////////////////////////////////////////////
+
+
diff --git a/boost/boost/numeric/conversion/udt_builtin_mixture.hpp b/boost/boost/numeric/conversion/udt_builtin_mixture.hpp
new file mode 100644 (file)
index 0000000..a62e37d
--- /dev/null
@@ -0,0 +1,28 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_FLC_12NOV2002_HPP
+
+#include "boost/numeric/conversion/detail/udt_builtin_mixture.hpp"
+
+namespace boost { namespace numeric
+{
+
+template<class T, class S>
+struct udt_builtin_mixture
+  : convdetail::get_udt_builtin_mixture<  BOOST_DEDUCED_TYPENAME remove_cv<T>::type
+                                         ,BOOST_DEDUCED_TYPENAME remove_cv<S>::type
+                                       >::type {} ;
+
+} } // namespace boost::numeric
+
+#endif
+
+
diff --git a/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp b/boost/boost/numeric/conversion/udt_builtin_mixture_enum.hpp
new file mode 100644 (file)
index 0000000..2540e80
--- /dev/null
@@ -0,0 +1,26 @@
+//  (c) Copyright Fernando Luis Cacciola Carballal 2000-2004
+//  Use, modification, and distribution is subject to the Boost Software
+//  License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+//  http://www.boost.org/LICENSE_1_0.txt)
+
+//  See library home page at http://www.boost.org/libs/numeric/conversion
+//
+// Contact the author at: fernando_cacciola@hotmail.com
+// 
+#ifndef BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+#define BOOST_NUMERIC_CONVERSION_UDT_BUILTIN_MIXTURE_ENUM_FLC_12NOV2002_HPP
+
+namespace boost { namespace numeric
+{
+  enum udt_builtin_mixture_enum
+  {
+     builtin_to_builtin
+    ,builtin_to_udt
+    ,udt_to_builtin
+    ,udt_to_udt
+  } ;
+
+} } // namespace boost::numeric
+
+#endif
+
index 4b47ba40c1baa21c6498ec940fc638a56ae99592..b524cee381a327c469a9d37cd7a20d559b69be50 100644 (file)
@@ -8,6 +8,8 @@
 //  See http://www.boost.org/libs/utility/operators.htm for documentation.
 
 //  Revision History
+//  16 Dec 10 Limit warning suppression for 4284 to older versions of VC++
+//            (Matthew Bradbury, fixes #4432)
 //  07 Aug 08 Added "euclidean" spelling. (Daniel Frey)
 //  03 Apr 08 Make sure "convertible to bool" is sufficient
 //            for T::operator<, etc. (Daniel Frey)
@@ -88,7 +90,7 @@
 #   pragma set woff 1234
 #endif
 
-#if defined(BOOST_MSVC)
+#if BOOST_WORKAROUND(BOOST_MSVC, < 1600)
 #   pragma warning( disable : 4284 ) // complaint about return type of 
 #endif                               // operator-> not begin a UDT
 
index dcde233fa511ec718df2eec0b0ea2d531193986a..388cc1c632f1b6bf737907e0b300ba2036c72f1d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2003, Fernando Luis Cacciola Carballal.
+// Copyright (C) 2003, 2008 Fernando Luis Cacciola Carballal.
 //
 // Use, modification, and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -9,6 +9,9 @@
 // You are welcome to contact the author at:
 //  fernando_cacciola@hotmail.com
 //
+// Revisions:
+// 10 May 2008 (added swap related forward declaration) Niels Dekker
+// 
 #ifndef BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
 #define BOOST_OPTIONAL_OPTIONAL_FWD_FLC_19NOV2002_HPP
 
@@ -16,6 +19,10 @@ namespace boost {
 
 template<class T> class optional ;
 
+template<class T> void swap ( optional<T>& , optional<T>& ) ;
+
+template<class T> struct optional_swap_should_use_default_constructor ;
+
 } // namespace boost
 
 #endif
index 0efd8e556479888bc07900a165b3c12c32659a54..b6b09ff32a014bd9d6526710f21ad627b20059f7 100644 (file)
@@ -26,7 +26,7 @@
     BOOST_PP_IF( \
         BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
         BOOST_PP_SEQ_CAT_I, \
-        BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_1 \
+        BOOST_PP_SEQ_HEAD \
     )(seq) \
     /**/
 # define BOOST_PP_SEQ_CAT_I(seq) BOOST_PP_SEQ_FOLD_LEFT(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
 # define BOOST_PP_SEQ_CAT_S(s, seq) \
     BOOST_PP_IF( \
         BOOST_PP_DEC(BOOST_PP_SEQ_SIZE(seq)), \
-        BOOST_PP_SEQ_CAT_S_I, \
-        BOOST_PP_SEQ_HEAD(seq) BOOST_PP_TUPLE_EAT_2 \
+        BOOST_PP_SEQ_CAT_S_I_A, \
+        BOOST_PP_SEQ_CAT_S_I_B \
     )(s, seq) \
     /**/
-# define BOOST_PP_SEQ_CAT_S_I(s, seq) BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
+# define BOOST_PP_SEQ_CAT_S_I_A(s, seq) BOOST_PP_SEQ_FOLD_LEFT_ ## s(BOOST_PP_SEQ_CAT_O, BOOST_PP_SEQ_HEAD(seq), BOOST_PP_SEQ_TAIL(seq))
+# define BOOST_PP_SEQ_CAT_S_I_B(s, seq) BOOST_PP_SEQ_HEAD(seq)
 #
 # endif
index 2f7b70ea51f27f668c6ddcfb3d9f84bfb5c87f46..385c00a192165a677554d90fb8753b6cbc0fcb25 100644 (file)
@@ -14,7 +14,6 @@
 #
 # include <boost/preprocessor/cat.hpp>
 # include <boost/preprocessor/config/config.hpp>
-# include <boost/preprocessor/tuple/eat.hpp>
 #
 # if BOOST_PP_CONFIG_FLAGS() & BOOST_PP_CONFIG_MWCC()
 #    define BOOST_PP_SEQ_SIZE(seq) BOOST_PP_SEQ_SIZE_I((seq))
index a88a7852ea616cb42259f2a572c4861db539a3de..3b92e6ae47dad24ee98e87a124f6aed267a8c410 100644 (file)
  * with MSVC and the /Zc:wchar_t option we place some extra unsigned short versions
  * of the non-inline functions in the library, so that users can still link to the lib,
  * irrespective of whether their own code is built with /Zc:wchar_t.
+ * Note that this does NOT WORK with VC10 when the C++ locale is in effect as
+ * the locale's <unsigned short> facets simply do not compile in that case.
  */
-#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER)
+#if defined(__cplusplus) && (defined(BOOST_MSVC) || defined(__ICL)) && !defined(BOOST_NO_INTRINSIC_WCHAR_T) && defined(BOOST_WINDOWS) && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) && !defined(BOOST_RWSTD_VER) && ((_MSC_VER < 1600) || !defined(BOOST_REGEX_USE_CPP_LOCALE))
 #  define BOOST_REGEX_HAS_OTHER_WCHAR_T
 #  ifdef BOOST_MSVC
 #     pragma warning(push)
index db60e28afd835e3b55e2d66332df4a7a1a93e0eb..05b6bfa24af2162f2eb438c3be78d46e324ed35e 100644 (file)
@@ -73,7 +73,7 @@ boost::shared_ptr<Object const> object_cache<Key, Object>::get(const Key& k, siz
    // for now just throw, but we should never really get here...
    //
    ::boost::throw_exception(std::runtime_error("Error in thread safety code: could not acquire a lock"));
-#ifdef BOOST_NO_UNREACHABLE_RETURN_DETECTION
+#if defined(BOOST_NO_UNREACHABLE_RETURN_DETECTION) || defined(BOOST_NO_EXCEPTIONS)
    return boost::shared_ptr<Object>();
 #endif
 #else
index 657ca0a4cf952536e6c8a4587c6d89cead380e17..a8faefd5de0a594adcea963733f70228380e8ab9 100644 (file)
@@ -113,6 +113,10 @@ inline unsigned utf8_trailing_byte_count(boost::uint8_t c)
    return utf8_byte_count(c) - 1;
 }
 
+#ifdef BOOST_MSVC
+#pragma warning(push)
+#pragma warning(disable:4100)
+#endif
 inline void invalid_utf32_code_point(::boost::uint32_t val)
 {
 #ifndef BOOST_NO_STD_LOCALE
@@ -124,6 +128,9 @@ inline void invalid_utf32_code_point(::boost::uint32_t val)
 #endif
    boost::throw_exception(e);
 }
+#ifdef BOOST_MSVC
+#pragma warning(pop)
+#endif
 
 
 } // namespace detail
index 04c7bb3743c2ff90fec6795b9c8dc9ca7a890ceb..53b7bcaa235114b89ba0a53dabb4ac4daf8d386d 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *
- * Copyright (c) 1998-2004
- * John Maddock
+ * Copyright (c) 1998-2004 John Maddock
+ * Copyright 2011 Garmin Ltd. or its subsidiaries
  *
  * Distributed under the Boost Software License, Version 1.0.
  * (See accompanying file LICENSE_1_0.txt or copy at
@@ -234,7 +234,7 @@ public:
    std::pair<const_iterator, const_iterator> BOOST_REGEX_CALL subexpression(std::size_t n)const
    {
       if(n == 0)
-         throw std::out_of_range("0 is not a valid subexpression index.");
+         boost::throw_exception(std::out_of_range("0 is not a valid subexpression index."));
       const std::pair<std::size_t, std::size_t>& pi = this->m_subs.at(n - 1);
       std::pair<const_iterator, const_iterator> p(expression() + pi.first, expression() + pi.second);
       return p;
@@ -487,7 +487,7 @@ public:
    std::pair<const_iterator, const_iterator> BOOST_REGEX_CALL subexpression(std::size_t n)const
    {
       if(!m_pimpl.get())
-         throw std::logic_error("Can't access subexpressions in an invalid regex.");
+         boost::throw_exception(std::logic_error("Can't access subexpressions in an invalid regex."));
       return m_pimpl->subexpression(n);
    }
    const_iterator BOOST_REGEX_CALL begin()const
index 4dacfc6f335977c8b4cf11c8e3af59a57bd789cc..0192a9f1e1598a63c19415aea2657dc64322a09f 100644 (file)
@@ -2711,6 +2711,8 @@ regex_constants::syntax_option_type basic_regex_parser<charT, traits>::parse_opt
       }
    }
    while(!breakout);
+   
+   breakout = false;
 
    if(*m_position == static_cast<charT>('-'))
    {
index cd22bd8e538549c47f9abe032a33465f66652b53..bcae455a375f6c8da20365e0cbd69dc6addee4fb 100644 (file)
@@ -1,7 +1,7 @@
 /*
  *
- * Copyright (c) 2004
- * John Maddock
+ * Copyright (c) 2004 John Maddock
+ * Copyright 2011 Garmin Ltd. or its subsidiaries
  *
  * Use, modification and distribution are subject to the 
  * Boost Software License, Version 1.0. (See accompanying file 
@@ -511,7 +511,9 @@ typename cpp_regex_traits_implementation<charT>::string_type
    // however at least one std lib will always throw
    // std::bad_alloc for certain arguments...
    //
+#ifndef BOOST_NO_EXCEPTIONS
    try{
+#endif
       //
       // What we do here depends upon the format of the sort key returned by
       // sort key returned by this->transform:
@@ -546,7 +548,9 @@ typename cpp_regex_traits_implementation<charT>::string_type
             result.erase(i);
             break;
       }
+#ifndef BOOST_NO_EXCEPTIONS
    }catch(...){}
+#endif
    while(result.size() && (charT(0) == *result.rbegin()))
       result.erase(result.size() - 1);
    if(result.empty())
@@ -576,7 +580,9 @@ typename cpp_regex_traits_implementation<charT>::string_type
    // std::bad_alloc for certain arguments...
    //
    string_type result;
+#ifndef BOOST_NO_EXCEPTIONS
    try{
+#endif
       result = this->m_pcollate->transform(p1, p2);
       //
       // Borland's STLPort version returns a NULL-terminated
@@ -593,10 +599,12 @@ typename cpp_regex_traits_implementation<charT>::string_type
          result.erase(result.size() - 1);
 #endif
       BOOST_ASSERT(std::find(result.begin(), result.end(), charT(0)) == result.end());
+#ifndef BOOST_NO_EXCEPTIONS
    }
    catch(...)
    {
    }
+#endif
    return result;
 }
 
index 4b0ac9275169fa51e6ea2529e61b3d0c1b73cb9f..de1677164be257532de76d3417485e521eed734b 100644 (file)
@@ -317,14 +317,14 @@ inline u32regex_token_iterator<const wchar_t*> make_u32regex_token_iterator(cons
 template <std::size_t N>
 inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const UChar* p, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
 {
-   return u32regex_token_iterator<const UChar*>(p, p+u_strlen(p), e, m);
+   return u32regex_token_iterator<const UChar*>(p, p+u_strlen(p), e, submatch, m);
 }
 #endif
 template <class charT, class Traits, class Alloc, std::size_t N>
 inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>::const_iterator> make_u32regex_token_iterator(const std::basic_string<charT, Traits, Alloc>& p, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
 {
    typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type;
-   return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m);
+   return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, submatch, m);
 }
 template <std::size_t N>
 inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const int (&submatch)[N], regex_constants::match_flag_type m = regex_constants::match_default)
@@ -354,7 +354,7 @@ template <class charT, class Traits, class Alloc>
 inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>::const_iterator> make_u32regex_token_iterator(const std::basic_string<charT, Traits, Alloc>& p, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
 {
    typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type;
-   return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m);
+   return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, submatch, m);
 }
 inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, const std::vector<int>& submatch, regex_constants::match_flag_type m = regex_constants::match_default)
 {
index 98e08948afd77c0535058d9930d43296dd0525c9..b5e569d8d36780fbd3970bc58e267a450c904d83 100644 (file)
@@ -1,3 +1,6 @@
+#ifndef BOOST_SMART_PTR_HPP_INCLUDED
+#define BOOST_SMART_PTR_HPP_INCLUDED
+
 //
 //  smart_ptr.hpp
 //
@@ -22,4 +25,7 @@
 # include <boost/weak_ptr.hpp>
 # include <boost/intrusive_ptr.hpp>
 # include <boost/enable_shared_from_this.hpp>
+# include <boost/make_shared.hpp>
 #endif
+
+#endif // #ifndef BOOST_SMART_PTR_HPP_INCLUDED
index 4943e37643fc5ed7399128f27303774eca2a22e0..f96a220391311b69ea7c1752bec3a62d9fabd047 100644 (file)
@@ -52,6 +52,10 @@ int const   weak_count_id = 0x298C38A4;
 
 struct sp_nothrow_tag {};
 
+template< class D > struct sp_inplace_tag
+{
+};
+
 class weak_count;
 
 class shared_count
@@ -142,6 +146,40 @@ public:
 #endif
     }
 
+#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
+
+    template< class P, class D > shared_count( P p, sp_inplace_tag<D> ): pi_( 0 )
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+        , id_(shared_count_id)
+#endif
+    {
+#ifndef BOOST_NO_EXCEPTIONS
+
+        try
+        {
+            pi_ = new sp_counted_impl_pd< P, D >( p );
+        }
+        catch( ... )
+        {
+            D()( p ); // delete p
+            throw;
+        }
+
+#else
+
+        pi_ = new sp_counted_impl_pd< P, D >( p );
+
+        if( pi_ == 0 )
+        {
+            D()( p ); // delete p
+            boost::throw_exception( std::bad_alloc() );
+        }
+
+#endif // #ifndef BOOST_NO_EXCEPTIONS
+    }
+
+#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
+
     template<class P, class D, class A> shared_count( P p, D d, A a ): pi_( 0 )
 #if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
         , id_(shared_count_id)
@@ -188,6 +226,56 @@ public:
 #endif
     }
 
+#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
+
+    template< class P, class D, class A > shared_count( P p, sp_inplace_tag< D >, A a ): pi_( 0 )
+#if defined(BOOST_SP_ENABLE_DEBUG_HOOKS)
+        , id_(shared_count_id)
+#endif
+    {
+        typedef sp_counted_impl_pda< P, D, A > impl_type;
+        typedef typename A::template rebind< impl_type >::other A2;
+
+        A2 a2( a );
+
+#ifndef BOOST_NO_EXCEPTIONS
+
+        try
+        {
+            pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
+            new( static_cast< void* >( pi_ ) ) impl_type( p, a );
+        }
+        catch(...)
+        {
+            D()( p );
+
+            if( pi_ != 0 )
+            {
+                a2.deallocate( static_cast< impl_type* >( pi_ ), 1 );
+            }
+
+            throw;
+        }
+
+#else
+
+        pi_ = a2.allocate( 1, static_cast< impl_type* >( 0 ) );
+
+        if( pi_ != 0 )
+        {
+            new( static_cast< void* >( pi_ ) ) impl_type( p, a );
+        }
+        else
+        {
+            D()( p );
+            boost::throw_exception( std::bad_alloc() );
+        }
+
+#endif // #ifndef BOOST_NO_EXCEPTIONS
+    }
+
+#endif // !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
+
 #ifndef BOOST_NO_AUTO_PTR
 
     // auto_ptr<Y> is special cased to provide the strong guarantee
index 397421ae9fae05e5efa6d081333a86ed5f6e1dcf..aab39bdd03c14837aa0ecd3337acfadbc4170afe 100644 (file)
@@ -135,7 +135,11 @@ public:
 
     // pre: d(p) must not throw
 
-    sp_counted_impl_pd( P p, D d ): ptr(p), del(d)
+    sp_counted_impl_pd( P p, D & d ): ptr( p ), del( d )
+    {
+    }
+
+    sp_counted_impl_pd( P p ): ptr( p ), del()
     {
     }
 
@@ -195,7 +199,11 @@ public:
 
     // pre: d( p ) must not throw
 
-    sp_counted_impl_pda( P p, D d, A a ): p_( p ), d_( d ), a_( a )
+    sp_counted_impl_pda( P p, D & d, A a ): p_( p ), d_( d ), a_( a )
+    {
+    }
+
+    sp_counted_impl_pda( P p, A a ): p_( p ), d_(), a_( a )
     {
     }
 
index 7fcd09ef08bf89f62b1be1d20bf08c194b0b2f8a..31cedbce3dce296e61ad44a661184edbb7066ed1 100644 (file)
@@ -20,7 +20,7 @@
 //  are available.
 //
 
-#if defined(__GNUC__) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 )
+#if defined( __GNUC__ ) && ( __GNUC__ * 100 + __GNUC_MINOR__ >= 401 ) && !defined( BOOST_SP_NO_SYNC )
 
 #define BOOST_SP_HAS_SYNC
 
index 1640a38d4944a72f5b65252a4d3341917b642553..88d7ad62c7f730a8ba881049001409dacb2a803f 100644 (file)
 #include <boost/config.hpp>
 #include <boost/smart_ptr/detail/sp_has_sync.hpp>
 
-#if defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
+#if defined( BOOST_SP_USE_PTHREADS )
+#  include <boost/smart_ptr/detail/spinlock_pt.hpp>
+
+#elif defined(__GNUC__) && defined( __arm__ ) && !defined( __thumb__ )
 #  include <boost/smart_ptr/detail/spinlock_gcc_arm.hpp>
 
 #elif defined( BOOST_SP_HAS_SYNC )
index 0e2e08ac80a8cc985bcf49a7a01d5cabf616ac2a..f09d5c64019d528c8a69686da7f794870a03360e 100644 (file)
@@ -41,7 +41,11 @@ public:
 
     static spinlock & spinlock_for( void const * pv )
     {
+#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64  
+        std::size_t i = reinterpret_cast< unsigned long long >( pv ) % 41;
+#else  
         std::size_t i = reinterpret_cast< std::size_t >( pv ) % 41;
+#endif  
         return pool_[ i ];
     }
 
index e72eb2186985d93acbb9387e874895a23bdf1e79..2fa467069e765e9e1f0068fab75a6689edb1c740 100644 (file)
 
 #include <boost/config.hpp>
 
-#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
-# pragma warning(push)
-# pragma warning(disable:4284) // odd return type for operator->
-#endif
-
 #include <boost/assert.hpp>
 #include <boost/detail/workaround.hpp>
 #include <boost/smart_ptr/detail/sp_convertible.hpp>
@@ -292,8 +287,4 @@ template<class E, class T, class Y> std::basic_ostream<E, T> & operator<< (std::
 
 } // namespace boost
 
-#ifdef BOOST_MSVC
-# pragma warning(pop)
-#endif    
-
 #endif  // #ifndef BOOST_SMART_PTR_INTRUSIVE_PTR_HPP_INCLUDED
index c4ed28af9a0a0a4d76303f10ad25d4b27ceb365e..7b605e2abc8cb6bc660299c959bd0387a8144c04 100644 (file)
@@ -49,7 +49,18 @@ private:
     {
         if( initialized_ )
         {
+#if defined( __GNUC__ )
+
+            // fixes incorrect aliasing warning
+            T * p = reinterpret_cast< T* >( storage_.data_ );
+            p->~T();
+
+#else
+
             reinterpret_cast< T* >( storage_.data_ )->~T();
+
+#endif
+
             initialized_ = false;
         }
     }
@@ -97,13 +108,19 @@ template< class T > T&& sp_forward( T & t )
 
 } // namespace detail
 
+#if !defined( BOOST_NO_FUNCTION_TEMPLATE_ORDERING )
+# define BOOST_SP_MSD( T ) boost::detail::sp_inplace_tag< boost::detail::sp_ms_deleter< T > >()
+#else
+# define BOOST_SP_MSD( T ) boost::detail::sp_ms_deleter< T >()
+#endif
+
 // Zero-argument versions
 //
 // Used even when variadic templates are available because of the new T() vs new T issue
 
 template< class T > boost::shared_ptr< T > make_shared()
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -120,7 +137,7 @@ template< class T > boost::shared_ptr< T > make_shared()
 
 template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -141,7 +158,7 @@ template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a
 
 template< class T, class Arg1, class... Args > boost::shared_ptr< T > make_shared( Arg1 && arg1, Args && ... args )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -158,7 +175,7 @@ template< class T, class Arg1, class... Args > boost::shared_ptr< T > make_share
 
 template< class T, class A, class Arg1, class... Args > boost::shared_ptr< T > allocate_shared( A const & a, Arg1 && arg1, Args && ... args )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -173,6 +190,460 @@ template< class T, class A, class Arg1, class... Args > boost::shared_ptr< T > a
     return boost::shared_ptr< T >( pt, pt2 );
 }
 
+#elif defined( BOOST_HAS_RVALUE_REFS )
+
+// For example MSVC 10.0
+
+template< class T, class A1 >
+boost::shared_ptr< T > make_shared( A1 && a1 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 ), 
+        boost::detail::sp_forward<A8>( a8 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 ), 
+        boost::detail::sp_forward<A8>( a8 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
+boost::shared_ptr< T > make_shared( A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T(
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 ), 
+        boost::detail::sp_forward<A8>( a8 ), 
+        boost::detail::sp_forward<A9>( a9 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
+template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
+boost::shared_ptr< T > allocate_shared( A const & a, A1 && a1, A2 && a2, A3 && a3, A4 && a4, A5 && a5, A6 && a6, A7 && a7, A8 && a8, A9 && a9 )
+{
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
+
+    boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
+
+    void * pv = pd->address();
+
+    ::new( pv ) T( 
+        boost::detail::sp_forward<A1>( a1 ), 
+        boost::detail::sp_forward<A2>( a2 ), 
+        boost::detail::sp_forward<A3>( a3 ), 
+        boost::detail::sp_forward<A4>( a4 ), 
+        boost::detail::sp_forward<A5>( a5 ), 
+        boost::detail::sp_forward<A6>( a6 ), 
+        boost::detail::sp_forward<A7>( a7 ), 
+        boost::detail::sp_forward<A8>( a8 ), 
+        boost::detail::sp_forward<A9>( a9 )
+        );
+
+    pd->set_initialized();
+
+    T * pt2 = static_cast< T* >( pv );
+
+    boost::detail::sp_enable_shared_from_this( &pt, pt2, pt2 );
+    return boost::shared_ptr< T >( pt, pt2 );
+}
+
 #else
 
 // C++03 version
@@ -180,7 +651,7 @@ template< class T, class A, class Arg1, class... Args > boost::shared_ptr< T > a
 template< class T, class A1 >
 boost::shared_ptr< T > make_shared( A1 const & a1 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -198,7 +669,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1 )
 template< class T, class A, class A1 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -216,7 +687,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
 template< class T, class A1, class A2 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -234,7 +705,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
 template< class T, class A, class A1, class A2 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -252,7 +723,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -270,7 +741,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3
 template< class T, class A, class A1, class A2, class A3 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -288,7 +759,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -306,7 +777,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -324,7 +795,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4, class A5 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -342,7 +813,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -360,7 +831,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -378,7 +849,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -396,7 +867,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -414,7 +885,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -432,7 +903,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -450,7 +921,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -468,7 +939,7 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
 boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ) );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -486,7 +957,7 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
 template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
 boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
 {
-    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
+    boost::shared_ptr< T > pt( static_cast< T* >( 0 ), BOOST_SP_MSD( T ), a );
 
     boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
 
@@ -503,6 +974,8 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
 
 #endif
 
+#undef BOOST_SP_MSD
+
 } // namespace boost
 
 #endif // #ifndef BOOST_SMART_PTR_MAKE_SHARED_HPP_INCLUDED
index 609cce903221ab5687ccbabc9d651348e883dc76..100f1a888bd2e294523dac4f36056851bca4e12e 100644 (file)
@@ -41,6 +41,7 @@
 #include <algorithm>            // for std::swap
 #include <functional>           // for std::less
 #include <typeinfo>             // for std::bad_cast
+#include <cstddef>              // for std::size_t
 
 #if !defined(BOOST_NO_IOSTREAM)
 #if !defined(BOOST_NO_IOSFWD)
 #endif
 #endif
 
-#ifdef BOOST_MSVC  // moved here to work around VC++ compiler crash
-# pragma warning(push)
-# pragma warning(disable:4284) // odd return type for operator->
-#endif
-
 namespace boost
 {
 
@@ -688,13 +684,18 @@ template<class T> inline bool atomic_compare_exchange_explicit( shared_ptr<T> *
     return atomic_compare_exchange( p, v, w ); // std::move( w )
 }
 
-#endif
+#endif // !defined(BOOST_SP_NO_ATOMIC_ACCESS)
 
-} // namespace boost
+// hash_value
 
-#ifdef BOOST_MSVC
-# pragma warning(pop)
-#endif
+template< class T > struct hash;
+
+template< class T > std::size_t hash_value( boost::shared_ptr<T> const & p )
+{
+    return boost::hash< T* >()( p.get() );
+}
+
+} // namespace boost
 
 #endif  // #if defined(BOOST_NO_MEMBER_TEMPLATES) && !defined(BOOST_MSVC6_MEMBER_TEMPLATES)
 
index 50f8330258eebaa9e205206465f69543d31864c0..4d1a1dfcfbd9df49cc46a88235adee6297238c9b 100644 (file)
@@ -209,6 +209,36 @@ namespace boost{
   // Assuming that the conditional will always get optimized out in the function
   // implementations, argument types are not a problem since both forms of character classifiers
   // expect an int.
+   
+#if !defined(BOOST_NO_CWCTYPE)
+  template<typename traits, int N>
+  struct traits_extension_details : public traits {
+    typedef typename traits::char_type char_type;
+    static bool isspace(char_type c)
+    {
+       return std::iswspace(c) != 0;
+    }
+    static bool ispunct(char_type c)
+    {
+       return std::iswpunct(c) != 0;
+    }
+  };
+
+  template<typename traits>
+  struct traits_extension_details<traits, 1> : public traits {
+    typedef typename traits::char_type char_type;
+    static bool isspace(char_type c)
+    {
+       return std::isspace(c) != 0;
+    }
+    static bool ispunct(char_type c)
+    {
+       return std::ispunct(c) != 0;
+    }
+  };
+#endif
+
+    
   // In case there is no cwctype header, we implement the checks manually.
   // We make use of the fact that the tested categories should fit in ASCII.
   template<typename traits>
@@ -217,10 +247,7 @@ namespace boost{
     static bool isspace(char_type c)
     {
 #if !defined(BOOST_NO_CWCTYPE)
-      if (sizeof(char_type) == 1)
-        return std::isspace(static_cast<int>(c)) != 0;
-      else
-        return std::iswspace(static_cast<std::wint_t>(c)) != 0;
+      return traits_extension_details<traits, sizeof(char_type)>::isspace(c);
 #else
       return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0;
 #endif
@@ -229,10 +256,7 @@ namespace boost{
     static bool ispunct(char_type c)
     {
 #if !defined(BOOST_NO_CWCTYPE)
-      if (sizeof(char_type) == 1)
-        return std::ispunct(static_cast<int>(c)) != 0;
-      else
-        return std::iswpunct(static_cast<std::wint_t>(c)) != 0;
+      return traits_extension_details<traits, sizeof(char_type)>::ispunct(c);
 #else
       return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0;
 #endif
index 06a2339297d0c4cdb7c1ea6289f6cfc9558562e4..c549716ebd17af7150fb8c6683736a6a5f2b287f 100644 (file)
@@ -29,6 +29,8 @@
 #include <ostream>
 #endif  
 
+#include <sstream>
+
 #include "boost/tuple/tuple.hpp"
 
 // This is ugly: one should be using twoargument isspace since whitspace can
@@ -244,6 +246,22 @@ print(std::ostream& o, const cons<T1, T2>& t) {
 
 }
 
+template<class T>
+inline bool handle_width(std::ostream& o, const T& t) {
+    std::streamsize width = o.width();
+    if(width == 0) return false;
+
+    std::ostringstream ss;
+
+    ss.copyfmt(o);
+    ss.tie(0);
+    ss.width(0);
+
+    ss << t;
+    o << ss.str();
+
+    return true;
+}
 
 
 #else
@@ -280,6 +298,23 @@ print(std::basic_ostream<CharType, CharTrait>& o, const cons<T1, T2>& t) {
   return print(o, t.tail);
 }
 
+template<class CharT, class Traits, class T>
+inline bool handle_width(std::basic_ostream<CharT, Traits>& o, const T& t) {
+    std::streamsize width = o.width();
+    if(width == 0) return false;
+
+    std::basic_ostringstream<CharT, Traits> ss;
+
+    ss.copyfmt(o);
+    ss.tie(0);
+    ss.width(0);
+
+    ss << t;
+    o << ss.str();
+
+    return true;
+}
+
 #endif  // BOOST_NO_TEMPLATED_STREAMS
 
 } // namespace detail
@@ -288,6 +323,7 @@ print(std::basic_ostream<CharType, CharTrait>& o, const cons<T1, T2>& t) {
 
 inline std::ostream& operator<<(std::ostream& o, const null_type& t) {
   if (!o.good() ) return o;
+  if (detail::handle_width(o, t)) return o;
  
   const char l = 
     detail::format_info::get_manipulator(o, detail::format_info::open);
@@ -303,6 +339,7 @@ inline std::ostream& operator<<(std::ostream& o, const null_type& t) {
 template<class T1, class T2>
 inline std::ostream& operator<<(std::ostream& o, const cons<T1, T2>& t) {
   if (!o.good() ) return o;
+  if (detail::handle_width(o, t)) return o;
  
   const char l = 
     detail::format_info::get_manipulator(o, detail::format_info::open);
@@ -325,6 +362,7 @@ inline std::basic_ostream<CharType, CharTrait>&
 operator<<(std::basic_ostream<CharType, CharTrait>& o, 
            const null_type& t) {
   if (!o.good() ) return o;
+  if (detail::handle_width(o, t)) return o;
  
   const CharType l = 
     detail::format_info::get_manipulator(o, detail::format_info::open);
@@ -342,6 +380,7 @@ inline std::basic_ostream<CharType, CharTrait>&
 operator<<(std::basic_ostream<CharType, CharTrait>& o, 
            const cons<T1, T2>& t) {
   if (!o.good() ) return o;
+  if (detail::handle_width(o, t)) return o;
  
   const CharType l = 
     detail::format_info::get_manipulator(o, detail::format_info::open);
index 00b723ccd52f943550a459f5070b2f240e78a807..2be58f6a9825374433e14cefd6baad56bfbc2228 100644 (file)
@@ -28,7 +28,7 @@
 // shall name T&&; otherwise, type shall name T. [ Note: This rule reflects
 // the semantics of reference collapsing. For example, when a type T names
 // a type T1&, the type add_rvalue_reference<T>::type is not an rvalue
-// reference. \97end note ]
+// reference. -end note ]
 //----------------------------------------------------------------------------//
 
 namespace boost {
@@ -65,3 +65,4 @@ BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_
 #include <boost/type_traits/detail/type_trait_undef.hpp>
 
 #endif  // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP
+
index 51357ce5608211e1d43d1e5c4e385ec530302a86..e1735dcc68b5edebbcfdf417a6acd9274ea6d1df 100644 (file)
@@ -93,7 +93,7 @@ BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(alignment_of,T,::boost::detail::alignment_of_impl
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 template <typename T>
 struct alignment_of<T&>
-    : alignment_of<T*>
+    : public alignment_of<T*>
 {
 };
 #endif
index 74b036369ff80c162e1a80d04ecf71bffa27beaf..27396888de166ac6961357efc928e50e010a7f24 100644 (file)
 
 #include <boost/config.hpp>
 
-#ifdef __SUNPRO_CC
+#if defined(__SUNPRO_CC) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
 #  define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
 #endif
-#ifdef __IBMCPP__
+#if defined(__IBMCPP__) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
 #  define BOOST_COMMON_TYPE_DONT_USE_TYPEOF
 #endif
 
 //----------------------------------------------------------------------------//
-#if defined(BOOST_NO_VARIADIC_TEMPLATES)
+#if defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_COMMON_TYPE_ARITY)
 #define BOOST_COMMON_TYPE_ARITY 3
 #endif
 
 //----------------------------------------------------------------------------//
-#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF)
+#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) && !defined(BOOST_TYPEOF_SILENT)
 #define BOOST_TYPEOF_SILENT
 #include <boost/typeof/typeof.hpp>   // boost wonders never cease!
 #endif
@@ -141,7 +141,7 @@ namespace type_traits_detail {
     template <class T, class U>
     struct common_type<T, U, void>
 #endif
-    : type_traits_detail::common_type_2<T,U>
+    : public type_traits_detail::common_type_2<T,U>
     { };
 
 
index 19bb18cec701feec562c8289541200cfc55cbda4..88c6899753ca244ba08f4d3693dcaaa042b48db0 100644 (file)
@@ -8,8 +8,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 // $Source$
-// $Date: 2006-07-12 07:10:22 -0400 (Wed, 12 Jul 2006) $
-// $Revision: 34511 $
+// $Date: 2011-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $
+// $Revision: 71481 $
 
 #include <boost/type_traits/detail/template_arity_spec.hpp>
 #include <boost/type_traits/integral_constant.hpp>
@@ -60,7 +60,7 @@
 #endif
 
 #ifndef BOOST_TT_AUX_BOOL_C_BASE
-#   define BOOST_TT_AUX_BOOL_C_BASE(C) : ::boost::integral_constant<bool,C>
+#   define BOOST_TT_AUX_BOOL_C_BASE(C) : public ::boost::integral_constant<bool,C>
 #endif 
 
 
@@ -68,6 +68,7 @@
 template< typename T > struct trait \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
 }; \
@@ -80,6 +81,7 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
 template< typename T1, typename T2 > struct trait \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT(2,trait,(T1,T2)) \
 }; \
@@ -91,6 +93,7 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(2,trait) \
 template<> struct trait< sp > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(sp)) \
 }; \
@@ -100,6 +103,7 @@ template<> struct trait< sp > \
 template<> struct trait< sp1,sp2 > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
 }; \
@@ -108,6 +112,7 @@ template<> struct trait< sp1,sp2 > \
 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(trait,sp,C) \
 template<> struct trait##_impl< sp > \
 { \
+public:\
     BOOST_STATIC_CONSTANT(bool, value = (C)); \
 }; \
 /**/
@@ -115,6 +120,7 @@ template<> struct trait##_impl< sp > \
 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC2(trait,sp1,sp2,C) \
 template<> struct trait##_impl< sp1,sp2 > \
 { \
+public:\
     BOOST_STATIC_CONSTANT(bool, value = (C)); \
 }; \
 /**/
@@ -123,6 +129,7 @@ template<> struct trait##_impl< sp1,sp2 > \
 template< param > struct trait< sp > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
 }; \
 /**/
@@ -131,6 +138,7 @@ template< param > struct trait< sp > \
 template< param1, param2 > struct trait< sp > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
 }; \
 /**/
@@ -139,6 +147,7 @@ template< param1, param2 > struct trait< sp > \
 template< param > struct trait< sp1,sp2 > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(2,trait,(sp1,sp2)) \
 }; \
@@ -148,6 +157,7 @@ template< param > struct trait< sp1,sp2 > \
 template< param1, param2 > struct trait< sp1,sp2 > \
     BOOST_TT_AUX_BOOL_C_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
 }; \
 /**/
@@ -155,6 +165,7 @@ template< param1, param2 > struct trait< sp1,sp2 > \
 #define BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(param,trait,sp1,sp2,C) \
 template< param > struct trait##_impl< sp1,sp2 > \
 { \
+public:\
     BOOST_STATIC_CONSTANT(bool, value = (C)); \
 }; \
 /**/
index b3fa59505e5925312ca734fc79cb6a5ad3518479..ed20c9d41a35ce5e32ef21ddb4924ac74c1c021a 100644 (file)
@@ -77,7 +77,7 @@ namespace detail {
 // Use the implementation above for non function pointers
 template <typename T, unsigned Select 
   = (unsigned)sizeof(::boost::type_traits::gcc8503::mini_funcptr_tester((T)0)) >
-struct cv_traits_imp : ::boost::type_traits::gcc8503::cv_traits_imp<T> { };
+struct cv_traits_imp : public ::boost::type_traits::gcc8503::cv_traits_imp<T> { };
 
 // Functions are never cv-qualified
 template <typename T> struct cv_traits_imp<T*,1>
index 472c6ac1651b05c61d2bdd66d141961313a3e19d..23deeaff8d7dd238925878a361778c940cb0cae9 100644 (file)
@@ -8,8 +8,8 @@
 // http://www.boost.org/LICENSE_1_0.txt)
 
 // $Source$
-// $Date: 2005-08-25 12:27:28 -0400 (Thu, 25 Aug 2005) $
-// $Revision: 30670 $
+// $Date: 2011-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $
+// $Revision: 71481 $
 
 #include <boost/type_traits/detail/template_arity_spec.hpp>
 #include <boost/type_traits/integral_constant.hpp>
 #include <cstddef>
 
 #if !defined(BOOST_MSVC) || BOOST_MSVC >= 1300
-#   define BOOST_TT_AUX_SIZE_T_BASE(C) ::boost::integral_constant<std::size_t,C>
+#   define BOOST_TT_AUX_SIZE_T_BASE(C) public ::boost::integral_constant<std::size_t,C>
 #   define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/
 #else
-#   define BOOST_TT_AUX_SIZE_T_BASE(C) ::boost::mpl::size_t<C>
+#   define BOOST_TT_AUX_SIZE_T_BASE(C) public ::boost::mpl::size_t<C>
 #   define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \
     typedef ::boost::mpl::size_t<C> base_; \
     using base_::value; \
@@ -34,6 +34,7 @@
 template< typename T > struct trait \
     : BOOST_TT_AUX_SIZE_T_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
 }; \
@@ -45,6 +46,7 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
 template<> struct trait<spec> \
     : BOOST_TT_AUX_SIZE_T_BASE(C) \
 { \
+public:\
     BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \
     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \
 }; \
index 644c7ac90952f33687be6a315786ef34a5441f2a..3903f7f2773b468d9ca1c2dd6419e4b58b638801 100644 (file)
@@ -8,8 +8,8 @@
 // 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-04-25 08:26:48 -0400 (Mon, 25 Apr 2011) $
+// $Revision: 71481 $
 
 #include <boost/type_traits/detail/template_arity_spec.hpp>
 #include <boost/mpl/aux_/lambda_support.hpp>
@@ -17,6 +17,7 @@
 #define BOOST_TT_AUX_TYPE_TRAIT_DEF1(trait,T,result) \
 template< typename T > struct trait \
 { \
+public:\
     typedef result type; \
     BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \
 }; \
@@ -27,6 +28,7 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \
 #define BOOST_TT_AUX_TYPE_TRAIT_SPEC1(trait,spec,result) \
 template<> struct trait<spec> \
 { \
+public:\
     typedef result type; \
     BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \
 }; \
@@ -35,6 +37,7 @@ template<> struct trait<spec> \
 #define BOOST_TT_AUX_TYPE_TRAIT_IMPL_SPEC1(trait,spec,result) \
 template<> struct trait##_impl<spec> \
 { \
+public:\
     typedef result type; \
 }; \
 /**/
@@ -42,6 +45,7 @@ template<> struct trait##_impl<spec> \
 #define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,result) \
 template< param > struct trait<spec> \
 { \
+public:\
     typedef result type; \
 }; \
 /**/
@@ -49,6 +53,7 @@ template< param > struct trait<spec> \
 #define BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_2(param1,param2,trait,spec,result) \
 template< param1, param2 > struct trait<spec> \
 { \
+public:\
     typedef result; \
 }; \
 /**/
@@ -56,6 +61,7 @@ template< param1, param2 > struct trait<spec> \
 #define BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(param,trait,spec,result) \
 template< param > struct trait##_impl<spec> \
 { \
+public:\
     typedef result type; \
 }; \
 /**/
index 3cef7357d596c1f32869cb6508b7415e9510f2d5..83e59687a0b5118a0a306106e0dddb7d8c8a0147 100644 (file)
@@ -20,16 +20,22 @@ namespace detail{
 
 template <class T>
 struct has_nothrow_assign_imp{
-   BOOST_STATIC_CONSTANT(bool, value = 
-      (::boost::type_traits::ice_or<
-         ::boost::has_trivial_assign<T>::value,
-         BOOST_HAS_NOTHROW_ASSIGN(T)
-      >::value));
+#ifndef BOOST_HAS_NOTHROW_ASSIGN
+   BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_assign<T>::value);
+#else
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_ASSIGN(T));
+#endif
 };
 
 }
 
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_assign,T,::boost::detail::has_nothrow_assign_imp<T>::value)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_assign,void volatile,false)
+#endif
 
 } // namespace boost
 
index e807fd4385e249ce64aae733a4054371d1fa9ca5..3bc4f802c20040f9a37e953dd74c9483c9bc8a04 100644 (file)
@@ -20,11 +20,11 @@ namespace detail{
 
 template <class T>
 struct has_nothrow_constructor_imp{
-   BOOST_STATIC_CONSTANT(bool, value = 
-      (::boost::type_traits::ice_or<
-         ::boost::has_trivial_constructor<T>::value,
-         BOOST_HAS_NOTHROW_CONSTRUCTOR(T)
-      >::value));
+#ifdef BOOST_HAS_NOTHROW_CONSTRUCTOR
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_CONSTRUCTOR(T));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_constructor<T>::value);
+#endif
 };
 
 }
@@ -32,6 +32,20 @@ struct has_nothrow_constructor_imp{
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_default_constructor,T,::boost::detail::has_nothrow_constructor_imp<T>::value)
 
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_constructor,void volatile,false)
+#endif
+
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_default_constructor,void volatile,false)
+#endif
+
 } // namespace boost
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
index c06b4a3d0bb15aac67cc06ebb5899449134556a2..9c3c9030a40dcbda75ff323b98b1acefda78b458 100644 (file)
@@ -20,11 +20,11 @@ namespace detail{
 
 template <class T>
 struct has_nothrow_copy_imp{
-   BOOST_STATIC_CONSTANT(bool, value = 
-      (::boost::type_traits::ice_or<
-         ::boost::has_trivial_copy<T>::value,
-         BOOST_HAS_NOTHROW_COPY(T)
-      >::value));
+#ifdef BOOST_HAS_NOTHROW_COPY
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_NOTHROW_COPY(T));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = ::boost::has_trivial_copy<T>::value);
+#endif
 };
 
 }
@@ -32,6 +32,20 @@ struct has_nothrow_copy_imp{
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy,T,::boost::detail::has_nothrow_copy_imp<T>::value)
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_nothrow_copy_constructor,T,::boost::detail::has_nothrow_copy_imp<T>::value)
 
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy,void volatile,false)
+#endif
+
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_nothrow_copy_constructor,void volatile,false)
+#endif
+
 } // namespace boost
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
index 4179e8d747321847671c6e346c60b177bee98a07..404b62c70d30ad0f7bf44e7f5fd261a3d882affe 100644 (file)
@@ -28,20 +28,27 @@ namespace detail {
 template <typename T>
 struct has_trivial_assign_impl
 {
+#ifdef BOOST_HAS_TRIVIAL_ASSIGN
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_ASSIGN(T));
+#else
    BOOST_STATIC_CONSTANT(bool, value =
       (::boost::type_traits::ice_and<
-         ::boost::type_traits::ice_or<
-            ::boost::is_pod<T>::value,
-            BOOST_HAS_TRIVIAL_ASSIGN(T)
-         >::value,
-      ::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
+        ::boost::is_pod<T>::value,
+        ::boost::type_traits::ice_not< ::boost::is_const<T>::value >::value,
       ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
       >::value));
+#endif
 };
 
 } // namespace detail
 
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_assign,T,::boost::detail::has_trivial_assign_impl<T>::value)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_assign,void volatile,false)
+#endif
 
 } // namespace boost
 
index f9ade5d1d42cb8b2b1c5563689f009fea78ad89a..30dbdd8f93398b7b46020eb25e56eb4e700ffa55 100644 (file)
@@ -24,11 +24,19 @@ namespace detail {
 template <typename T>
 struct has_trivial_ctor_impl
 {
+#ifdef BOOST_HAS_TRIVIAL_CONSTRUCTOR
    BOOST_STATIC_CONSTANT(bool, value =
       (::boost::type_traits::ice_or<
          ::boost::is_pod<T>::value,
          BOOST_HAS_TRIVIAL_CONSTRUCTOR(T)
       >::value));
+#else
+   BOOST_STATIC_CONSTANT(bool, value =
+      (::boost::type_traits::ice_or<
+         ::boost::is_pod<T>::value,
+         false
+      >::value));
+#endif
 };
 
 } // namespace detail
index 8c753615d4c73e3bfe845f157b6d3406469a4298..ba4d8847e8888386ef4c5071b548a8e6bd04acde 100644 (file)
@@ -27,14 +27,15 @@ namespace detail {
 template <typename T>
 struct has_trivial_copy_impl
 {
+#ifdef BOOST_HAS_TRIVIAL_COPY
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_COPY(T));
+#else
    BOOST_STATIC_CONSTANT(bool, value =
       (::boost::type_traits::ice_and<
-         ::boost::type_traits::ice_or<
-            ::boost::is_pod<T>::value,
-            BOOST_HAS_TRIVIAL_COPY(T)
-         >::value,
-      ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
+         ::boost::is_pod<T>::value,
+         ::boost::type_traits::ice_not< ::boost::is_volatile<T>::value >::value
       >::value));
+#endif
 };
 
 } // namespace detail
@@ -42,6 +43,20 @@ struct has_trivial_copy_impl
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy,T,::boost::detail::has_trivial_copy_impl<T>::value)
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_copy_constructor,T,::boost::detail::has_trivial_copy_impl<T>::value)
 
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy,void volatile,false)
+#endif
+
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_copy_constructor,void volatile,false)
+#endif
+
 } // namespace boost
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
index f2a8ce681b1736bf3174d2de7e014a2b8ea5bb0c..79d7522fdc9a7cdce8cef305993aa856b61bc0da 100644 (file)
@@ -24,17 +24,24 @@ namespace detail {
 template <typename T>
 struct has_trivial_dtor_impl
 {
-   BOOST_STATIC_CONSTANT(bool, value =
-      (::boost::type_traits::ice_or<
-         ::boost::is_pod<T>::value,
-         BOOST_HAS_TRIVIAL_DESTRUCTOR(T)
-      >::value));
+#ifdef BOOST_HAS_TRIVIAL_DESTRUCTOR
+   BOOST_STATIC_CONSTANT(bool, value = BOOST_HAS_TRIVIAL_DESTRUCTOR(T));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = ::boost::is_pod<T>::value);
+#endif
 };
 
 } // namespace detail
 
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_trivial_destructor,T,::boost::detail::has_trivial_dtor_impl<T>::value)
 
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void,false)
+#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void const volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_SPEC1(has_trivial_destructor,void volatile,false)
+#endif
+
 } // namespace boost
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
index 8f99ff420f39b4eeabd05db0f70e807ffabd64ee..b741197d3a8195cc10d09507711a3bc81c102812 100644 (file)
 
 namespace boost {
 
+#ifdef BOOST_HAS_VIRTUAL_DESTRUCTOR
 BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,BOOST_HAS_VIRTUAL_DESTRUCTOR(T))
+#else
+BOOST_TT_AUX_BOOL_TRAIT_DEF1(has_virtual_destructor,T,false)
+#endif
 
 } // namespace boost
 
index a85e243b857e1ec850af3045c9c1cf9a09e547fa..2109b9c60d35f41e18ace7c9dc4ebb8220ed37b1 100755 (executable)
@@ -24,14 +24,14 @@ namespace boost {
 namespace type_traits { namespace detail {
 
 // 4.5/2
-template <class T> struct need_promotion : boost::is_enum<T> {};
+template <class T> struct need_promotion : public boost::is_enum<T> {};
 
 // 4.5/1
-template<> struct need_promotion<char              > : true_type {};
-template<> struct need_promotion<signed char       > : true_type {};
-template<> struct need_promotion<unsigned char     > : true_type {};
-template<> struct need_promotion<signed short int  > : true_type {};
-template<> struct need_promotion<unsigned short int> : true_type {};
+template<> struct need_promotion<char              > : public true_type {};
+template<> struct need_promotion<signed char       > : public true_type {};
+template<> struct need_promotion<unsigned char     > : public true_type {};
+template<> struct need_promotion<signed short int  > : public true_type {};
+template<> struct need_promotion<unsigned short int> : public true_type {};
 
 
 // Specializations for non-standard types.
@@ -39,7 +39,7 @@ template<> struct need_promotion<unsigned short int> : true_type {};
 
 #define BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(T) \
     template<> struct need_promotion<T>          \
-        : integral_constant<bool, (sizeof(T) < sizeof(int))> {};
+        : public integral_constant<bool, (sizeof(T) < sizeof(int))> {};
 
 // Same set of integral types as in boost/type_traits/is_integral.hpp.
 // Please, keep in sync.
@@ -72,13 +72,13 @@ BOOST_TT_AUX_PROMOTE_NONSTANDARD_TYPE(         __int64)
 
 #ifndef BOOST_NO_INTRINSIC_WCHAR_T
 // 4.5/2
-template<> struct need_promotion<wchar_t> : true_type {};
+template<> struct need_promotion<wchar_t> : public true_type {};
 #endif
 
 // 4.5/3 (integral bit-field) is not supported.
 
 // 4.5/4
-template<> struct need_promotion<bool> : true_type {};
+template<> struct need_promotion<bool> : public true_type {};
 
 
 // Get promoted type by index and cv qualifiers.
@@ -171,7 +171,7 @@ struct integral_promotion_impl
 
 template<class T>
 struct integral_promotion
-  : boost::mpl::eval_if<
+  : public boost::mpl::eval_if<
         need_promotion<BOOST_DEDUCED_TYPENAME remove_cv<T>::type>
       , integral_promotion_impl<T>
       , boost::mpl::identity<T>
index 9666456a559ca61da430fcfc8ee75e9e5233cfc5..6057249755c26976678e1b5f8576217a06b22aa0 100644 (file)
@@ -33,8 +33,6 @@
 // BOOST_HAS_VIRTUAL_DESTRUCTOR(T) should evaluate to true T has a virtual destructor
 //
 // The following can also be defined: when detected our implementation is greatly simplified.
-// Note that unlike the macros above these do not have default definitions, so we can use
-// #ifdef MACRONAME to detect when these are available.
 //
 // 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
 #   define BOOST_IS_POD(T) (__is_pod(T) && __has_trivial_constructor(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)
-#   define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
-#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
-#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
-#   define BOOST_HAS_NOTHROW_COPY(T) __has_nothrow_copy(T)
-#   define BOOST_HAS_NOTHROW_ASSIGN(T) __has_nothrow_assign(T)
+#   define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T)|| ( ::boost::is_pod<T>::value && !::boost::is_volatile<T>::value))
+#   define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) || ( ::boost::is_pod<T>::value && ! ::boost::is_const<T>::value && !::boost::is_volatile<T>::value))
+#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || ::boost::is_pod<T>::value)
+#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) || ::boost::has_trivial_constructor<T>::value)
+#   define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) || ::boost::has_trivial_copy<T>::value)
+#   define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) || ::boost::has_trivial_assign<T>::value)
 #   define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
 
 #   define BOOST_IS_ABSTRACT(T) __is_abstract(T)
 #   define BOOST_IS_BASE_OF(T,U) (__is_base_of(T,U) && !is_same<T,U>::value)
 #   define BOOST_IS_CLASS(T) __is_class(T)
-//  This one doesn't quite always do the right thing:
-//  #   define BOOST_IS_CONVERTIBLE(T,U) __is_convertible_to(T,U)
+#   define BOOST_IS_CONVERTIBLE(T,U) ((__is_convertible_to(T,U) || is_same<T,U>::value) && !__is_abstract(U))
 #   define BOOST_IS_ENUM(T) __is_enum(T)
 //  This one doesn't quite always do the right thing:
 //  #   define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T)
 #   include <boost/type_traits/is_reference.hpp>
 #   include <boost/type_traits/is_volatile.hpp>
 
+#ifdef BOOST_INTEL
+#  define BOOST_INTEL_TT_OPTS || is_pod<T>::value
+#else
+#  define BOOST_INTEL_TT_OPTS
+#endif
+
 #   define BOOST_IS_UNION(T) __is_union(T)
 #   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<T>::value)
-#   define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
-#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
-#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
-#   define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
-#   define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
+#   define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) ((__has_trivial_constructor(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value)
+#   define BOOST_HAS_TRIVIAL_COPY(T) ((__has_trivial_copy(T) BOOST_INTEL_TT_OPTS) && !is_reference<T>::value && ! ::boost::is_volatile<T>::value)
+#   define BOOST_HAS_TRIVIAL_ASSIGN(T) ((__has_trivial_assign(T) BOOST_INTEL_TT_OPTS) && ! ::boost::is_volatile<T>::value && ! ::boost::is_const<T>::value)
+#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) BOOST_INTEL_TT_OPTS)
+#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_constructor(T) BOOST_INTEL_TT_OPTS)
+#   define BOOST_HAS_NOTHROW_COPY(T) ((__has_nothrow_copy(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_reference<T>::value)
+#   define BOOST_HAS_NOTHROW_ASSIGN(T) ((__has_nothrow_assign(T) BOOST_INTEL_TT_OPTS) && !is_volatile<T>::value && !is_const<T>::value)
 #   define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
 
 #   define BOOST_IS_ABSTRACT(T) __is_abstract(T)
 #   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<T>::value)
-#   define BOOST_HAS_TRIVIAL_ASSIGN(T) __has_trivial_assign(T)
+#   define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy(T) && !is_reference<T>::value && && !is_volatile<T>::value)
+#   define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
 #   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) __has_trivial_destructor(T)
 #   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) __has_nothrow_constructor(T)
 #   define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy(T) && !is_volatile<T>::value && !is_reference<T>::value)
 #   define BOOST_IS_UNION(T) __is_union(T)
 #   define BOOST_IS_POD(T) __is_pod(T)
 #   define BOOST_IS_EMPTY(T) __is_empty(T)
-#   define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T) || is_void<T>::value)
-#   define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value || is_void<T>::value)
-#   define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value || is_void<T>::value)
-#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T) || is_void<T>::value)
-#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T) || is_void<T>::value)
-#   define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value || is_void<T>::value)
-#   define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value || is_void<T>::value)
+#   define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) (__has_trivial_default_constructor(T))
+#   define BOOST_HAS_TRIVIAL_COPY(T) (__has_trivial_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
+#   define BOOST_HAS_TRIVIAL_ASSIGN(T) (__has_trivial_assign(T) && !is_volatile<T>::value)
+#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) (__has_trivial_destructor(T))
+#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) (__has_nothrow_default_constructor(T))
+#   define BOOST_HAS_NOTHROW_COPY(T) (__has_nothrow_copy_constructor(T) && !is_volatile<T>::value && !is_reference<T>::value)
+#   define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile<T>::value)
 #   define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) __has_virtual_destructor(T)
 
 #   define BOOST_IS_ABSTRACT(T) __is_abstract(T)
 #   define BOOST_HAS_TYPE_TRAITS_INTRINSICS
 #endif
 
-#ifndef BOOST_IS_UNION
-#   define BOOST_IS_UNION(T) false
-#endif
-
-#ifndef BOOST_IS_POD
-#   define BOOST_IS_POD(T) false
-#endif
-
-#ifndef BOOST_IS_EMPTY
-#   define BOOST_IS_EMPTY(T) false
-#endif
-
-#ifndef BOOST_HAS_TRIVIAL_CONSTRUCTOR
-#   define BOOST_HAS_TRIVIAL_CONSTRUCTOR(T) false
-#endif
-
-#ifndef BOOST_HAS_TRIVIAL_COPY
-#   define BOOST_HAS_TRIVIAL_COPY(T) false
-#endif
-
-#ifndef BOOST_HAS_TRIVIAL_ASSIGN
-#   define BOOST_HAS_TRIVIAL_ASSIGN(T) false
-#endif
-
-#ifndef BOOST_HAS_TRIVIAL_DESTRUCTOR
-#   define BOOST_HAS_TRIVIAL_DESTRUCTOR(T) false
-#endif
-
-#ifndef BOOST_HAS_NOTHROW_CONSTRUCTOR
-#   define BOOST_HAS_NOTHROW_CONSTRUCTOR(T) false
-#endif
-
-#ifndef BOOST_HAS_NOTHROW_COPY
-#   define BOOST_HAS_NOTHROW_COPY(T) false
-#endif
-
-#ifndef BOOST_HAS_NOTHROW_ASSIGN
-#   define BOOST_HAS_NOTHROW_ASSIGN(T) false
-#endif
-
-#ifndef BOOST_HAS_VIRTUAL_DESTRUCTOR
-#   define BOOST_HAS_VIRTUAL_DESTRUCTOR(T) false
-#endif
-
 #endif // BOOST_TT_INTRINSICS_HPP_INCLUDED
 
 
index 99b0f3643a08d9f31f564632f9ac13082a2aab9c..f24b71a5392c21137952c87c900961302a4d7ead 100644 (file)
@@ -106,7 +106,7 @@ no_type is_const_tester(volatile void *);
 
 template <bool is_ref, bool array>
 struct is_const_helper
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -136,7 +136,7 @@ struct is_const_helper<false,true>
 
 template <typename T>
 struct is_const_impl
-    : is_const_helper<
+    : public is_const_helper<
           is_reference<T>::value
         , is_array<T>::value
         >::template result_<T>
index c05c297eaf9b8208c081aeec63e4c49ef52db9e6..0d42c469b3730d62c3843920c421545ac685e38c 100644 (file)
@@ -24,6 +24,7 @@
 #ifndef BOOST_NO_IS_ABSTRACT
 #include <boost/type_traits/is_abstract.hpp>
 #endif
+#include <boost/type_traits/add_rvalue_reference.hpp>
 
 #if defined(__MWERKS__)
 #include <boost/type_traits/is_function.hpp>
@@ -68,7 +69,7 @@ struct does_conversion_exist
     {
         static no_type BOOST_TT_DECL _m_check(...);
         static yes_type BOOST_TT_DECL _m_check(To);
-        static From _m_from;
+        static typename add_rvalue_reference<From>::type  _m_from;
         enum { value = sizeof( _m_check(_m_from) ) == sizeof(yes_type) };
     };
 };
@@ -84,7 +85,7 @@ struct does_conversion_exist<void>
 
 template <typename From, typename To>
 struct is_convertible_basic_impl
-    : does_conversion_exist<From>::template result_<To>
+    : public does_conversion_exist<From>::template result_<To>
 {
 };
 
@@ -106,7 +107,7 @@ struct is_convertible_impl
         static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(T);
     };
 
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
     static bool const value = sizeof( checker<To>::_m_check(_m_from) )
         == sizeof(::boost::type_traits::yes_type);
 #pragma option pop
@@ -131,7 +132,7 @@ template <typename T> struct checker
 template <typename From, typename To>
 struct is_convertible_basic_impl
 {
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
     static bool const value = sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )
         == sizeof(::boost::type_traits::yes_type);
 };
@@ -161,7 +162,7 @@ struct is_convertible_basic_impl
 {
     static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion ...);
     static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int);
-       static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
 
     BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from, 0) ) == sizeof(::boost::type_traits::yes_type)
@@ -185,7 +186,7 @@ struct is_convertible_basic_impl
     template <class T>
     static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion,  float, T);
     static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int, int);
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
 
     // Static constants sometime cause the conversion of _m_from to To to be
     // called. This doesn't happen with an enum.
@@ -215,7 +216,7 @@ struct is_convertible_basic_impl_aux<From,To,false /*FromIsFunctionRef*/>
 {
     static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(any_conversion ...);
     static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To, int);
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
 
     BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from, 0) ) == sizeof(::boost::type_traits::yes_type)
@@ -227,7 +228,7 @@ struct is_convertible_basic_impl_aux<From,To,true /*FromIsFunctionRef*/>
 {
     static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...);
     static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To);
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
     BOOST_STATIC_CONSTANT(bool, value =
         sizeof( _m_check(_m_from) ) == sizeof(::boost::type_traits::yes_type)
         );
@@ -252,7 +253,7 @@ struct is_convertible_basic_impl
 {
     static ::boost::type_traits::no_type BOOST_TT_DECL _m_check(...);
     static ::boost::type_traits::yes_type BOOST_TT_DECL _m_check(To);
-    static From _m_from;
+    static typename add_rvalue_reference<From>::type  _m_from;
 #ifdef BOOST_MSVC
 #pragma warning(push)
 #pragma warning(disable:4244)
@@ -402,14 +403,14 @@ struct is_convertible_impl_dispatch
 
 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void,false)
 #ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
 BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const,To,false)
 BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void volatile,To,false)
 BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename To,is_convertible,void const volatile,To,false)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,true)
-BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,true)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const,false)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void volatile,false)
+BOOST_TT_AUX_BOOL_TRAIT_IMPL_PARTIAL_SPEC2_1(typename From,is_convertible,From,void const volatile,false)
 #endif
 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
 
index 45c4e9e1eeb610314931b23fa9fc17e1e98eb954..8a2c5b8bc6b874d4b19f129cafdc987be095bf05 100644 (file)
 // should be always the last #include directive
 #include <boost/type_traits/detail/bool_trait_def.hpp>
 
+#ifndef BOOST_INTERNAL_IS_EMPTY
+#define BOOST_INTERNAL_IS_EMPTY(T) false
+#else
+#define BOOST_INTERNAL_IS_EMPTY(T) BOOST_IS_EMPTY(T)
+#endif
+
 namespace boost {
 
 namespace detail {
@@ -83,7 +89,7 @@ struct is_empty_impl
         bool, value = (
             ::boost::type_traits::ice_or<
               ::boost::detail::empty_helper<cvt,::boost::is_class<T>::value>::value
-              , BOOST_IS_EMPTY(cvt)
+              , BOOST_INTERNAL_IS_EMPTY(cvt)
             >::value
             ));
 };
@@ -118,7 +124,7 @@ struct is_empty_impl
                 , ::boost::is_class<T>::value
                 , ::boost::is_convertible< r_type,int>::value
               >::value
-              , BOOST_IS_EMPTY(cvt)
+              , BOOST_INTERNAL_IS_EMPTY(cvt)
            >::value));
 };
 
@@ -187,14 +193,14 @@ struct is_empty_impl
    typedef typename result::type eh_type;
 
    BOOST_STATIC_CONSTANT(bool, value =
-      (::boost::type_traits::ice_or<eh_type::value, BOOST_IS_EMPTY(T)>::value));
+      (::boost::type_traits::ice_or<eh_type::value, BOOST_INTERNAL_IS_EMPTY(T)>::value));
 };
 
 #else
 
 template <typename T> struct is_empty_impl
 {
-    BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_EMPTY(T));
+    BOOST_STATIC_CONSTANT(bool, value = BOOST_INTERNAL_IS_EMPTY(T));
 };
 
 #endif  // BOOST_MSVC6_MEMBER_TEMPLATES
@@ -217,5 +223,7 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_empty,T,::boost::detail::is_empty_impl<T>::value
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
 
+#undef BOOST_INTERNAL_IS_EMPTY
+
 #endif // BOOST_TT_IS_EMPTY_HPP_INCLUDED
 
index 86fa66d998b969a64f7594f360b32284aaf7b2b3..e35548c54550bdd9e80e90f6c2334afd19167b89 100644 (file)
@@ -95,7 +95,7 @@ template <>
 struct is_enum_helper<false>
 {
     template <typename T> struct type
-       : ::boost::is_convertible<typename boost::add_reference<T>::type,::boost::detail::int_convertible>
+       : public ::boost::is_convertible<typename boost::add_reference<T>::type,::boost::detail::int_convertible>
     {
     };
 };
index 55c05c156421a2264ea2ea5e48e47700086c4232..2cb1bb92d6516b75c27e6b192b69ea1b6616a888 100644 (file)
@@ -40,7 +40,7 @@ namespace detail {
 #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_TT_TEST_MS_FUNC_SIGS)
 template<bool is_ref = true>
 struct is_function_chooser
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -48,14 +48,14 @@ template <>
 struct is_function_chooser<false>
 {
     template< typename T > struct result_
-        : ::boost::type_traits::is_function_ptr_helper<T*>
+        : public ::boost::type_traits::is_function_ptr_helper<T*>
     {
     };
 };
 
 template <typename T>
 struct is_function_impl
-    : is_function_chooser< ::boost::is_reference<T>::value >
+    : public is_function_chooser< ::boost::is_reference<T>::value >
         ::BOOST_NESTED_TEMPLATE result_<T>
 {
 };
index 6aff7dd19c44dd3ad6d1ce168f55807c80334391..138e29688763462ef976706f322e72136d2cf015 100644 (file)
@@ -22,7 +22,7 @@ namespace detail {
 
 template <typename T> 
 struct is_fundamental_impl
-    : ::boost::type_traits::ice_or< 
+    : public ::boost::type_traits::ice_or< 
           ::boost::is_arithmetic<T>::value
         , ::boost::is_void<T>::value
         >
index 81f1eacc9cdd1f632a2a19a8f35babfbaecc30f9..38babf43a4f333d253501c2709e73f25ffe1b34b 100644 (file)
@@ -55,7 +55,7 @@ namespace detail {
 
 template <bool>
 struct is_mem_fun_pointer_select
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -83,7 +83,7 @@ struct is_mem_fun_pointer_select<false>
 
 template <typename T>
 struct is_member_function_pointer_impl
-    : is_mem_fun_pointer_select<
+    : public is_mem_fun_pointer_select<
           ::boost::type_traits::ice_or<
               ::boost::is_reference<T>::value
             , ::boost::is_array<T>::value
index ba02b89ba27ef1ec64c8ac9f2de408d5a1691d80..a4a6d25a7e69ebda1175bc58dece839a39e18c22 100644 (file)
@@ -66,7 +66,7 @@ template <typename R, typename T>
 
 template <bool>
 struct is_member_pointer_select
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -87,7 +87,7 @@ struct is_member_pointer_select<false>
 
 template <typename T>
 struct is_member_pointer_impl
-    : is_member_pointer_select<
+    : public is_member_pointer_select<
           ::boost::type_traits::ice_or<
               ::boost::is_reference<T>::value
             , ::boost::is_array<T>::value
index af2c3c4aeb05b9117c4c723890c10f2c079fa082..4691e662fe446b338d31542acc77a6d09d3f7203 100644 (file)
 // should be the last #include
 #include <boost/type_traits/detail/bool_trait_def.hpp>
 
+#ifndef BOOST_IS_POD
+#define BOOST_INTERNAL_IS_POD(T) false
+#else
+#define BOOST_INTERNAL_IS_POD(T) BOOST_IS_POD(T)
+#endif
+
 namespace boost {
 
 // forward declaration, needed by 'is_pod_array_helper' template below
@@ -36,14 +42,14 @@ template <typename T> struct is_pod_impl
         (::boost::type_traits::ice_or<
             ::boost::is_scalar<T>::value,
             ::boost::is_void<T>::value,
-            BOOST_IS_POD(T)
+            BOOST_INTERNAL_IS_POD(T)
          >::value));
 };
 
 #if !defined(BOOST_NO_ARRAY_TYPE_SPECIALIZATIONS)
 template <typename T, std::size_t sz>
 struct is_pod_impl<T[sz]>
-    : is_pod_impl<T>
+    : public is_pod_impl<T>
 {
 };
 #endif
@@ -60,7 +66,7 @@ struct is_pod_helper
             (::boost::type_traits::ice_or<
                 ::boost::is_scalar<T>::value,
                 ::boost::is_void<T>::value,
-                BOOST_IS_POD(T)
+                BOOST_INTERNAL_IS_POD(T)
             >::value));
     };
 };
@@ -132,4 +138,6 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_pod,T,::boost::detail::is_pod_impl<T>::value)
 
 #include <boost/type_traits/detail/bool_trait_undef.hpp>
 
+#undef BOOST_INTERNAL_IS_POD
+
 #endif // BOOST_TT_IS_POD_HPP_INCLUDED
index f6ecf336f0205c73b19c3409c7f0d2d0bd7f9481..4e29bb39dd781c56cb93a8b8e1fa2b8ec8349550 100644 (file)
@@ -113,7 +113,7 @@ no_type BOOST_TT_DECL is_pointer_tester(...);
 
 template <bool>
 struct is_pointer_select
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -133,7 +133,7 @@ struct is_pointer_select<false>
 
 template <typename T>
 struct is_pointer_impl
-    : is_pointer_select<
+    : public is_pointer_select<
           ::boost::type_traits::ice_or<
               ::boost::is_reference<T>::value
             , ::boost::is_array<T>::value
index 25bddccfe1a7fcbf20caac47ca2190c9640d41a4..610f162ba41cc619f8f3f389836498368b57f76c 100644 (file)
@@ -25,7 +25,11 @@ namespace detail {
 template <typename T> struct is_union_impl
 {
    typedef typename remove_cv<T>::type cvt;
+#ifdef BOOST_IS_UNION
    BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(cvt));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = false);
+#endif
 };
 #else
 //
@@ -35,7 +39,11 @@ template <typename T> struct is_union_impl
 //
 template <typename T> struct is_union_impl
 {
+#ifdef BOOST_IS_UNION
    BOOST_STATIC_CONSTANT(bool, value = BOOST_IS_UNION(T));
+#else
+   BOOST_STATIC_CONSTANT(bool, value = false);
+#endif
 };
 #endif
 } // namespace detail
index 8dcd988edd70c2d3ca2c2c14577d8e514c0922cd..ffb021e69e1e3cc11bbef919391fd642f75ddf2d 100644 (file)
@@ -52,14 +52,14 @@ struct is_virtual_base_of_impl<Base, Derived, mpl::true_>
        ~boost_type_traits_internal_struct_Y()throw();
     };
 #else
-    struct boost_type_traits_internal_struct_X : Derived, virtual Base 
+    struct boost_type_traits_internal_struct_X : public Derived, virtual Base 
     {
        boost_type_traits_internal_struct_X();
        boost_type_traits_internal_struct_X(const boost_type_traits_internal_struct_X&);
        boost_type_traits_internal_struct_X& operator=(const boost_type_traits_internal_struct_X&);
        ~boost_type_traits_internal_struct_X()throw();
     };
-    struct boost_type_traits_internal_struct_Y : Derived 
+    struct boost_type_traits_internal_struct_Y : public Derived 
     {
        boost_type_traits_internal_struct_Y();
        boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&);
index 43c3a8b65fc434c05842cae3ad35db5b66c7c078..863747da6e181536801a525098888896c2f73bac 100644 (file)
@@ -94,7 +94,7 @@ no_type is_volatile_tester(void const*);
 
 template <bool is_ref, bool array>
 struct is_volatile_helper
-    : ::boost::type_traits::false_result
+    : public ::boost::type_traits::false_result
 {
 };
 
@@ -124,7 +124,7 @@ struct is_volatile_helper<false,true>
 
 template <typename T>
 struct is_volatile_impl
-    : is_volatile_helper<
+    : public is_volatile_helper<
           is_reference<T>::value
         , is_array<T>::value
         >::template result_<T>
index ebb0e803f600bf8dd15f3241f823979a6944bbed..b95785d521ff22a77d39f0c485b5ea176c06822c 100755 (executable)
@@ -20,7 +20,7 @@ namespace boost { namespace detail {
         };
 
         template<typename T, typename ID>
-        struct msvc_register_type : msvc_extract_type<ID>
+        struct msvc_register_type : public msvc_extract_type<ID>
         {
             template<>
             struct id2type_impl<true>  //VC7.0 specific bugfeature
@@ -36,7 +36,7 @@ namespace boost { namespace detail {
         };
 
         template<typename T, typename ID>
-        struct msvc_register_type : msvc_extract_type<ID>
+        struct msvc_register_type : public msvc_extract_type<ID>
         {
             typedef msvc_extract_type<ID> base_type;
             struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature
index 14efad47eefd0b3d61560b3d0ed8391ea63ca1e5..60f6278badb9e8491c18b2533dff4e545576822b 100755 (executable)
@@ -19,7 +19,7 @@ namespace detail {
 
 template<class T>
 struct promote_impl
-  : integral_promotion<
+  : public integral_promotion<
         BOOST_DEDUCED_TYPENAME floating_point_promotion<T>::type
       >
 {
index 53599928c1018063a891a35a445f285df7ff2970..01253db8f221150cb1d19547e363f40b83133da7 100644 (file)
@@ -9,12 +9,17 @@
 #ifndef BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
 #define BOOST_TT_REMOVE_POINTER_HPP_INCLUDED
 
-#include <boost/type_traits/broken_compiler_spec.hpp>
 #include <boost/config.hpp>
 #include <boost/detail/workaround.hpp>
+#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#include <boost/type_traits/broken_compiler_spec.hpp>
+#endif
 
 #if BOOST_WORKAROUND(BOOST_MSVC,<=1300)
 #include <boost/type_traits/msvc/remove_pointer.hpp>
+#elif defined(BOOST_MSVC)
+#include <boost/type_traits/remove_cv.hpp>
+#include <boost/type_traits/is_pointer.hpp>
 #endif
 
 // should be the last #include
 
 namespace boost {
 
-#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
+#ifdef BOOST_MSVC
+
+namespace detail{
+
+   //
+   // We need all this crazy indirection because a type such as:
+   //
+   // T (*const)(U)
+   //
+   // Does not bind to a <T*> or <T*const> partial specialization with VC10 and earlier
+   //
+   template <class T> 
+   struct remove_pointer_imp
+   {
+      typedef T type;
+   };
+
+   template <class T> 
+   struct remove_pointer_imp<T*>
+   {
+      typedef T type;
+   };
+
+   template <class T, bool b> 
+   struct remove_pointer_imp3
+   {
+      typedef typename remove_pointer_imp<typename boost::remove_cv<T>::type>::type type;
+   };
+
+   template <class T> 
+   struct remove_pointer_imp3<T, false>
+   {
+      typedef T type;
+   };
+
+   template <class T> 
+   struct remove_pointer_imp2
+   {
+      typedef typename remove_pointer_imp3<T, ::boost::is_pointer<T>::value>::type type;
+   };
+}
+
+BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,typename boost::detail::remove_pointer_imp2<T>::type)
+
+#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
 
 BOOST_TT_AUX_TYPE_TRAIT_DEF1(remove_pointer,T,T)
 BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,remove_pointer,T*,T)
index ac31055dc8bde6d83107f9d3ed0d90ce1b1a6578..5de3bce3f5a98d25ae6fceac64ed9ec74c7f6047 100644 (file)
@@ -86,7 +86,7 @@ struct lower_alignment_helper_impl<false>
 {
     template <std::size_t target, class TestType>
     struct apply
-      : mpl::if_c<(alignment_of<TestType>::value == target), TestType, char>
+      : public mpl::if_c<(alignment_of<TestType>::value == target), TestType, char>
     {
         enum { value = (alignment_of<TestType>::value == target) };
     };
@@ -94,7 +94,7 @@ struct lower_alignment_helper_impl<false>
 
 template <bool found, std::size_t target, class TestType>
 struct lower_alignment_helper
-  : lower_alignment_helper_impl<found>::template apply<target,TestType>
+  : public lower_alignment_helper_impl<found>::template apply<target,TestType>
 {
 };
 #else
index c80d4282250e7e6dda6443b99d580b290325afee..041e37d697b70c6e8f89cceca77e31e3fb7416e9 100644 (file)
@@ -19,7 +19,7 @@
 //  BOOST_VERSION / 100 % 1000 is the minor version
 //  BOOST_VERSION / 100000 is the major version
 
-#define BOOST_VERSION 104601
+#define BOOST_VERSION 104700
 
 //
 //  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 <config/auto_link.hpp> to select which library version to link to.
 
-#define BOOST_LIB_VERSION "1_46_1"
+#define BOOST_LIB_VERSION "1_47"
 
 #endif