diff --git a/boost/boost/array.hpp b/boost/boost/array.hpp index 7df2771475..85b63a2800 100644 --- a/boost/boost/array.hpp +++ b/boost/boost/array.hpp @@ -13,6 +13,7 @@ * accompanying file LICENSE_1_0.txt or copy at * http://www.boost.org/LICENSE_1_0.txt) * + * 28 Dec 2010 - (mtc) Added cbegin and cend (and crbegin and crend) for C++Ox compatibility. * 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group. * See or Trac issue #3168 * Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow) @@ -69,10 +70,13 @@ namespace boost { typedef std::ptrdiff_t difference_type; // iterator support - iterator begin() { return elems; } - const_iterator begin() const { return elems; } - iterator end() { return elems+N; } - const_iterator end() const { return elems+N; } + iterator begin() { return elems; } + const_iterator begin() const { return elems; } + const_iterator cbegin() const { return elems; } + + iterator end() { return elems+N; } + const_iterator end() const { return elems+N; } + const_iterator cend() const { return elems+N; } // reverse iterator support #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) @@ -99,10 +103,17 @@ namespace boost { const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } + const_reverse_iterator crbegin() const { + return const_reverse_iterator(end()); + } + reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } + const_reverse_iterator crend() const { + return const_reverse_iterator(begin()); + } // operator[] reference operator[](size_type i) @@ -200,10 +211,13 @@ namespace boost { typedef std::ptrdiff_t difference_type; // iterator support - iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); } - const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } - iterator end() { return begin(); } - const_iterator end() const { return begin(); } + iterator begin() { return iterator( reinterpret_cast< T * >( this ) ); } + const_iterator begin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } + const_iterator cbegin() const { return const_iterator( reinterpret_cast< const T * >( this ) ); } + + iterator end() { return begin(); } + const_iterator end() const { return begin(); } + const_iterator cend() const { return cbegin(); } // reverse iterator support #if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) && !defined(BOOST_MSVC_STD_ITERATOR) && !defined(BOOST_NO_STD_ITERATOR_TRAITS) @@ -230,10 +244,17 @@ namespace boost { const_reverse_iterator rbegin() const { return const_reverse_iterator(end()); } + const_reverse_iterator crbegin() const { + return const_reverse_iterator(end()); + } + reverse_iterator rend() { return reverse_iterator(begin()); } const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } + const_reverse_iterator crend() const { + return const_reverse_iterator(begin()); + } // operator[] reference operator[](size_type /*i*/) @@ -346,7 +367,34 @@ namespace boost { x.swap(y); } - // Specific for boost::array: simply returns its elems data member. +#if defined(__SUNPRO_CC) +// Trac ticket #4757; the Sun Solaris compiler can't handle +// syntax like 'T(&get_c_array(boost::array& arg))[N]' +// +// We can't just use this for all compilers, because the +// borland compilers can't handle this form. + namespace detail { + template struct c_array + { + typedef T type[N]; + }; + } + + // Specific for boost::array: simply returns its elems data member. + template + typename detail::c_array::type& get_c_array(boost::array& arg) + { + return arg.elems; + } + + // Specific for boost::array: simply returns its elems data member. + template + typename const detail::c_array::type& get_c_array(const boost::array& arg) + { + return arg.elems; + } +#else +// Specific for boost::array: simply returns its elems data member. template T(&get_c_array(boost::array& arg))[N] { @@ -359,7 +407,8 @@ namespace boost { { return arg.elems; } - +#endif + #if 0 // Overload for std::array, assuming that std::array will have // explicit conversion functions as discussed at the WG21 meeting diff --git a/boost/boost/assert.hpp b/boost/boost/assert.hpp index c227f17b9e..174f0846fd 100644 --- a/boost/boost/assert.hpp +++ b/boost/boost/assert.hpp @@ -1,8 +1,11 @@ // // boost/assert.hpp - BOOST_ASSERT(expr) +// BOOST_ASSERT_MSG(expr, msg) +// BOOST_VERIFY(expr) // // Copyright (c) 2001, 2002 Peter Dimov and Multi Media Ltd. // Copyright (c) 2007 Peter Dimov +// Copyright (c) Beman Dawes 2011 // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at @@ -13,6 +16,16 @@ // See http://www.boost.org/libs/utility/assert.html for documentation. // +// +// Stop inspect complaining about use of 'assert': +// +// boostinspect:naassert_macro +// + +//--------------------------------------------------------------------------------------// +// BOOST_ASSERT // +//--------------------------------------------------------------------------------------// + #undef BOOST_ASSERT #if defined(BOOST_DISABLE_ASSERTS) @@ -25,18 +38,86 @@ namespace boost { - -void assertion_failed(char const * expr, char const * function, char const * file, long line); // user defined - + void assertion_failed(char const * expr, + char const * function, char const * file, long line); // user defined } // namespace boost -#define BOOST_ASSERT(expr) ((expr)? ((void)0): ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +#define BOOST_ASSERT(expr) ((expr) \ + ? ((void)0) \ + : ::boost::assertion_failed(#expr, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) #else # include // .h to support old libraries w/o - effect is the same # define BOOST_ASSERT(expr) assert(expr) #endif +//--------------------------------------------------------------------------------------// +// BOOST_ASSERT_MSG // +//--------------------------------------------------------------------------------------// + +# undef BOOST_ASSERT_MSG + +#if defined(BOOST_DISABLE_ASSERTS) || defined(NDEBUG) + + #define BOOST_ASSERT_MSG(expr, msg) ((void)0) + +#elif defined(BOOST_ENABLE_ASSERT_HANDLER) + + #include + + namespace boost + { + void assertion_failed_msg(char const * expr, char const * msg, + char const * function, char const * file, long line); // user defined + } // namespace boost + + #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ + ? ((void)0) \ + : ::boost::assertion_failed_msg(#expr, msg, BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) + +#else + #ifndef BOOST_ASSERT_HPP + #define BOOST_ASSERT_HPP + #include + #include + #include + + // 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_ASSERT_MSG_OSTREAM + # define BOOST_ASSERT_MSG_OSTREAM std::cerr + #endif + + namespace boost + { + namespace assertion + { + namespace detail + { + inline void assertion_failed_msg(char const * expr, char const * msg, char const * function, + char const * file, long line) + { + BOOST_ASSERT_MSG_OSTREAM + << "***** Internal Program Error - assertion (" << expr << ") failed in " + << function << ":\n" + << file << '(' << line << "): " << msg << std::endl; + std::abort(); + } + } // detail + } // assertion + } // detail + #endif + + #define BOOST_ASSERT_MSG(expr, msg) ((expr) \ + ? ((void)0) \ + : ::boost::assertion::detail::assertion_failed_msg(#expr, msg, \ + BOOST_CURRENT_FUNCTION, __FILE__, __LINE__)) +#endif + +//--------------------------------------------------------------------------------------// +// BOOST_VERIFY // +//--------------------------------------------------------------------------------------// + #undef BOOST_VERIFY #if defined(BOOST_DISABLE_ASSERTS) || ( !defined(BOOST_ENABLE_ASSERT_HANDLER) && defined(NDEBUG) ) diff --git a/boost/boost/concept_check.hpp b/boost/boost/concept_check.hpp index 7ee3036855..01b2f4ec27 100644 --- a/boost/boost/concept_check.hpp +++ b/boost/boost/concept_check.hpp @@ -1,5 +1,7 @@ // // (C) Copyright Jeremy Siek 2000. +// Copyright 2002 The Trustees of Indiana University. +// // 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) @@ -36,14 +38,14 @@ namespace boost // // Backward compatibility // - + template inline void function_requires(Model* = 0) { BOOST_CONCEPT_ASSERT((Model)); - } + } template inline void ignore_unused_variable_warning(T const&) {} - + # define BOOST_CLASS_REQUIRE(type_var, ns, concept) \ BOOST_CONCEPT_ASSERT((ns::concept)) @@ -56,20 +58,21 @@ namespace boost # define BOOST_CLASS_REQUIRE4(tv1, tv2, tv3, tv4, ns, concept) \ BOOST_CONCEPT_ASSERT((ns::concept)) - + // // Begin concept definitions // BOOST_concept(Integer, (T)) { BOOST_CONCEPT_USAGE(Integer) - { + { x.error_type_must_be_an_integer_type(); } private: T x; }; + template <> struct Integer {}; template <> struct Integer {}; template <> struct Integer {}; template <> struct Integer {}; @@ -87,7 +90,7 @@ namespace boost # endif BOOST_concept(SignedInteger,(T)) { - BOOST_CONCEPT_USAGE(SignedInteger) { + BOOST_CONCEPT_USAGE(SignedInteger) { x.error_type_must_be_a_signed_integer_type(); } private: @@ -101,16 +104,16 @@ namespace boost template <> struct SignedInteger< ::boost::long_long_type> {}; # elif defined(BOOST_HAS_MS_INT64) template <> struct SignedInteger<__int64> {}; -# endif +# endif BOOST_concept(UnsignedInteger,(T)) { - BOOST_CONCEPT_USAGE(UnsignedInteger) { + BOOST_CONCEPT_USAGE(UnsignedInteger) { x.error_type_must_be_an_unsigned_integer_type(); } private: T x; }; - + template <> struct UnsignedInteger {}; template <> struct UnsignedInteger {}; template <> struct UnsignedInteger {}; @@ -136,23 +139,24 @@ namespace boost { BOOST_CONCEPT_USAGE(Assignable) { #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL - a = a; // require assignment operator + a = b; // require assignment operator #endif - const_constraints(a); + const_constraints(b); } private: - void const_constraints(const TT& b) { + void const_constraints(const TT& x) { #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL - a = b; // const required for argument to assignment + a = x; // const required for argument to assignment #else - ignore_unused_variable_warning(b); + ignore_unused_variable_warning(x); #endif } private: TT a; + TT b; }; - + BOOST_concept(CopyConstructible,(TT)) { BOOST_CONCEPT_USAGE(CopyConstructible) { @@ -180,22 +184,23 @@ namespace boost BOOST_concept(SGIAssignable,(TT)) { BOOST_CONCEPT_USAGE(SGIAssignable) { - TT b(a); + TT c(a); #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL - a = a; // require assignment operator + a = b; // require assignment operator #endif - const_constraints(a); - ignore_unused_variable_warning(b); + const_constraints(b); + ignore_unused_variable_warning(c); } private: - void const_constraints(const TT& b) { - TT c(b); + void const_constraints(const TT& x) { + TT c(x); #if !defined(_ITERATOR_) // back_insert_iterator broken for VC++ STL - a = b; // const required for argument to assignment + a = x; // const required for argument to assignment #endif ignore_unused_variable_warning(c); } TT a; + TT b; }; #if (defined _MSC_VER) # pragma warning( pop ) @@ -297,7 +302,7 @@ namespace boost BOOST_concept(Generator,(Func)(Return)) { BOOST_CONCEPT_USAGE(Generator) { test(is_void()); } - + private: void test(boost::mpl::false_) { @@ -310,22 +315,22 @@ namespace boost { f(); } - + Func f; }; BOOST_concept(UnaryFunction,(Func)(Return)(Arg)) { BOOST_CONCEPT_USAGE(UnaryFunction) { test(is_void()); } - + private: void test(boost::mpl::false_) { f(arg); // "priming the pump" this way keeps msvc6 happy (ICE) Return r = f(arg); - ignore_unused_variable_warning(r); + ignore_unused_variable_warning(r); } - + void test(boost::mpl::true_) { f(arg); @@ -354,12 +359,21 @@ namespace boost Return r = f(first, second); // require operator() (void)r; } - + void test(boost::mpl::true_) { f(first,second); } - + +#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \ + && BOOST_WORKAROUND(__GNUC__, > 3))) + // Declare a dummy constructor to make gcc happy. + // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type. + // (warning: non-static reference "const double& boost::BinaryFunction::arg" + // in class without a constructor [-Wuninitialized]) + BinaryFunction(); +#endif + Func f; First first; Second second; @@ -371,6 +385,15 @@ namespace boost require_boolean_expr(f(arg)); // require operator() returning bool } private: +#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \ + && BOOST_WORKAROUND(__GNUC__, > 3))) + // Declare a dummy constructor to make gcc happy. + // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type. + // (warning: non-static reference "const double& boost::UnaryPredicate::arg" + // in class without a constructor [-Wuninitialized]) + UnaryPredicate(); +#endif + Func f; Arg arg; }; @@ -381,6 +404,14 @@ namespace boost require_boolean_expr(f(a, b)); // require operator() returning bool } private: +#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \ + && BOOST_WORKAROUND(__GNUC__, > 3))) + // Declare a dummy constructor to make gcc happy. + // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type. + // (warning: non-static reference "const double& boost::BinaryPredicate::arg" + // in class without a constructor [-Wuninitialized]) + BinaryPredicate(); +#endif Func f; First a; Second b; @@ -390,7 +421,7 @@ namespace boost BOOST_concept(Const_BinaryPredicate,(Func)(First)(Second)) : BinaryPredicate { - BOOST_CONCEPT_USAGE(Const_BinaryPredicate) { + BOOST_CONCEPT_USAGE(Const_BinaryPredicate) { const_constraints(f); } private: @@ -398,6 +429,15 @@ namespace boost // operator() must be a const member function require_boolean_expr(fun(a, b)); } +#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \ + && BOOST_WORKAROUND(__GNUC__, > 3))) + // Declare a dummy constructor to make gcc happy. + // It seems the compiler can not generate a sensible constructor when this is instantiated with a refence type. + // (warning: non-static reference "const double& boost::Const_BinaryPredicate::arg" + // in class without a constructor [-Wuninitialized]) + Const_BinaryPredicate(); +#endif + Func f; First a; Second b; @@ -407,7 +447,7 @@ namespace boost : Generator { typedef typename Func::result_type result_type; - + BOOST_CONCEPT_USAGE(AdaptableGenerator) { BOOST_CONCEPT_ASSERT((Convertible)); @@ -438,7 +478,7 @@ namespace boost typedef typename Func::first_argument_type first_argument_type; typedef typename Func::second_argument_type second_argument_type; typedef typename Func::result_type result_type; - + ~AdaptableBinaryFunction() { BOOST_CONCEPT_ASSERT((Convertible)); @@ -476,7 +516,7 @@ namespace boost { BOOST_CONCEPT_ASSERT((SignedInteger)); BOOST_CONCEPT_ASSERT((Convertible)); - + TT j(i); (void)*i; // require dereference operator ++j; // require preincrement operator @@ -490,7 +530,7 @@ namespace boost : Assignable { BOOST_CONCEPT_USAGE(OutputIterator) { - + ++i; // require preincrement operator i++; // require postincrement operator *i++ = t; // require postincrement and assignment @@ -509,11 +549,11 @@ namespace boost BOOST_DEDUCED_TYPENAME ForwardIterator::iterator_category , std::forward_iterator_tag >)); - + typename InputIterator::reference r = *i; ignore_unused_variable_warning(r); } - + private: TT i; }; @@ -575,7 +615,7 @@ namespace boost n = i - j; // require difference operator (void)i[n]; // require element access operator } - + private: TT a, b; TT i, j; @@ -613,7 +653,7 @@ namespace boost BOOST_CONCEPT_ASSERT((InputIterator)); const_constraints(c); } - + private: void const_constraints(const C& cc) { i = cc.begin(); @@ -634,19 +674,19 @@ namespace boost typedef typename C::reference reference; typedef typename C::iterator iterator; typedef typename C::pointer pointer; - + BOOST_CONCEPT_USAGE(Mutable_Container) { BOOST_CONCEPT_ASSERT(( Assignable)); - + BOOST_CONCEPT_ASSERT((InputIterator)); - + i = c.begin(); i = c.end(); c.swap(c2); } - + private: iterator i; C c, c2; @@ -662,7 +702,7 @@ namespace boost typename ForwardContainer::const_iterator >)); } - }; + }; BOOST_concept(Mutable_ForwardContainer,(C)) : ForwardContainer @@ -675,7 +715,7 @@ namespace boost typename Mutable_ForwardContainer::iterator >)); } - }; + }; BOOST_concept(ReversibleContainer,(C)) : ForwardContainer @@ -689,9 +729,9 @@ namespace boost BOOST_CONCEPT_ASSERT(( BidirectionalIterator< typename ReversibleContainer::const_iterator>)); - + BOOST_CONCEPT_ASSERT((BidirectionalIterator)); - + const_constraints(c); } private: @@ -708,17 +748,17 @@ namespace boost , ReversibleContainer { typedef typename C::reverse_iterator reverse_iterator; - + BOOST_CONCEPT_USAGE(Mutable_ReversibleContainer) { typedef typename Mutable_ForwardContainer::iterator iterator; BOOST_CONCEPT_ASSERT((Mutable_BidirectionalIterator)); BOOST_CONCEPT_ASSERT((Mutable_BidirectionalIterator)); - + reverse_iterator i = c.rbegin(); i = c.rend(); } - private: + private: C c; }; @@ -734,7 +774,7 @@ namespace boost RandomAccessIterator< typename RandomAccessContainer::const_iterator >)); - + const_constraints(c); } private: @@ -743,7 +783,7 @@ namespace boost const_reference r = cc[n]; ignore_unused_variable_warning(r); } - + C c; size_type n; }; @@ -759,11 +799,11 @@ namespace boost { BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator)); BOOST_CONCEPT_ASSERT((Mutable_RandomAccessIterator)); - + typename self::reference r = c[i]; ignore_unused_variable_warning(r); } - + private: typename Mutable_ReversibleContainer::size_type i; C c; @@ -779,7 +819,7 @@ namespace boost { BOOST_CONCEPT_USAGE(Sequence) { - S + S c(n), c2(n, t), c3(first, last); @@ -804,7 +844,7 @@ namespace boost typename Sequence::const_reference r = c.front(); ignore_unused_variable_warning(r); } - + typename S::value_type t; typename S::size_type n; typename S::value_type* first, *last; @@ -863,11 +903,11 @@ namespace boost c.erase(r.first, r.second); const_constraints(c); BOOST_CONCEPT_ASSERT((BinaryPredicate)); - + typedef typename AssociativeContainer::value_type value_type_; BOOST_CONCEPT_ASSERT((BinaryPredicate)); } - + // Redundant with the base concept, but it helps below. typedef typename C::const_iterator const_iterator; private: @@ -893,7 +933,7 @@ namespace boost BOOST_CONCEPT_USAGE(UniqueAssociativeContainer) { C c(first, last); - + pos_flag = c.insert(t); c.insert(first, last); @@ -911,7 +951,7 @@ namespace boost BOOST_CONCEPT_USAGE(MultipleAssociativeContainer) { C c(first, last); - + pos = c.insert(t); c.insert(first, last); @@ -954,7 +994,7 @@ namespace boost { BOOST_CONCEPT_USAGE(SortedAssociativeContainer) { - C + C c(kc), c2(first, last), c3(first, last, kc); @@ -962,15 +1002,15 @@ namespace boost p = c.upper_bound(k); p = c.lower_bound(k); r = c.equal_range(k); - + c.insert(p, t); - + ignore_unused_variable_warning(c); ignore_unused_variable_warning(c2); ignore_unused_variable_warning(c3); const_constraints(c); } - + void const_constraints(const C& c) { kc = c.key_comp(); @@ -980,7 +1020,7 @@ namespace boost cp = c.lower_bound(k); cr = c.equal_range(k); } - + private: typename C::key_compare kc; typename C::value_compare vc; @@ -999,6 +1039,42 @@ namespace boost // HashedAssociativeContainer + BOOST_concept(Collection,(C)) + { + BOOST_CONCEPT_USAGE(Collection) + { + boost::function_requires >(); + boost::function_requires >(); + boost::function_requires >(); + const_constraints(c); + i = c.begin(); + i = c.end(); + c.swap(c); + } + + void const_constraints(const C& c) { + ci = c.begin(); + ci = c.end(); + n = c.size(); + b = c.empty(); + } + + private: + typedef typename C::value_type value_type; + typedef typename C::iterator iterator; + typedef typename C::const_iterator const_iterator; + typedef typename C::reference reference; + typedef typename C::const_reference const_reference; + // typedef typename C::pointer pointer; + typedef typename C::difference_type difference_type; + typedef typename C::size_type size_type; + + C c; + bool b; + iterator i; + const_iterator ci; + size_type n; + }; } // namespace boost # include diff --git a/boost/boost/config/auto_link.hpp b/boost/boost/config/auto_link.hpp index 0d17eb8fea..f5a0a007b4 100644 --- a/boost/boost/config/auto_link.hpp +++ b/boost/boost/config/auto_link.hpp @@ -362,7 +362,7 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. && defined(BOOST_LIB_VERSION) #ifdef BOOST_AUTO_LINK_TAGGED -# pragma commentcomment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") +# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib") # ifdef BOOST_LIB_DIAGNOSTIC # pragma message ("Linking to lib file: " BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib") # endif @@ -414,7 +414,4 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. #if defined(BOOST_DYN_LINK) # undef BOOST_DYN_LINK #endif -#if defined(BOOST_AUTO_LINK_NOMANGLE) -# undef BOOST_AUTO_LINK_NOMANGLE -#endif diff --git a/boost/boost/config/compiler/borland.hpp b/boost/boost/config/compiler/borland.hpp index bd3a8c3f3f..a989fd633b 100644 --- a/boost/boost/config/compiler/borland.hpp +++ b/boost/boost/config/compiler/borland.hpp @@ -46,6 +46,8 @@ // Borland C++Builder 5, command-line compiler 5.5: # define BOOST_NO_OPERATORS_IN_NAMESPACE # endif +// Variadic macros do not exist for C++ Builder versions 5 and below +#define BOOST_NO_VARIADIC_MACROS # endif // Version 5.51 and below: diff --git a/boost/boost/config/compiler/common_edg.hpp b/boost/boost/config/compiler/common_edg.hpp index cb283376e1..9042578bfd 100644 --- a/boost/boost/config/compiler/common_edg.hpp +++ b/boost/boost/config/compiler/common_edg.hpp @@ -62,10 +62,13 @@ #if (__EDG_VERSION__ < 310) # define BOOST_NO_EXTERN_TEMPLATE #endif -#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG) +#if (__EDG_VERSION__ <= 310) // No support for initializer lists # define BOOST_NO_INITIALIZER_LISTS #endif +#if (__EDG_VERSION__ < 400) +# define BOOST_NO_VARIADIC_MACROS +#endif #define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS @@ -94,6 +97,3 @@ // However, some libraries have insufficient "long long" support // #define BOOST_HAS_LONG_LONG #endif - - - diff --git a/boost/boost/config/compiler/digitalmars.hpp b/boost/boost/config/compiler/digitalmars.hpp index bd37d2f1c2..31c11bf0ce 100644 --- a/boost/boost/config/compiler/digitalmars.hpp +++ b/boost/boost/config/compiler/digitalmars.hpp @@ -80,6 +80,9 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#if (__DMC__ < 0x812) +#define BOOST_NO_VARIADIC_MACROS +#endif #if __DMC__ < 0x800 #error "Compiler not supported or configured - please reconfigure" diff --git a/boost/boost/config/compiler/gcc.hpp b/boost/boost/config/compiler/gcc.hpp index 54f1bb9882..f633647d65 100644 --- a/boost/boost/config/compiler/gcc.hpp +++ b/boost/boost/config/compiler/gcc.hpp @@ -43,6 +43,8 @@ # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_NO_IS_ABSTRACT # define BOOST_NO_EXTERN_TEMPLATE +// Variadic macros do not exist for gcc versions before 3.0 +# define BOOST_NO_VARIADIC_MACROS #elif __GNUC__ == 3 # if defined (__PATHSCALE__) # define BOOST_NO_TWO_PHASE_NAME_LOOKUP @@ -113,7 +115,7 @@ // Dynamic shared object (DSO) and dynamic-link library (DLL) support // #if __GNUC__ >= 4 -# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32) +# if (defined(_WIN32) || defined(__WIN32__) || defined(WIN32)) && !defined(__CYGWIN__) // All Win32 development environments, including 64-bit Windows and MinGW, define // _WIN32 or one of its variant spellings. Note that Cygwin is a POSIX environment, // so does not define _WIN32 or its variants. @@ -146,8 +148,6 @@ // C++0x features not implemented in any GCC version // -#define BOOST_NO_CONSTEXPR -#define BOOST_NO_NULLPTR #define BOOST_NO_TEMPLATE_ALIASES // C++0x features in 4.3.n and later @@ -209,6 +209,13 @@ # define BOOST_NO_UNICODE_LITERALS #endif +// C++0x features in 4.5.n and later +// +#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6) || !defined(__GXX_EXPERIMENTAL_CXX0X__) +#define BOOST_NO_CONSTEXPR +#define BOOST_NO_NULLPTR +#endif + // ConceptGCC compiler: // http://www.generic-programming.org/software/ConceptGCC/ #ifdef __GXX_CONCEPTS__ @@ -229,8 +236,8 @@ # error "Compiler not configured - please reconfigure" #endif // -// last known and checked version is 4.4 (Pre-release): -#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 4)) +// last known and checked version is 4.6 (Pre-release): +#if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ > 6)) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # else diff --git a/boost/boost/config/compiler/gcc_xml.hpp b/boost/boost/config/compiler/gcc_xml.hpp index 7f884b19ce..a456463ce7 100644 --- a/boost/boost/config/compiler/gcc_xml.hpp +++ b/boost/boost/config/compiler/gcc_xml.hpp @@ -35,6 +35,7 @@ # define BOOST_NO_RVALUE_REFERENCES # define BOOST_NO_STATIC_ASSERT # define BOOST_NO_VARIADIC_TEMPLATES +# define BOOST_NO_VARIADIC_MACROS # define BOOST_NO_AUTO_DECLARATIONS # define BOOST_NO_AUTO_MULTIDECLARATIONS # define BOOST_NO_CHAR16_T diff --git a/boost/boost/config/compiler/hp_acc.hpp b/boost/boost/config/compiler/hp_acc.hpp index 98e7772af2..d0b672ecae 100644 --- a/boost/boost/config/compiler/hp_acc.hpp +++ b/boost/boost/config/compiler/hp_acc.hpp @@ -115,6 +115,16 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES + +/* + See https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443331 and + https://forums13.itrc.hp.com/service/forums/questionanswer.do?threadId=1443436 +*/ + +#if (__HP_aCC < 62500) || !defined(HP_CXX0x_SOURCE) + #define BOOST_NO_VARIADIC_MACROS +#endif + #endif // diff --git a/boost/boost/config/compiler/intel.hpp b/boost/boost/config/compiler/intel.hpp index e7bc95babf..f209ae776b 100644 --- a/boost/boost/config/compiler/intel.hpp +++ b/boost/boost/config/compiler/intel.hpp @@ -26,7 +26,19 @@ # define BOOST_INTEL_CXX_VERSION __ECC #endif +// Flags determined by comparing output of 'icpc -dM -E' with and without '-std=c++0x' +#if (!(defined(_WIN32) || defined(_WIN64)) && defined(__STDC_HOSTED__) && __STDC_HOSTED__) || defined(__GXX_EXPERIMENTAL_CPP0X__) +# define BOOST_INTEL_STDCXX0X +#endif +#if defined(_MSC_VER) && (_MSC_VER >= 1600) +# define BOOST_INTEL_STDCXX0X +#endif + +#ifdef BOOST_INTEL_STDCXX0X +#define BOOST_COMPILER "Intel C++ C++0x mode version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION) +#else #define BOOST_COMPILER "Intel C++ version " BOOST_STRINGIZE(BOOST_INTEL_CXX_VERSION) +#endif #define BOOST_INTEL BOOST_INTEL_CXX_VERSION #if defined(_WIN32) || defined(_WIN64) @@ -99,7 +111,7 @@ # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # endif #endif -#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1110) +#if (defined(__GNUC__) && (__GNUC__ < 4)) || defined(_WIN32) || (BOOST_INTEL_CXX_VERSION <= 1200) // GCC or VC emulation: #define BOOST_NO_TWO_PHASE_NAME_LOOKUP #endif @@ -179,6 +191,32 @@ template<> struct assert_intrinsic_wchar_t {}; # define BOOST_SYMBOL_IMPORT # define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default"))) #endif +// +// C++0x features +// - ICC added static_assert in 11.0 (first version with C++0x support) +// +#if defined(BOOST_INTEL_STDCXX0X) +# undef BOOST_NO_STATIC_ASSERT +// +// These pass our test cases, but aren't officially supported according to: +// http://software.intel.com/en-us/articles/c0x-features-supported-by-intel-c-compiler/ +// +//# undef BOOST_NO_LAMBDAS +//# undef BOOST_NO_DECLTYPE +//# undef BOOST_NO_AUTO_DECLARATIONS +//# undef BOOST_NO_AUTO_MULTIDECLARATIONS +#endif + +#if defined(BOOST_INTEL_STDCXX0X) && (BOOST_INTEL_CXX_VERSION >= 1200) +# undef BOOST_NO_RVALUE_REFERENCES +# undef BOOST_NO_SCOPED_ENUMS +# undef BOOST_NO_DELETED_FUNCTIONS +# undef BOOST_NO_DEFAULTED_FUNCTIONS +# undef BOOST_NO_LAMBDAS +# undef BOOST_NO_DECLTYPE +# undef BOOST_NO_AUTO_DECLARATIONS +# undef BOOST_NO_AUTO_MULTIDECLARATIONS +#endif // // last known and checked version: diff --git a/boost/boost/config/compiler/metrowerks.hpp b/boost/boost/config/compiler/metrowerks.hpp index 3bc9d97555..21083b7a1f 100644 --- a/boost/boost/config/compiler/metrowerks.hpp +++ b/boost/boost/config/compiler/metrowerks.hpp @@ -114,6 +114,7 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_VARIADIC_MACROS #define BOOST_COMPILER "Metrowerks CodeWarrior C++ version " BOOST_STRINGIZE(BOOST_COMPILER_VERSION) diff --git a/boost/boost/config/compiler/mpw.hpp b/boost/boost/config/compiler/mpw.hpp index 4db14ddef3..ae12f801d5 100644 --- a/boost/boost/config/compiler/mpw.hpp +++ b/boost/boost/config/compiler/mpw.hpp @@ -63,6 +63,7 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_VARIADIC_MACROS // // versions check: diff --git a/boost/boost/config/compiler/pgi.hpp b/boost/boost/config/compiler/pgi.hpp index 1c7c84b70c..fb3a6c0b27 100644 --- a/boost/boost/config/compiler/pgi.hpp +++ b/boost/boost/config/compiler/pgi.hpp @@ -70,6 +70,7 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_VARIADIC_MACROS // // version check: diff --git a/boost/boost/config/compiler/sunpro_cc.hpp b/boost/boost/config/compiler/sunpro_cc.hpp index aca49fa04a..85fa462504 100644 --- a/boost/boost/config/compiler/sunpro_cc.hpp +++ b/boost/boost/config/compiler/sunpro_cc.hpp @@ -122,6 +122,7 @@ #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_VARIADIC_MACROS // // Version diff --git a/boost/boost/config/compiler/vacpp.hpp b/boost/boost/config/compiler/vacpp.hpp index e5b6971145..7ad616e44f 100644 --- a/boost/boost/config/compiler/vacpp.hpp +++ b/boost/boost/config/compiler/vacpp.hpp @@ -27,7 +27,6 @@ #if (__IBMCPP__ <= 600) || !defined(BOOST_STRICT_CONFIG) # define BOOST_NO_POINTER_TO_MEMBER_TEMPLATE_PARAMETERS -# define BOOST_NO_INITIALIZER_LISTS #endif #if (__IBMCPP__ <= 1110) @@ -54,43 +53,66 @@ #error "Compiler not supported or configured - please reconfigure" #endif // -// last known and checked version is 600: -#if (__IBMCPP__ > 1010) +// last known and checked version is 1110: +#if (__IBMCPP__ > 1110) # if defined(BOOST_ASSERT_CONFIG) # error "Unknown compiler version - please run the configure tests and report the results" # endif #endif // Some versions of the compiler have issues with default arguments on partial specializations +#if __IBMCPP__ <= 1010 #define BOOST_NO_PARTIAL_SPECIALIZATION_IMPLICIT_DEFAULT_ARGS +#endif // // C++0x features // // See boost\config\suffix.hpp for BOOST_NO_LONG_LONG // -#define BOOST_NO_AUTO_DECLARATIONS -#define BOOST_NO_AUTO_MULTIDECLARATIONS -#define BOOST_NO_CHAR16_T -#define BOOST_NO_CHAR32_T +#if ! __IBMCPP_AUTO_TYPEDEDUCTION +# define BOOST_NO_AUTO_DECLARATIONS +# define BOOST_NO_AUTO_MULTIDECLARATIONS +#endif +#if ! __IBMCPP_UTF_LITERAL__ +# define BOOST_NO_CHAR16_T +# define BOOST_NO_CHAR32_T +#endif #define BOOST_NO_CONCEPTS #define BOOST_NO_CONSTEXPR -#define BOOST_NO_DECLTYPE +#if ! __IBMCPP_DECLTYPE +# define BOOST_NO_DECLTYPE +#else +# define BOOST_HAS_DECLTYPE +#endif #define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS -#define BOOST_NO_EXTERN_TEMPLATE -#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#if ! __IBMCPP_EXTERN_TEMPLATE +# define BOOST_NO_EXTERN_TEMPLATE +#endif +#if ! __IBMCPP_VARIADIC_TEMPLATES +// not enabled separately at this time +# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS +#endif +#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_LAMBDAS #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_STATIC_ASSERT +#if ! __IBMCPP_STATIC_ASSERT +# define BOOST_NO_STATIC_ASSERT +#endif #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS -#define BOOST_NO_VARIADIC_TEMPLATES +#if ! __IBMCPP_VARIADIC_TEMPLATES +# define BOOST_NO_VARIADIC_TEMPLATES +#endif +#if ! __C99_MACRO_WITH_VA_ARGS +# define BOOST_NO_VARIADIC_MACROS +#endif diff --git a/boost/boost/config/compiler/visualc.hpp b/boost/boost/config/compiler/visualc.hpp index a862570f59..38789367a8 100644 --- a/boost/boost/config/compiler/visualc.hpp +++ b/boost/boost/config/compiler/visualc.hpp @@ -37,6 +37,9 @@ // #endif +/// Visual Studio has no fenv.h +#define BOOST_NO_FENV_H + #if (_MSC_VER <= 1300) // 1300 == VC++ 7.0 # if !defined(_MSC_EXTENSIONS) && !defined(BOOST_NO_DEPENDENT_TYPES_IN_TEMPLATE_VALUE_PARAMETERS) // VC7 bug with /Za @@ -81,6 +84,8 @@ # define BOOST_NO_SWPRINTF // Our extern template tests also fail for this compiler: # define BOOST_NO_EXTERN_TEMPLATE +// Variadic macros do not exist for VC7.1 and lower +# define BOOST_NO_VARIADIC_MACROS #endif #if defined(UNDER_CE) @@ -92,10 +97,6 @@ # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS #endif -#if _MSC_VER <= 1600 // 1600 == VC++ 10.0 -# define BOOST_NO_TWO_PHASE_NAME_LOOKUP -#endif - #if _MSC_VER == 1500 // 1500 == VC++ 9.0 // A bug in VC9: # define BOOST_NO_ADL_BARRIER @@ -179,6 +180,7 @@ #define BOOST_NO_STATIC_ASSERT #define BOOST_NO_NULLPTR #endif // _MSC_VER < 1600 + #if _MSC_VER >= 1600 #define BOOST_HAS_STDINT_H #endif @@ -196,10 +198,11 @@ #define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_RAW_LITERALS #define BOOST_NO_SCOPED_ENUMS -#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_VARIADIC_TEMPLATES +#define BOOST_NO_SFINAE_EXPR +#define BOOST_NO_TWO_PHASE_NAME_LOOKUP // // prefix and suffix headers: // diff --git a/boost/boost/config/platform/bsd.hpp b/boost/boost/config/platform/bsd.hpp index f02b0e2630..a0142978eb 100644 --- a/boost/boost/config/platform/bsd.hpp +++ b/boost/boost/config/platform/bsd.hpp @@ -56,7 +56,7 @@ #endif #if !((defined(__FreeBSD__) && (__FreeBSD__ >= 5)) \ - || (__NetBSD_GCC__ >= 2095003) || defined(__DragonFly__)) + || (defined(__NetBSD_GCC__) && (__NetBSD_GCC__ >= 2095003)) || defined(__DragonFly__)) # define BOOST_NO_CWCHAR #endif // diff --git a/boost/boost/config/platform/cygwin.hpp b/boost/boost/config/platform/cygwin.hpp index 5627dd60fb..b7ef572fa6 100644 --- a/boost/boost/config/platform/cygwin.hpp +++ b/boost/boost/config/platform/cygwin.hpp @@ -39,8 +39,18 @@ #define BOOST_HAS_STDINT_H #endif +/// Cygwin has no fenv.h +#define BOOST_NO_FENV_H + // boilerplate code: #include + +// +// Cygwin lies about XSI conformance, there is no nl_types.h: +// +#ifdef BOOST_HAS_NL_TYPES_H +# undef BOOST_HAS_NL_TYPES_H +#endif diff --git a/boost/boost/config/platform/win32.hpp b/boost/boost/config/platform/win32.hpp index f59c4ea79e..72c3dcebdc 100644 --- a/boost/boost/config/platform/win32.hpp +++ b/boost/boost/config/platform/win32.hpp @@ -31,7 +31,6 @@ # define BOOST_SYMBOL_IMPORT __declspec(dllimport) #endif - #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) # define BOOST_HAS_STDINT_H # define __STDC_LIMIT_MACROS @@ -39,6 +38,11 @@ # define BOOST_HAS_UNISTD_H #endif +#if defined(__MINGW32__) && (__GNUC__ >= 4) +# define BOOST_HAS_EXPM1 +# define BOOST_HAS_LOG1P +# define BOOST_HAS_GETTIMEOFDAY +#endif // // Win32 will normally be using native Win32 threads, // but there is a pthread library avaliable as an option, diff --git a/boost/boost/config/select_compiler_config.hpp b/boost/boost/config/select_compiler_config.hpp index f9b086ad43..e19469ae21 100644 --- a/boost/boost/config/select_compiler_config.hpp +++ b/boost/boost/config/select_compiler_config.hpp @@ -14,25 +14,27 @@ // one identification macro for each of the // compilers we support: -# define BOOST_CXX_GCCXML 0 -# define BOOST_CXX_CLANG 0 -# define BOOST_CXX_COMO 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 +# 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 @@ -50,6 +52,10 @@ // Comeau C++ # define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp" +#elif defined(__PATHSCALE__) && (__PATHCC__ >= 4) +// PathScale EKOPath compiler (has to come before clang and gcc) +# define BOOST_COMPILER_CONFIG "boost/config/compiler/pathscale.hpp" + #elif defined __clang__ // Clang C++ emulates GCC, so it has to appear early. # define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp" diff --git a/boost/boost/config/select_platform_config.hpp b/boost/boost/config/select_platform_config.hpp index 8606e12edf..bc1ffaf69f 100644 --- a/boost/boost/config/select_platform_config.hpp +++ b/boost/boost/config/select_platform_config.hpp @@ -69,6 +69,9 @@ // Symbian: # define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp" +#elif defined(__VMS) +// VMS: +# define BOOST_PLATFORM_CONFIG "boost/config/platform/vms.hpp" #else # if defined(unix) \ diff --git a/boost/boost/config/select_stdlib_config.hpp b/boost/boost/config/select_stdlib_config.hpp index 2a1430aef4..f020482365 100644 --- a/boost/boost/config/select_stdlib_config.hpp +++ b/boost/boost/config/select_stdlib_config.hpp @@ -40,6 +40,10 @@ // Rogue Wave library: # define BOOST_STDLIB_CONFIG "boost/config/stdlib/roguewave.hpp" +#elif defined(_LIBCPP_VERSION) +// libc++ +# define BOOST_STDLIB_CONFIG "boost/config/stdlib/libcpp.hpp" + #elif defined(__GLIBCPP__) || defined(__GLIBCXX__) // GNU libstdc++ 3 # define BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp" diff --git a/boost/boost/config/stdlib/dinkumware.hpp b/boost/boost/config/stdlib/dinkumware.hpp index ea8faf14d0..a7579daa09 100644 --- a/boost/boost/config/stdlib/dinkumware.hpp +++ b/boost/boost/config/stdlib/dinkumware.hpp @@ -107,6 +107,7 @@ # define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TYPEINDEX +# define BOOST_NO_NUMERIC_LIMITS_LOWEST #endif #if !defined(_HAS_TR1_IMPORTS) && !defined(BOOST_NO_0X_HDR_TUPLE) diff --git a/boost/boost/config/stdlib/libcomo.hpp b/boost/boost/config/stdlib/libcomo.hpp index 97a39f3ed8..16a842ae2e 100644 --- a/boost/boost/config/stdlib/libcomo.hpp +++ b/boost/boost/config/stdlib/libcomo.hpp @@ -58,6 +58,7 @@ # 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_NUMERIC_LIMITS_LOWEST // // Intrinsic type_traits support. diff --git a/boost/boost/config/stdlib/libstdcpp3.hpp b/boost/boost/config/stdlib/libstdcpp3.hpp index 815d605cc3..c048b89693 100644 --- a/boost/boost/config/stdlib/libstdcpp3.hpp +++ b/boost/boost/config/stdlib/libstdcpp3.hpp @@ -9,6 +9,8 @@ // config for libstdc++ v3 // not much to go in here: +#define BOOST_GNU_STDLIB 1 + #ifdef __GLIBCXX__ #define BOOST_STDLIB "GNU libstdc++ version " BOOST_STRINGIZE(__GLIBCXX__) #else @@ -54,7 +56,6 @@ # define BOOST_HAS_THREADS #endif - #if !defined(_GLIBCPP_USE_LONG_LONG) \ && !defined(_GLIBCXX_USE_LONG_LONG)\ && defined(BOOST_HAS_LONG_LONG) @@ -63,6 +64,16 @@ # undef BOOST_HAS_LONG_LONG #endif +// Apple doesn't seem to reliably defined a *unix* macro +#if !defined(CYGWIN) && ( defined(__unix__) \ + || defined(__unix) \ + || defined(unix) \ + || defined(__APPLE__) \ + || defined(__APPLE) \ + || defined(APPLE)) +# include +#endif + #if defined(__GLIBCXX__) || (defined(__GLIBCPP__) && __GLIBCPP__>=20020514) // GCC >= 3.1.0 # define BOOST_STD_EXTENSION_NAMESPACE __gnu_cxx # define BOOST_HAS_SLIST @@ -115,6 +126,12 @@ # define BOOST_NO_0X_HDR_THREAD #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 +#endif + // C++0x headers not yet implemented // # define BOOST_NO_0X_HDR_CODECVT diff --git a/boost/boost/config/stdlib/modena.hpp b/boost/boost/config/stdlib/modena.hpp index 10792cdac2..147060d9f7 100644 --- a/boost/boost/config/stdlib/modena.hpp +++ b/boost/boost/config/stdlib/modena.hpp @@ -47,6 +47,7 @@ # 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_NUMERIC_LIMITS_LOWEST #define BOOST_STDLIB "Modena C++ standard library" diff --git a/boost/boost/config/stdlib/msl.hpp b/boost/boost/config/stdlib/msl.hpp index beb15de685..8185e351ea 100644 --- a/boost/boost/config/stdlib/msl.hpp +++ b/boost/boost/config/stdlib/msl.hpp @@ -71,6 +71,7 @@ # 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_NUMERIC_LIMITS_LOWEST #define BOOST_STDLIB "Metrowerks Standard Library version " BOOST_STRINGIZE(__MSL_CPP__) diff --git a/boost/boost/config/stdlib/roguewave.hpp b/boost/boost/config/stdlib/roguewave.hpp index 830c32ef61..b43623b58b 100644 --- a/boost/boost/config/stdlib/roguewave.hpp +++ b/boost/boost/config/stdlib/roguewave.hpp @@ -10,6 +10,8 @@ // Rogue Wave std lib: +#define BOOST_RW_STDLIB 1 + #if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) # include # if !defined(__STD_RWCOMPILER_H__) && !defined(_RWSTD_VER) @@ -154,7 +156,10 @@ // C++0x headers not yet implemented // +#if _RWSTD_VER < 0x05000000 # define BOOST_NO_0X_HDR_ARRAY +# define BOOST_NO_0X_HDR_TYPE_TRAITS +#endif # define BOOST_NO_0X_HDR_CHRONO # define BOOST_NO_0X_HDR_CODECVT # define BOOST_NO_0X_HDR_CONCEPTS @@ -172,9 +177,9 @@ # define BOOST_NO_0X_HDR_SYSTEM_ERROR # define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_TUPLE -# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPEINDEX # 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_NUMERIC_LIMITS_LOWEST diff --git a/boost/boost/config/stdlib/sgi.hpp b/boost/boost/config/stdlib/sgi.hpp index 293886bcb4..5731fe5eb6 100644 --- a/boost/boost/config/stdlib/sgi.hpp +++ b/boost/boost/config/stdlib/sgi.hpp @@ -40,6 +40,17 @@ # define BOOST_NO_STRINGSTREAM #endif +// Apple doesn't seem to reliably defined a *unix* macro +#if !defined(CYGWIN) && ( defined(__unix__) \ + || defined(__unix) \ + || defined(unix) \ + || defined(__APPLE__) \ + || defined(__APPLE) \ + || defined(APPLE)) +# include +#endif + + // // Assume no std::locale without own iostreams (this may be an // incorrect assumption in some cases): @@ -130,6 +141,7 @@ # 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_NUMERIC_LIMITS_LOWEST #define BOOST_STDLIB "SGI standard library" diff --git a/boost/boost/config/stdlib/stlport.hpp b/boost/boost/config/stdlib/stlport.hpp index bb6fe134c7..85176a4d92 100644 --- a/boost/boost/config/stdlib/stlport.hpp +++ b/boost/boost/config/stdlib/stlport.hpp @@ -16,6 +16,16 @@ # endif #endif +// Apple doesn't seem to reliably defined a *unix* macro +#if !defined(CYGWIN) && ( defined(__unix__) \ + || defined(__unix) \ + || defined(unix) \ + || defined(__APPLE__) \ + || defined(__APPLE) \ + || defined(APPLE)) +# include +#endif + // // __STL_STATIC_CONST_INIT_BUG implies BOOST_NO_LIMITS_COMPILE_TIME_CONSTANTS // for versions prior to 4.1(beta) @@ -225,6 +235,7 @@ namespace boost { using std::min; using std::max; } # 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_NUMERIC_LIMITS_LOWEST #define BOOST_STDLIB "STLPort standard library version " BOOST_STRINGIZE(__SGI_STL_PORT) diff --git a/boost/boost/config/stdlib/vacpp.hpp b/boost/boost/config/stdlib/vacpp.hpp index 3504971fb4..3fcf6e05bc 100644 --- a/boost/boost/config/stdlib/vacpp.hpp +++ b/boost/boost/config/stdlib/vacpp.hpp @@ -12,6 +12,16 @@ #define BOOST_HAS_MACRO_USE_FACET #define BOOST_NO_STD_MESSAGES +// Apple doesn't seem to reliably defined a *unix* macro +#if !defined(CYGWIN) && ( defined(__unix__) \ + || defined(__unix) \ + || defined(unix) \ + || defined(__APPLE__) \ + || defined(__APPLE) \ + || defined(APPLE)) +# include +#endif + // C++0x headers not yet implemented // # define BOOST_NO_0X_HDR_ARRAY @@ -37,6 +47,7 @@ # 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_NUMERIC_LIMITS_LOWEST #define BOOST_STDLIB "Visual Age default standard library" diff --git a/boost/boost/config/suffix.hpp b/boost/boost/config/suffix.hpp index 3408d22588..9cce6fd736 100644 --- a/boost/boost/config/suffix.hpp +++ b/boost/boost/config/suffix.hpp @@ -25,6 +25,14 @@ #ifndef BOOST_CONFIG_SUFFIX_HPP #define BOOST_CONFIG_SUFFIX_HPP +#if defined(__GNUC__) && (__GNUC__ >= 4) +// +// Some GCC-4.x versions issue warnings even when __extension__ is used, +// so use this as a workaround: +// +#pragma GCC system_header +#endif + // // ensure that visibility macros are always defined, thus symplifying use // @@ -341,6 +349,13 @@ #define BOOST_HAS_RVALUE_REFS #endif +// +// Set BOOST_HAS_VARIADIC_TMPL when BOOST_NO_VARIADIC_TEMPLATES is not defined +// +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) && !defined(BOOST_HAS_VARIADIC_TMPL) +#define BOOST_HAS_VARIADIC_TMPL +#endif + // BOOST_HAS_ABI_HEADERS // This macro gets set if we have headers that fix the ABI, // and prevent ODR violations when linking to external libraries: @@ -585,7 +600,7 @@ namespace boost{ // the global definition into std namespace: #ifdef BOOST_NO_STD_TYPEINFO #include -namespace std{ using ::typeinfo; } +namespace std{ using ::type_info; } #endif // ---------------------------------------------------------------------------// @@ -635,5 +650,19 @@ namespace std{ using ::typeinfo; } # ifndef BOOST_GPU_ENABLED # define BOOST_GPU_ENABLED # endif + +// +// constexpr workarounds +// +#if defined(BOOST_NO_CONSTEXPR) +#define BOOST_CONSTEXPR +#define BOOST_CONSTEXPR_OR_CONST const +#else +#define BOOST_CONSTEXPR constexpr +#define BOOST_CONSTEXPR_OR_CONST constexpr +#endif + +#define BOOST_STATIC_CONSTEXPR static BOOST_CONSTEXPR_OR_CONST + #endif diff --git a/boost/boost/cstdint.hpp b/boost/boost/cstdint.hpp index ee55e6983a..ea84b65062 100644 --- a/boost/boost/cstdint.hpp +++ b/boost/boost/cstdint.hpp @@ -137,7 +137,7 @@ namespace boost } // namespace boost -#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) +#elif defined(__FreeBSD__) && (__FreeBSD__ <= 4) || defined(__osf__) || defined(__VMS) // FreeBSD and Tru64 have an that contains much of what we need. # include @@ -256,20 +256,27 @@ namespace boost // 32-bit types -----------------------------------------------------------// -# if ULONG_MAX == 0xffffffff - typedef long int32_t; - typedef long int_least32_t; - typedef long int_fast32_t; - typedef unsigned long uint32_t; - typedef unsigned long uint_least32_t; - typedef unsigned long uint_fast32_t; -# elif UINT_MAX == 0xffffffff +# if UINT_MAX == 0xffffffff typedef int int32_t; typedef int int_least32_t; typedef int int_fast32_t; typedef unsigned int uint32_t; typedef unsigned int uint_least32_t; typedef unsigned int uint_fast32_t; +# elif (USHRT_MAX == 0xffffffff) + typedef short int32_t; + typedef short int_least32_t; + typedef short int_fast32_t; + typedef unsigned short uint32_t; + typedef unsigned short uint_least32_t; + typedef unsigned short uint_fast32_t; +# elif ULONG_MAX == 0xffffffff + typedef long int32_t; + typedef long int_least32_t; + typedef long int_fast32_t; + typedef unsigned long uint32_t; + typedef unsigned long uint_least32_t; + typedef unsigned long uint_fast32_t; # elif (UINT_MAX == 0xffffffffffffffff) && defined(__MTA__) // Integers are 64 bits on the MTA / XMT typedef __int32 int32_t; diff --git a/boost/boost/detail/container_fwd.hpp b/boost/boost/detail/container_fwd.hpp index 67c5a21c8a..9a2125230f 100644 --- a/boost/boost/detail/container_fwd.hpp +++ b/boost/boost/detail/container_fwd.hpp @@ -68,7 +68,11 @@ namespace std template struct char_traits; #endif - template class complex; + #if BOOST_CLANG + template struct complex; + #else + template class complex; + #endif } // gcc 3.4 and greater diff --git a/boost/boost/detail/endian.hpp b/boost/boost/detail/endian.hpp index 5f9b90efd9..98c870ca2f 100755 --- a/boost/boost/detail/endian.hpp +++ b/boost/boost/detail/endian.hpp @@ -44,11 +44,13 @@ # endif # define BOOST_BYTE_ORDER __BYTE_ORDER #elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \ - defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) + defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__) || \ + defined(_STLP_BIG_ENDIAN) && !defined(_STLP_LITTLE_ENDIAN) # define BOOST_BIG_ENDIAN # define BOOST_BYTE_ORDER 4321 #elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \ - defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) + defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__) || \ + defined(_STLP_LITTLE_ENDIAN) && !defined(_STLP_BIG_ENDIAN) # define BOOST_LITTLE_ENDIAN # define BOOST_BYTE_ORDER 1234 #elif defined(__sparc) || defined(__sparc__) \ diff --git a/boost/boost/detail/is_incrementable.hpp b/boost/boost/detail/is_incrementable.hpp index 1c8fd5785b..e7ef9dc625 100644 --- a/boost/boost/detail/is_incrementable.hpp +++ b/boost/boost/detail/is_incrementable.hpp @@ -70,10 +70,10 @@ namespace is_incrementable_ # endif // two check overloads help us identify which operator++ was picked - char (& check(tag) )[2]; + char (& check_(tag) )[2]; template - char check(T const&); + char check_(T const&); template @@ -83,7 +83,7 @@ namespace is_incrementable_ BOOST_STATIC_CONSTANT( bool - , value = sizeof(is_incrementable_::check(BOOST_comma(++x,0))) == 1 + , value = sizeof(is_incrementable_::check_(BOOST_comma(++x,0))) == 1 ); }; @@ -94,7 +94,7 @@ namespace is_incrementable_ BOOST_STATIC_CONSTANT( bool - , value = sizeof(is_incrementable_::check(BOOST_comma(x++,0))) == 1 + , value = sizeof(is_incrementable_::check_(BOOST_comma(x++,0))) == 1 ); }; diff --git a/boost/boost/detail/lightweight_test.hpp b/boost/boost/detail/lightweight_test.hpp index ffa750d324..8add322630 100755 --- a/boost/boost/detail/lightweight_test.hpp +++ b/boost/boost/detail/lightweight_test.hpp @@ -24,6 +24,7 @@ // #include +#include #include namespace boost @@ -32,9 +33,26 @@ namespace boost namespace detail { +struct report_errors_reminder +{ + bool called_report_errors_function; + report_errors_reminder() : called_report_errors_function(false) {} + ~report_errors_reminder() + { + BOOST_ASSERT(called_report_errors_function); // verify report_errors() was called + } +}; + +inline report_errors_reminder& report_errors_remind() +{ + static report_errors_reminder r; + return r; +} + inline int & test_errors() { static int x = 0; + report_errors_remind(); return x; } @@ -68,6 +86,8 @@ template inline void test_eq_impl( char const * expr1, char co inline int report_errors() { + detail::report_errors_remind().called_report_errors_function = true; + int errors = detail::test_errors(); if( errors == 0 ) diff --git a/boost/boost/detail/sp_typeinfo.hpp b/boost/boost/detail/sp_typeinfo.hpp index 3ee934f6a5..43fae78ef1 100755 --- a/boost/boost/detail/sp_typeinfo.hpp +++ b/boost/boost/detail/sp_typeinfo.hpp @@ -74,7 +74,13 @@ template struct sp_typeid_ } }; +#if defined(__SUNPRO_CC) +// see #4199, the Sun Studio compiler gets confused about static initialization +// constructor arguments. But an assignment works just fine. template sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name(); +#else +template sp_typeinfo sp_typeid_< T >::ti_(sp_typeid_< T >::name()); +#endif template struct sp_typeid_< T & >: sp_typeid_< T > { diff --git a/boost/boost/exception/diagnostic_information.hpp b/boost/boost/exception/diagnostic_information.hpp index 1d6bc2cc98..229767636d 100755 --- a/boost/boost/exception/diagnostic_information.hpp +++ b/boost/boost/exception/diagnostic_information.hpp @@ -137,7 +137,7 @@ boost } #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'; diff --git a/boost/boost/functional/hash/detail/hash_float_generic.hpp b/boost/boost/functional/hash/detail/hash_float_generic.hpp index fdbf53fe57..1278c2f626 100644 --- a/boost/boost/functional/hash/detail/hash_float_generic.hpp +++ b/boost/boost/functional/hash/detail/hash_float_generic.hpp @@ -53,7 +53,7 @@ namespace boost v = ldexp(v, limits::digits); std::size_t seed = static_cast(v); - v -= seed; + v -= static_cast(seed); // ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1; std::size_t const length @@ -66,7 +66,7 @@ namespace boost { v = ldexp(v, limits::digits); std::size_t part = static_cast(v); - v -= part; + v -= static_cast(part); hash_float_combine(seed, part); } diff --git a/boost/boost/functional/hash/hash.hpp b/boost/boost/functional/hash/hash.hpp index 108d3eda3a..51ec8608c8 100644 --- a/boost/boost/functional/hash/hash.hpp +++ b/boost/boost/functional/hash/hash.hpp @@ -24,6 +24,10 @@ #include #endif +#if !defined(BOOST_NO_0X_HDR_TYPEINDEX) +#include +#endif + #if BOOST_WORKAROUND(__GNUC__, < 3) \ && !defined(__SGI_STL_PORT) && !defined(_STLPORT_VERSION) #define BOOST_HASH_CHAR_TRAITS string_char_traits @@ -87,6 +91,10 @@ namespace boost std::size_t hash_value( std::basic_string, A> const&); +#if !defined(BOOST_NO_0X_HDR_TYPEINDEX) + std::size_t hash_value(std::type_index); +#endif + // Implementation namespace hash_detail @@ -209,9 +217,15 @@ namespace boost template std::size_t hash_value(T* v) #endif { +#if defined(__VMS) && __INITIAL_POINTER_SIZE == 64 + // for some reason ptrdiff_t on OpenVMS compiler with + // 64 bit is not 64 bit !!! + std::size_t x = static_cast( + reinterpret_cast(v)); +#else std::size_t x = static_cast( reinterpret_cast(v)); - +#endif return x + (x >> 3); } @@ -325,6 +339,13 @@ namespace boost return boost::hash_detail::float_hash_value(v); } +#if !defined(BOOST_NO_0X_HDR_TYPEINDEX) + inline std::size_t hash_value(std::type_index v) + { + return v.hash_code(); + } +#endif + // // boost::hash // @@ -429,6 +450,10 @@ namespace boost BOOST_HASH_SPECIALIZE(boost::ulong_long_type) #endif +#if !defined(BOOST_NO_0X_HDR_TYPEINDEX) + BOOST_HASH_SPECIALIZE(std::type_index) +#endif + #undef BOOST_HASH_SPECIALIZE #undef BOOST_HASH_SPECIALIZE_REF diff --git a/boost/boost/integer/integer_mask.hpp b/boost/boost/integer/integer_mask.hpp index 8c4e1bb1c4..2acf7f7dff 100644 --- a/boost/boost/integer/integer_mask.hpp +++ b/boost/boost/integer/integer_mask.hpp @@ -20,6 +20,17 @@ #include // for std::numeric_limits +// +// We simply cannot include this header on gcc without getting copious warnings of the kind: +// +// boost/integer/integer_mask.hpp:93:35: warning: use of C99 long long integer constant +// +// And yet there is no other reasonable implementation, so we declare this a system header +// to suppress these warnings. +// +#if defined(__GNUC__) && (__GNUC__ >= 4) +#pragma GCC system_header +#endif namespace boost { @@ -89,6 +100,19 @@ BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned int ); BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned long ); #endif +#if defined(BOOST_HAS_LONG_LONG) + #if ((defined(ULLONG_MAX) && (ULLONG_MAX > ULONG_MAX)) ||\ + (defined(ULONG_LONG_MAX) && (ULONG_LONG_MAX > ULONG_MAX)) ||\ + (defined(ULONGLONG_MAX) && (ULONGLONG_MAX > ULONG_MAX)) ||\ + (defined(_ULLONG_MAX) && (_ULLONG_MAX > ULONG_MAX))) + BOOST_LOW_BITS_MASK_SPECIALIZE( boost::ulong_long_type ); + #endif +#elif defined(BOOST_HAS_MS_INT64) + #if 18446744073709551615ui64 > ULONG_MAX + BOOST_LOW_BITS_MASK_SPECIALIZE( unsigned __int64 ); + #endif +#endif + #ifdef BOOST_MSVC #pragma warning(pop) #endif diff --git a/boost/boost/integer_fwd.hpp b/boost/boost/integer_fwd.hpp index e6045ca39d..20eff2bcf6 100644 --- a/boost/boost/integer_fwd.hpp +++ b/boost/boost/integer_fwd.hpp @@ -136,22 +136,6 @@ template < std::size_t Bits > template < > struct low_bits_mask_t< ::std::numeric_limits::digits >; -#if USHRT_MAX > UCHAR_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if UINT_MAX > USHRT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - -#if ULONG_MAX > UINT_MAX -template < > - struct low_bits_mask_t< ::std::numeric_limits::digits >; -#endif - - // From ------------------------------------// template diff --git a/boost/boost/iterator/iterator_facade.hpp b/boost/boost/iterator/iterator_facade.hpp index 967d60f2ba..5ee73b5aa4 100644 --- a/boost/boost/iterator/iterator_facade.hpp +++ b/boost/boost/iterator/iterator_facade.hpp @@ -105,6 +105,7 @@ namespace boost typedef typename remove_const::type value_type; + // Not the real associated pointer type typedef typename mpl::eval_if< boost::detail::iterator_writability_disabled , add_pointer @@ -323,7 +324,7 @@ namespace boost static type make(Reference x) { - return implicit_cast(&x); + return boost::implicit_cast(&x); } }; @@ -617,6 +618,12 @@ namespace boost Value, CategoryOrTraversal, Reference, Difference > associated_types; + typedef boost::detail::operator_arrow_result< + typename associated_types::value_type + , Reference + , typename associated_types::pointer + > pointer_; + protected: // For use by derived classes typedef iterator_facade iterator_facade_; @@ -626,7 +633,9 @@ namespace boost typedef typename associated_types::value_type value_type; typedef Reference reference; typedef Difference difference_type; - typedef typename associated_types::pointer pointer; + + typedef typename pointer_::type pointer; + typedef typename associated_types::iterator_category iterator_category; reference operator*() const @@ -634,18 +643,9 @@ namespace boost return iterator_core_access::dereference(this->derived()); } - typename boost::detail::operator_arrow_result< - value_type - , reference - , pointer - >::type - operator->() const + pointer operator->() const { - return boost::detail::operator_arrow_result< - value_type - , reference - , pointer - >::make(*this->derived()); + return pointer_::make(*this->derived()); } typename boost::detail::operator_brackets_result::type diff --git a/boost/boost/optional/optional.hpp b/boost/boost/optional/optional.hpp index 88041d1441..ec9006eef9 100644 --- a/boost/boost/optional/optional.hpp +++ b/boost/boost/optional/optional.hpp @@ -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,27 +9,34 @@ // You are welcome to contact the author at: // fernando_cacciola@hotmail.com // +// Revisions: +// 27 Apr 2008 (improved swap) Fernando Cacciola, Niels Dekker, Thorsten Ottosen +// #ifndef BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP #define BOOST_OPTIONAL_OPTIONAL_FLC_19NOV2002_HPP -#include -#include +#include +#include -#include "boost/config.hpp" -#include "boost/assert.hpp" -#include "boost/type.hpp" -#include "boost/type_traits/alignment_of.hpp" -#include "boost/type_traits/type_with_alignment.hpp" -#include "boost/type_traits/remove_reference.hpp" -#include "boost/type_traits/is_reference.hpp" -#include "boost/mpl/if.hpp" -#include "boost/mpl/bool.hpp" -#include "boost/mpl/not.hpp" -#include "boost/detail/reference_content.hpp" -#include "boost/none.hpp" -#include "boost/utility/compare_pointees.hpp" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include -#include "boost/optional/optional_fwd.hpp" +#include #if BOOST_WORKAROUND(BOOST_MSVC, == 1200) // VC6.0 has the following bug: @@ -76,6 +83,15 @@ #define BOOST_OPTIONAL_WEAK_OVERLOAD_RESOLUTION #endif +#if defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) > 302 \ + && !defined(__INTEL_COMPILER) +// GCC since 3.3 has may_alias attribute that helps to alleviate optimizer issues with +// regard to violation of the strict aliasing rules. The optional< T > storage type is marked +// with this attribute in order to let the compiler know that it will alias objects of type T +// and silence compilation warnings. +#define BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS +#endif + // Daniel Wallin discovered that bind/apply.hpp badly interacts with the apply<> // member template of a factory as used in the optional<> implementation. // He proposed this simple fix which is to move the call to apply<> outside @@ -83,7 +99,7 @@ namespace boost_optional_detail { template - void construct(Factory const& factory, void* address) + inline void construct(Factory const& factory, void* address) { factory.BOOST_NESTED_TEMPLATE apply(address); } @@ -95,6 +111,9 @@ namespace boost { class in_place_factory_base ; class typed_in_place_factory_base ; +// This forward is needed to refer to namespace scope swap from the member swap +template void swap ( optional& x, optional& y ); + namespace optional_detail { // This local class is used instead of that in "aligned_storage.hpp" @@ -105,7 +124,12 @@ template class aligned_storage { // Borland ICEs if unnamed unions are used for this! - union dummy_u + union + // This works around GCC warnings about breaking strict aliasing rules when casting storage address to T* +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + __attribute__((may_alias)) +#endif + dummy_u { char data[ sizeof(T) ]; BOOST_DEDUCED_TYPENAME type_with_alignment< @@ -114,8 +138,13 @@ class aligned_storage public: - void const* address() const { return &dummy_.data[0]; } - void * address() { return &dummy_.data[0]; } +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + void const* address() const { return &dummy_; } + void * address() { return &dummy_; } +#else + void const* address() const { return dummy_.data; } + void * address() { return dummy_.data; } +#endif } ; template @@ -149,7 +178,7 @@ class optional_base : public optional_tag typedef #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564)) BOOST_DEDUCED_TYPENAME -#endif +#endif ::boost::detail::make_reference_content::type internal_type ; typedef aligned_storage storage_type ; @@ -200,7 +229,7 @@ class optional_base : public optional_tag { construct(val); } - + // Creates an optional initialized with 'val' IFF cond is true, otherwise creates an uninitialzed optional. // Can throw if T::T(T const&) does optional_base ( bool cond, argument_type val ) @@ -421,8 +450,22 @@ class optional_base : public optional_tag private : // internal_type can be either T or reference_content +#if defined(BOOST_OPTIONAL_DETAIL_USE_ATTRIBUTE_MAY_ALIAS) + // This workaround is supposed to silence GCC warnings about broken strict aliasing rules + internal_type const* get_object() const + { + union { void const* ap_pvoid; internal_type const* as_ptype; } caster = { m_storage.address() }; + return caster.as_ptype; + } + internal_type * get_object() + { + union { void* ap_pvoid; internal_type* as_ptype; } caster = { m_storage.address() }; + return caster.as_ptype; + } +#else internal_type const* get_object() const { return static_cast(m_storage.address()); } internal_type * get_object() { return static_cast (m_storage.address()); } +#endif // reference_content lacks an implicit conversion to T&, so the following is needed to obtain a proper reference. reference_const_type dereference( internal_type const* p, is_not_reference_tag ) const { return *p ; } @@ -513,12 +556,12 @@ class optional : public optional_detail::optional_base // Depending on the above some T ctor is called. // Can throw is the resolved T ctor throws. template - explicit optional ( Expr const& expr ) : base(expr,&expr) {} + explicit optional ( Expr const& expr ) : base(expr,boost::addressof(expr)) {} #endif // Creates a deep copy of another optional // Can throw if T::T(T const&) does - optional ( optional const& rhs ) : base(rhs) {} + optional ( optional const& rhs ) : base( static_cast(rhs) ) {} // No-throw (assuming T::~T() doesn't) ~optional() {} @@ -527,9 +570,9 @@ class optional : public optional_detail::optional_base // Assigns from an expression. See corresponding constructor. // Basic Guarantee: If the resolved T ctor throws, this is left UNINITIALIZED template - optional& operator= ( Expr expr ) + optional& operator= ( Expr const& expr ) { - this->assign_expr(expr,&expr); + this->assign_expr(expr,boost::addressof(expr)); return *this ; } #endif @@ -552,7 +595,7 @@ class optional : public optional_detail::optional_base // (NOTE: On BCB, this operator is not actually called and left is left UNMODIFIED in case of a throw) optional& operator= ( optional const& rhs ) { - this->assign( rhs ) ; + this->assign( static_cast(rhs) ) ; return *this ; } @@ -573,6 +616,14 @@ class optional : public optional_detail::optional_base return *this ; } + void swap( optional & arg ) + { + // allow for Koenig lookup + using boost::swap; + swap(*this, arg); + } + + // Returns a reference to the value if this is initialized, otherwise, // the behaviour is UNDEFINED // No-throw @@ -582,7 +633,7 @@ class optional : public optional_detail::optional_base // Returns a copy of the value if this is initialized, 'v' otherwise reference_const_type get_value_or ( reference_const_type v ) const { return this->is_initialized() ? get() : v ; } reference_type get_value_or ( reference_type v ) { return this->is_initialized() ? get() : v ; } - + // Returns a pointer to the value if this is initialized, otherwise, // the behaviour is UNDEFINED // No-throw @@ -599,22 +650,22 @@ class optional : public optional_detail::optional_base // No-throw operator unspecified_bool_type() const { return this->safe_bool() ; } - // This is provided for those compilers which don't like the conversion to bool - // on some contexts. - bool operator!() const { return !this->is_initialized() ; } + // This is provided for those compilers which don't like the conversion to bool + // on some contexts. + bool operator!() const { return !this->is_initialized() ; } } ; // Returns optional(v) -template -inline +template +inline optional make_optional ( T const& v ) { return optional(v); } // Returns optional(cond,v) -template -inline +template +inline optional make_optional ( bool cond, T const& v ) { return optional(cond,v); @@ -867,58 +918,74 @@ inline bool operator >= ( none_t x, optional const& y ) { return !( x < y ) ; } -// -// The following swap implementation follows the GCC workaround as found in -// "boost/detail/compressed_pair.hpp" -// namespace optional_detail { -// GCC < 3.2 gets the using declaration at namespace scope (FLC, DWA) -#if BOOST_WORKAROUND(__GNUC__, < 3) \ - || BOOST_WORKAROUND(__GNUC__, == 3) && __GNUC_MINOR__ <= 2 - using std::swap; -#define BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE -#endif +template struct swap_selector; -// optional's swap: -// If both are initialized, calls swap(T&, T&). If this swap throws, both will remain initialized but their values are now unspecified. -// If only one is initialized, calls U.reset(*I), THEN I.reset(). -// If U.reset(*I) throws, both are left UNCHANGED (U is kept uinitialized and I is never reset) -// If both are uninitialized, do nothing (no-throw) -template -inline -void optional_swap ( optional& x, optional& y ) +template<> +struct swap_selector { - if ( !x && !!y ) - { - x.reset(*y); - y.reset(); - } - else if ( !!x && !y ) - { - y.reset(*x); - x.reset(); - } - else if ( !!x && !!y ) - { -// GCC > 3.2 and all other compilers have the using declaration at function scope (FLC) -#ifndef BOOST_OPTIONAL_STD_SWAP_INTRODUCED_AT_NS_SCOPE - // allow for Koenig lookup - using std::swap ; -#endif - swap(*x,*y); - } -} + template + static void optional_swap ( optional& x, optional& y ) + { + const bool hasX = !!x; + const bool hasY = !!y; + + if ( !hasX && !hasY ) + return; + + if( !hasX ) + x = boost::in_place(); + else if ( !hasY ) + y = boost::in_place(); + + // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers + boost::swap(x.get(),y.get()); + + if( !hasX ) + y = boost::none ; + else if( !hasY ) + x = boost::none ; + } +}; + +template<> +struct swap_selector +{ + template + static void optional_swap ( optional& x, optional& y ) + { + const bool hasX = !!x; + const bool hasY = !!y; + + if ( !hasX && hasY ) + { + x = y.get(); + y = boost::none ; + } + else if ( hasX && !hasY ) + { + y = x.get(); + x = boost::none ; + } + else if ( hasX && hasY ) + { + // Boost.Utility.Swap will take care of ADL and workarounds for broken compilers + boost::swap(x.get(),y.get()); + } + } +}; } // namespace optional_detail +template +struct optional_swap_should_use_default_constructor : has_nothrow_default_constructor {} ; + template inline void swap ( optional& x, optional& y ) { - optional_detail::optional_swap(x,y); + optional_detail::swap_selector::value>::optional_swap(x, y); } - } // namespace boost #endif - diff --git a/boost/boost/optional/optional_io.hpp b/boost/boost/optional/optional_io.hpp index 85a18575d0..9e0c807d3e 100644 --- a/boost/boost/optional/optional_io.hpp +++ b/boost/boost/optional/optional_io.hpp @@ -13,19 +13,20 @@ #define BOOST_OPTIONAL_OPTIONAL_IO_FLC_19NOV2002_HPP #if defined __GNUC__ -# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97) +# if (__GNUC__ == 2 && __GNUC_MINOR__ <= 97) # define BOOST_OPTIONAL_NO_TEMPLATED_STREAMS # endif #endif // __GNUC__ #if defined BOOST_OPTIONAL_NO_TEMPLATED_STREAMS # include -#else +#else # include # include -#endif - +#endif +#include +#include #include "boost/optional/optional.hpp" #include "boost/utility/value_init.hpp" @@ -62,17 +63,30 @@ std::basic_istream& operator>>(std::basic_istream& in, optional& v) #endif { - if ( in.good() ) + if (in.good()) { int d = in.get(); - if ( d == ' ' ) + if (d == ' ') { - T x ; + T x; in >> x; - v = x ; + v = x; } else - v = optional() ; + { + if (d == '-') + { + d = in.get(); + + if (d == '-') + { + v = none; + return in; + } + } + + in.setstate( std::ios::failbit ); + } } return in; diff --git a/boost/boost/regex/concepts.hpp b/boost/boost/regex/concepts.hpp index 6ef8864274..f3ca53d464 100644 --- a/boost/boost/regex/concepts.hpp +++ b/boost/boost/regex/concepts.hpp @@ -412,7 +412,7 @@ struct BaseRegexConcept // access: const Regex ce; - unsigned i = ce.mark_count(); + typename Regex::size_type i = ce.mark_count(); ignore_unused_variable_warning(i); m_flags = ce.flags(); e.imbue(ce.getloc()); diff --git a/boost/boost/regex/config.hpp b/boost/boost/regex/config.hpp index d55881a3ea..a88a7852ea 100644 --- a/boost/boost/regex/config.hpp +++ b/boost/boost/regex/config.hpp @@ -255,6 +255,10 @@ # define BOOST_REGEX_USE_CPP_LOCALE #endif +#if defined(__CYGWIN__) +# define BOOST_REGEX_USE_C_LOCALE +#endif + /* Win32 defaults to native Win32 locale: */ #if defined(_WIN32) && !defined(BOOST_REGEX_USE_WIN32_LOCALE) && !defined(BOOST_REGEX_USE_C_LOCALE) && !defined(BOOST_REGEX_USE_CPP_LOCALE) && !defined(BOOST_REGEX_NO_W32) # define BOOST_REGEX_USE_WIN32_LOCALE diff --git a/boost/boost/regex/pending/object_cache.hpp b/boost/boost/regex/pending/object_cache.hpp index e1aa191da2..db60e28afd 100644 --- a/boost/boost/regex/pending/object_cache.hpp +++ b/boost/boost/regex/pending/object_cache.hpp @@ -41,10 +41,10 @@ public: typedef std::map map_type; typedef typename map_type::iterator map_iterator; typedef typename list_type::size_type size_type; - static boost::shared_ptr get(const Key& k, size_type max_cache_size); + static boost::shared_ptr get(const Key& k, size_type l_max_cache_size); private: - static boost::shared_ptr do_get(const Key& k, size_type max_cache_size); + static boost::shared_ptr do_get(const Key& k, size_type l_max_cache_size); struct data { @@ -58,7 +58,7 @@ private: }; template -boost::shared_ptr object_cache::get(const Key& k, size_type max_cache_size) +boost::shared_ptr object_cache::get(const Key& k, size_type l_max_cache_size) { #ifdef BOOST_HAS_THREADS static boost::static_mutex mut = BOOST_STATIC_MUTEX_INIT; @@ -66,7 +66,7 @@ boost::shared_ptr object_cache::get(const Key& k, siz boost::static_mutex::scoped_lock l(mut); if(l) { - return do_get(k, max_cache_size); + return do_get(k, l_max_cache_size); } // // what do we do if the lock fails? @@ -77,12 +77,12 @@ boost::shared_ptr object_cache::get(const Key& k, siz return boost::shared_ptr(); #endif #else - return do_get(k, max_cache_size); + return do_get(k, l_max_cache_size); #endif } template -boost::shared_ptr object_cache::do_get(const Key& k, size_type max_cache_size) +boost::shared_ptr object_cache::do_get(const Key& k, size_type l_max_cache_size) { typedef typename object_cache::data object_data; typedef typename map_type::size_type map_size_type; @@ -128,7 +128,7 @@ boost::shared_ptr object_cache::do_get(const Key& k, BOOST_ASSERT(s_data.index[k]->first.get() == result.get()); BOOST_ASSERT(&(s_data.index.find(k)->first) == s_data.cont.back().second); BOOST_ASSERT(s_data.index.find(k)->first == k); - if(s > max_cache_size) + if(s > l_max_cache_size) { // // We have too many items in the list, so we need to start @@ -137,7 +137,7 @@ boost::shared_ptr object_cache::do_get(const Key& k, // list_iterator pos = s_data.cont.begin(); list_iterator last = s_data.cont.end(); - while((pos != last) && (s > max_cache_size)) + while((pos != last) && (s > l_max_cache_size)) { if(pos->first.unique()) { diff --git a/boost/boost/regex/pending/static_mutex.hpp b/boost/boost/regex/pending/static_mutex.hpp index 334ef27d32..9c10050b23 100644 --- a/boost/boost/regex/pending/static_mutex.hpp +++ b/boost/boost/regex/pending/static_mutex.hpp @@ -96,8 +96,14 @@ class BOOST_REGEX_DECL scoped_static_mutex_lock public: scoped_static_mutex_lock(static_mutex& mut, bool lk = true); ~scoped_static_mutex_lock(); - operator void const*()const; - bool locked()const; + operator void const*()const + { + return locked() ? this : 0; + } + bool locked()const + { + return m_have_lock; + } void lock(); void unlock(); private: @@ -107,16 +113,6 @@ private: scoped_static_mutex_lock& operator=(const scoped_static_mutex_lock&); }; -inline scoped_static_mutex_lock::operator void const*()const -{ - return locked() ? this : 0; -} - -inline bool scoped_static_mutex_lock::locked()const -{ - return m_have_lock; -} - } // namespace #else diff --git a/boost/boost/regex/v4/basic_regex.hpp b/boost/boost/regex/v4/basic_regex.hpp index 09b0467b40..04c7bb3743 100644 --- a/boost/boost/regex/v4/basic_regex.hpp +++ b/boost/boost/regex/v4/basic_regex.hpp @@ -53,7 +53,7 @@ void bubble_down_one(I first, I last) if(first != last) { I next = last - 1; - while((next != first) && !(*(next-1) < *next)) + while((next != first) && (*next < *(next-1))) { (next-1)->swap(*next); --next; @@ -61,70 +61,59 @@ void bubble_down_one(I first, I last) } } -// -// Class named_subexpressions -// Contains information about named subexpressions within the regex. -// -template -class named_subexpressions_base -{ -public: - virtual int get_id(const charT* i, const charT* j)const = 0; - virtual int get_id(std::size_t hash)const = 0; -#ifdef __GNUC__ - // warning supression: - virtual ~named_subexpressions_base(){} -#endif -}; - template -inline std::size_t hash_value_from_capture_name(Iterator i, Iterator j) +inline int hash_value_from_capture_name(Iterator i, Iterator j) { std::size_t r = boost::hash_range(i, j); r %= ((std::numeric_limits::max)() - 10001); r += 10000; - return r; + return static_cast(r); } -template -class named_subexpressions : public named_subexpressions_base +class named_subexpressions { +public: struct name { + template name(const charT* i, const charT* j, int idx) - : /*n(i, j), */ index(idx) + : index(idx) { hash = hash_value_from_capture_name(i, j); } - name(std::size_t h, int idx) + name(int h, int idx) : index(idx), hash(h) { } - //std::vector n; int index; - std::size_t hash; + int hash; bool operator < (const name& other)const { - return hash < other.hash; //std::lexicographical_compare(n.begin(), n.end(), other.n.begin(), other.n.end()); + return hash < other.hash; } bool operator == (const name& other)const { - return hash == other.hash; //n == other.n; + return hash == other.hash; } void swap(name& other) { - //n.swap(other.n); std::swap(index, other.index); std::swap(hash, other.hash); } }; -public: + + typedef std::vector::const_iterator const_iterator; + typedef std::pair range_type; + named_subexpressions(){} + + template void set_name(const charT* i, const charT* j, int index) { m_sub_names.push_back(name(i, j, index)); bubble_down_one(m_sub_names.begin(), m_sub_names.end()); } + template int get_id(const charT* i, const charT* j)const { name t(i, j, 0); @@ -135,72 +124,37 @@ public: } return -1; } - int get_id(std::size_t h)const + template + range_type equal_range(const charT* i, const charT* j)const + { + name t(i, j, 0); + return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t); + } + int get_id(int h)const { name t(h, 0); - typename std::vector::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t); + std::vector::const_iterator pos = std::lower_bound(m_sub_names.begin(), m_sub_names.end(), t); if((pos != m_sub_names.end()) && (*pos == t)) { return pos->index; } return -1; } + range_type equal_range(int h)const + { + name t(h, 0); + return std::equal_range(m_sub_names.begin(), m_sub_names.end(), t); + } private: std::vector m_sub_names; }; -template -class named_subexpressions_converter : public named_subexpressions_base -{ - boost::shared_ptr > m_converter; -public: - named_subexpressions_converter(boost::shared_ptr > s) - : m_converter(s) {} - int get_id(const charT* i, const charT* j)const - { - if(i == j) - return -1; - std::vector v; - while(i != j) - { - v.push_back(*i); - ++i; - } - return m_converter->get_id(&v[0], &v[0] + v.size()); - } - int get_id(std::size_t h)const - { - return m_converter->get_id(h); - } -}; - -template -inline boost::shared_ptr > convert_to_named_subs_imp( - boost::shared_ptr > s, - boost::integral_constant const&) -{ - return s; -} -template -inline boost::shared_ptr > convert_to_named_subs_imp( - boost::shared_ptr > s, - boost::integral_constant const&) -{ - return boost::shared_ptr >(new named_subexpressions_converter(s)); -} -template -inline boost::shared_ptr > convert_to_named_subs( - boost::shared_ptr > s) -{ - typedef typename boost::is_same::type tag_type; - return convert_to_named_subs_imp(s, tag_type()); -} // // class regex_data: // represents the data we wish to expose to the matching algorithms. // template -struct regex_data : public named_subexpressions +struct regex_data : public named_subexpressions { typedef regex_constants::syntax_option_type flag_type; typedef std::size_t size_type; @@ -672,7 +626,7 @@ public: BOOST_ASSERT(0 != m_pimpl.get()); return m_pimpl->get_data(); } - boost::shared_ptr > get_named_subs()const + boost::shared_ptr get_named_subs()const { return m_pimpl; } diff --git a/boost/boost/regex/v4/basic_regex_creator.hpp b/boost/boost/regex/v4/basic_regex_creator.hpp index f3bc006178..efa9f7dd8e 100644 --- a/boost/boost/regex/v4/basic_regex_creator.hpp +++ b/boost/boost/regex/v4/basic_regex_creator.hpp @@ -806,7 +806,13 @@ void basic_regex_creator::fixup_recursions(re_syntax_base* state) re_syntax_base* p = base; std::ptrdiff_t idx = static_cast(state)->alt.i; if(idx > 10000) - idx = m_pdata->get_id(idx); + { + // + // There may be more than one capture group with this hash, just do what Perl + // does and recurse to the leftmost: + // + idx = m_pdata->get_id(static_cast(idx)); + } while(p) { if((p->type == syntax_element_startmark) && (static_cast(p)->index == idx)) diff --git a/boost/boost/regex/v4/basic_regex_parser.hpp b/boost/boost/regex/v4/basic_regex_parser.hpp index 172b53a008..4dacfc6f33 100644 --- a/boost/boost/regex/v4/basic_regex_parser.hpp +++ b/boost/boost/regex/v4/basic_regex_parser.hpp @@ -820,7 +820,11 @@ escape_type_class_jump: return false; } // maybe have \g{ddd} - if(this->m_traits.syntax_type(*m_position) == regex_constants::syntax_open_brace) + regex_constants::syntax_type syn = this->m_traits.syntax_type(*m_position); + regex_constants::syntax_type syn_end = 0; + if((syn == regex_constants::syntax_open_brace) + || (syn == regex_constants::escape_type_left_word) + || (syn == regex_constants::escape_type_end_buffer)) { if(++m_position == m_end) { @@ -828,6 +832,18 @@ escape_type_class_jump: return false; } have_brace = true; + switch(syn) + { + case regex_constants::syntax_open_brace: + syn_end = regex_constants::syntax_close_brace; + break; + case regex_constants::escape_type_left_word: + syn_end = regex_constants::escape_type_right_word; + break; + default: + syn_end = regex_constants::escape_type_end_buffer; + break; + } } negative = (*m_position == static_cast('-')); if((negative) && (++m_position == m_end)) @@ -837,18 +853,20 @@ escape_type_class_jump: } const charT* pc = m_position; int i = this->m_traits.toi(pc, m_end, 10); - if(i < 0) + if((i < 0) && syn_end) { - // Check for a named capture: + // Check for a named capture, get the leftmost one if there is more than one: const charT* base = m_position; - while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) + while((m_position != m_end) && (this->m_traits.syntax_type(*m_position) != syn_end)) + { ++m_position; - i = this->m_pdata->get_id(base, m_position); + } + i = hash_value_from_capture_name(base, m_position); pc = m_position; } if(negative) i = 1 + m_mark_count - i; - if((i > 0) && (this->m_backrefs & (1u << (i-1)))) + if(((i > 0) && (this->m_backrefs & (1u << (i-1)))) || ((i > 10000) && (this->m_pdata->get_id(i) > 0) && (this->m_backrefs & (1u << (this->m_pdata->get_id(i)-1))))) { m_position = pc; re_brace* pb = static_cast(this->append_state(syntax_element_backref, sizeof(re_brace))); @@ -863,7 +881,7 @@ escape_type_class_jump: m_position = pc; if(have_brace) { - if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != regex_constants::syntax_close_brace)) + if((m_position == m_end) || (this->m_traits.syntax_type(*m_position) != syn_end)) { fail(regex_constants::error_escape, m_position - m_base, incomplete_message); return false; @@ -1003,6 +1021,21 @@ bool basic_regex_parser::parse_repeat(std::size_t low, std::size_ // if(pocessive) { + if(m_position != m_end) + { + // + // Check for illegal following quantifier, we have to do this here, because + // the extra states we insert below circumvents are usual error checking :-( + // + switch(this->m_traits.syntax_type(*m_position)) + { + case regex_constants::syntax_star: + case regex_constants::syntax_plus: + case regex_constants::syntax_question: + fail(regex_constants::error_badrepeat, m_position - m_base); + return false; + } + } re_brace* pb = static_cast(this->insert_state(insert_point, syntax_element_startmark, sizeof(re_brace))); pb->index = -3; pb->icase = this->flags() & regbase::icase; diff --git a/boost/boost/regex/v4/cpp_regex_traits.hpp b/boost/boost/regex/v4/cpp_regex_traits.hpp index addc96cd6e..cd22bd8e53 100644 --- a/boost/boost/regex/v4/cpp_regex_traits.hpp +++ b/boost/boost/regex/v4/cpp_regex_traits.hpp @@ -827,20 +827,20 @@ template bool cpp_regex_traits_implementation::isctype(const charT c, char_class_type mask) const { return - ((mask & ::boost::re_detail::char_class_space) && (m_pctype->is(std::ctype::space, c))) - || ((mask & ::boost::re_detail::char_class_print) && (m_pctype->is(std::ctype::print, c))) - || ((mask & ::boost::re_detail::char_class_cntrl) && (m_pctype->is(std::ctype::cntrl, c))) - || ((mask & ::boost::re_detail::char_class_upper) && (m_pctype->is(std::ctype::upper, c))) - || ((mask & ::boost::re_detail::char_class_lower) && (m_pctype->is(std::ctype::lower, c))) - || ((mask & ::boost::re_detail::char_class_alpha) && (m_pctype->is(std::ctype::alpha, c))) - || ((mask & ::boost::re_detail::char_class_digit) && (m_pctype->is(std::ctype::digit, c))) - || ((mask & ::boost::re_detail::char_class_punct) && (m_pctype->is(std::ctype::punct, c))) - || ((mask & ::boost::re_detail::char_class_xdigit) && (m_pctype->is(std::ctype::xdigit, c))) - || ((mask & ::boost::re_detail::char_class_blank) && (m_pctype->is(std::ctype::space, c)) && !::boost::re_detail::is_separator(c)) + ((mask & ::boost::re_detail::char_class_space) && (this->m_pctype->is(std::ctype::space, c))) + || ((mask & ::boost::re_detail::char_class_print) && (this->m_pctype->is(std::ctype::print, c))) + || ((mask & ::boost::re_detail::char_class_cntrl) && (this->m_pctype->is(std::ctype::cntrl, c))) + || ((mask & ::boost::re_detail::char_class_upper) && (this->m_pctype->is(std::ctype::upper, c))) + || ((mask & ::boost::re_detail::char_class_lower) && (this->m_pctype->is(std::ctype::lower, c))) + || ((mask & ::boost::re_detail::char_class_alpha) && (this->m_pctype->is(std::ctype::alpha, c))) + || ((mask & ::boost::re_detail::char_class_digit) && (this->m_pctype->is(std::ctype::digit, c))) + || ((mask & ::boost::re_detail::char_class_punct) && (this->m_pctype->is(std::ctype::punct, c))) + || ((mask & ::boost::re_detail::char_class_xdigit) && (this->m_pctype->is(std::ctype::xdigit, c))) + || ((mask & ::boost::re_detail::char_class_blank) && (this->m_pctype->is(std::ctype::space, c)) && !::boost::re_detail::is_separator(c)) || ((mask & ::boost::re_detail::char_class_word) && (c == '_')) || ((mask & ::boost::re_detail::char_class_unicode) && ::boost::re_detail::is_extended(c)) || ((mask & ::boost::re_detail::char_class_vertical_space) && (is_separator(c) || (c == '\v'))) - || ((mask & ::boost::re_detail::char_class_horizontal_space) && m_pctype->is(std::ctype::space, c) && !(is_separator(c) || (c == '\v'))); + || ((mask & ::boost::re_detail::char_class_horizontal_space) && this->m_pctype->is(std::ctype::space, c) && !(is_separator(c) || (c == '\v'))); } #endif diff --git a/boost/boost/regex/v4/match_results.hpp b/boost/boost/regex/v4/match_results.hpp index 8f11bbbe5a..ca9898f4c4 100644 --- a/boost/boost/regex/v4/match_results.hpp +++ b/boost/boost/regex/v4/match_results.hpp @@ -38,7 +38,6 @@ namespace boost{ namespace re_detail{ -template class named_subexpressions; } @@ -69,7 +68,7 @@ public: typedef typename re_detail::regex_iterator_traits< BidiIterator>::value_type char_type; typedef std::basic_string string_type; - typedef re_detail::named_subexpressions_base named_sub_type; + typedef re_detail::named_subexpressions named_sub_type; // construct/copy/destroy: explicit match_results(const Allocator& a = Allocator()) @@ -225,10 +224,15 @@ public: // const_reference named_subexpression(const char_type* i, const char_type* j) const { + // + // Scan for the leftmost *matched* subexpression with the specified named: + // if(m_is_singular) raise_logic_error(); - int index = m_named_subs->get_id(i, j); - return index > 0 ? (*this)[index] : m_null; + re_detail::named_subexpressions::range_type r = m_named_subs->equal_range(i, j); + while((r.first != r.second) && ((*this)[r.first->index].matched == false)) + ++r.first; + return r.first != r.second ? (*this)[r.first->index] : m_null; } template const_reference named_subexpression(const charT* i, const charT* j) const @@ -243,10 +247,20 @@ public: } int named_subexpression_index(const char_type* i, const char_type* j) const { + // + // Scan for the leftmost *matched* subexpression with the specified named. + // If none found then return the leftmost expression with that name, + // otherwise an invalid index: + // if(m_is_singular) raise_logic_error(); - int index = m_named_subs->get_id(i, j); - return index > 0 ? index : -20; + re_detail::named_subexpressions::range_type s, r; + s = r = m_named_subs->equal_range(i, j); + while((r.first != r.second) && ((*this)[r.first->index].matched == false)) + ++r.first; + if(r.first == r.second) + r = s; + return r.first != r.second ? r.first->index : -20; } template int named_subexpression_index(const charT* i, const charT* j) const diff --git a/boost/boost/regex/v4/perl_matcher_common.hpp b/boost/boost/regex/v4/perl_matcher_common.hpp index fe22421000..b8c4e963ca 100644 --- a/boost/boost/regex/v4/perl_matcher_common.hpp +++ b/boost/boost/regex/v4/perl_matcher_common.hpp @@ -200,7 +200,7 @@ bool perl_matcher::match_imp() m_match_flags |= regex_constants::match_all; m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), search_base, last); m_presult->set_base(base); - m_presult->set_named_subs(re_detail::convert_to_named_subs::char_type>(this->re.get_named_subs())); + m_presult->set_named_subs(this->re.get_named_subs()); if(m_match_flags & match_posix) m_result = *m_presult; verify_options(re.flags(), m_match_flags); @@ -262,7 +262,7 @@ bool perl_matcher::find_imp() pstate = re.get_first_state(); m_presult->set_size((m_match_flags & match_nosubs) ? 1 : re.mark_count(), base, last); m_presult->set_base(base); - m_presult->set_named_subs(re_detail::convert_to_named_subs::char_type>(this->re.get_named_subs())); + m_presult->set_named_subs(this->re.get_named_subs()); m_match_flags |= regex_constants::match_init; } else @@ -588,8 +588,23 @@ bool perl_matcher::match_backref() // in the match, this is in line with ECMAScript, but not Perl // or PCRE. // - BidiIterator i = (*m_presult)[static_cast(pstate)->index].first; - BidiIterator j = (*m_presult)[static_cast(pstate)->index].second; + int index = static_cast(pstate)->index; + if(index >= 10000) + { + named_subexpressions::range_type r = re.get_data().equal_range(index); + BOOST_ASSERT(r.first != r.second); + do + { + index = r.first->index; + ++r.first; + }while((r.first != r.second) && ((*m_presult)[index].matched != true)); + } + + if((m_match_flags & match_perl) && !(*m_presult)[index].matched) + return false; + + BidiIterator i = (*m_presult)[index].first; + BidiIterator j = (*m_presult)[index].second; while(i != j) { if((position == last) || (traits_inst.translate(*position, icase) != traits_inst.translate(*i, icase))) @@ -713,7 +728,7 @@ inline bool perl_matcher::match_assert_backref( { // return true if marked sub-expression N has been matched: int index = static_cast(pstate)->index; - bool result; + bool result = false; if(index == 9999) { // Magic value for a (DEFINE) block: @@ -721,11 +736,25 @@ inline bool perl_matcher::match_assert_backref( } else if(index > 0) { + // Have we matched subexpression "index"? // Check if index is a hash value: if(index >= 10000) - index = re.get_data().get_id(index); - // Have we matched subexpression "index"? - result = (*m_presult)[index].matched; + { + named_subexpressions::range_type r = re.get_data().equal_range(index); + while(r.first != r.second) + { + if((*m_presult)[r.first->index].matched) + { + result = true; + break; + } + ++r.first; + } + } + else + { + result = (*m_presult)[index].matched; + } pstate = pstate->next.p; } else @@ -734,8 +763,20 @@ inline bool perl_matcher::match_assert_backref( // If index == 0 then check for any recursion at all, otherwise for recursion to -index-1. int idx = -index-1; if(idx >= 10000) - idx = re.get_data().get_id(idx); - result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0)); + { + named_subexpressions::range_type r = re.get_data().equal_range(idx); + int stack_index = recursion_stack.empty() ? -1 : recursion_stack.back().idx; + while(r.first != r.second) + { + result |= (stack_index == r.first->index); + if(result)break; + ++r.first; + } + } + else + { + result = !recursion_stack.empty() && ((recursion_stack.back().idx == idx) || (index == 0)); + } pstate = pstate->next.p; } return result; diff --git a/boost/boost/regex/v4/perl_matcher_recursive.hpp b/boost/boost/regex/v4/perl_matcher_recursive.hpp index 74c2912204..07a1c20f88 100644 --- a/boost/boost/regex/v4/perl_matcher_recursive.hpp +++ b/boost/boost/regex/v4/perl_matcher_recursive.hpp @@ -200,11 +200,11 @@ bool perl_matcher::match_startmark() BidiIterator saved_position = position; const re_syntax_base* next_pstate = static_cast(pstate->next.p)->alt.p->next.p; pstate = pstate->next.p->next.p; - bool r = match_all_states(); + bool res = match_all_states(); position = saved_position; if(negated) - r = !r; - if(r) + res = !res; + if(res) pstate = next_pstate; else pstate = alt->alt.p; @@ -901,7 +901,7 @@ bool perl_matcher::match_endmark() { recursion_info saved = recursion_stack.back(); recursion_stack.pop_back(); - const re_syntax_base* saved_state = pstate = saved.preturn_address; + pstate = saved.preturn_address; repeater_count* saved_count = next_count; next_count = saved.repeater_stack; *m_presult = saved.results; diff --git a/boost/boost/regex/v4/regex_format.hpp b/boost/boost/regex/v4/regex_format.hpp index 2bd6bac1d3..4406839f35 100644 --- a/boost/boost/regex/v4/regex_format.hpp +++ b/boost/boost/regex/v4/regex_format.hpp @@ -153,6 +153,11 @@ private: typedef typename boost::is_convertible::type tag_type; return get_named_sub_index(i, j, tag_type()); } +#ifdef BOOST_MSVC + // msvc-8.0 issues a spurious warning on the call to std::advance here: +#pragma warning(push) +#pragma warning(disable:4244) +#endif inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::false_&) { if(i != j) @@ -166,6 +171,9 @@ private: } return -1; } +#ifdef BOOST_MSVC +#pragma warning(pop) +#endif inline int toi(ForwardIter& i, ForwardIter j, int base, const boost::mpl::true_&) { return m_traits.toi(i, j, base); diff --git a/boost/boost/regex/v4/sub_match.hpp b/boost/boost/regex/v4/sub_match.hpp index 1c79e39a9a..34a868404d 100644 --- a/boost/boost/regex/v4/sub_match.hpp +++ b/boost/boost/regex/v4/sub_match.hpp @@ -56,7 +56,7 @@ struct sub_match : public std::pair template operator std::basic_string ()const { - return std::basic_string(this->first, this->second); + return matched ? std::basic_string(this->first, this->second) : std::basic_string(); } #else operator std::basic_string ()const @@ -66,19 +66,22 @@ struct sub_match : public std::pair #endif difference_type BOOST_REGEX_CALL length()const { - difference_type n = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); + difference_type n = matched ? ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second) : 0; return n; } std::basic_string str()const { std::basic_string result; - std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); - result.reserve(len); - BidiIterator i = this->first; - while(i != this->second) + if(matched) { - result.append(1, *i); - ++i; + std::size_t len = ::boost::re_detail::distance((BidiIterator)this->first, (BidiIterator)this->second); + result.reserve(len); + BidiIterator i = this->first; + while(i != this->second) + { + result.append(1, *i); + ++i; + } } return result; } diff --git a/boost/boost/regex/v4/u32regex_token_iterator.hpp b/boost/boost/regex/v4/u32regex_token_iterator.hpp index 4039494df2..4b0ac92751 100644 --- a/boost/boost/regex/v4/u32regex_token_iterator.hpp +++ b/boost/boost/regex/v4/u32regex_token_iterator.hpp @@ -361,7 +361,7 @@ inline u32regex_token_iterator make_u32regex_token_iterator(const return u32regex_token_iterator(s.getBuffer(), s.getBuffer() + s.length(), e, submatch, m); } -#if BOOST_WORKAROUND(BOOST_MSVC, == 1310) +#if BOOST_WORKAROUND(BOOST_MSVC, > 1300) # pragma warning(pop) #endif #ifdef BOOST_HAS_ABI_HEADERS diff --git a/boost/boost/signals/detail/named_slot_map.hpp b/boost/boost/signals/detail/named_slot_map.hpp index 0528c617e0..763013fde1 100644 --- a/boost/boost/signals/detail/named_slot_map.hpp +++ b/boost/boost/signals/detail/named_slot_map.hpp @@ -32,10 +32,10 @@ class stored_group public: enum storage_kind { sk_empty, sk_front, sk_back, sk_group }; - stored_group(storage_kind kind = sk_empty) : kind(kind), group() { } + stored_group(storage_kind p_kind = sk_empty) : kind(p_kind), group() { } template - stored_group(const T& group) : kind(sk_group), group(new T(group)) { } + stored_group(const T& p_group) : kind(sk_group), group(new T(p_group)) { } bool is_front() const { return kind == sk_front; } bool is_back() const { return kind == sk_back; } @@ -133,12 +133,12 @@ public: #endif private: - named_slot_map_iterator(group_iterator group, group_iterator last) : - group(group), last_group(last), slot_assigned(false) + named_slot_map_iterator(group_iterator giter, group_iterator last) : + group(giter), last_group(last), slot_assigned(false) { init_next_group(); } - named_slot_map_iterator(group_iterator group, group_iterator last, + named_slot_map_iterator(group_iterator giter, group_iterator last, slot_pair_iterator slot) : - group(group), last_group(last), slot_(slot), slot_assigned(true) + group(giter), last_group(last), slot_(slot), slot_assigned(true) { } void init_next_group() diff --git a/boost/boost/signals/detail/slot_call_iterator.hpp b/boost/boost/signals/detail/slot_call_iterator.hpp index c6706bef8c..0d6afd91d1 100644 --- a/boost/boost/signals/detail/slot_call_iterator.hpp +++ b/boost/boost/signals/detail/slot_call_iterator.hpp @@ -47,9 +47,9 @@ namespace boost { friend class iterator_core_access; public: - slot_call_iterator(Iterator iter_in, Iterator end_in, Function f, + slot_call_iterator(Iterator iter_in, Iterator end_in, Function func, optional &c) - : iter(iter_in), end(end_in), f(f), cache(&c) + : iter(iter_in), end(end_in), f(func), cache(&c) { iter = std::find_if(iter, end, is_callable()); } diff --git a/boost/boost/signals/signal_template.hpp b/boost/boost/signals/signal_template.hpp index a8420b6914..6b0b91a8e6 100644 --- a/boost/boost/signals/signal_template.hpp +++ b/boost/boost/signals/signal_template.hpp @@ -345,8 +345,8 @@ namespace boost { #endif // BOOST_SIGNALS_NUM_ARGS > 0 call_bound_slot f(&args); - typedef typename call_bound_slot::result_type result_type; - optional cache; + typedef typename call_bound_slot::result_type call_result_type; + optional cache; // Let the combiner call the slots via a pair of input iterators return combiner()(slot_call_iterator(notification.impl->slots_.begin(), impl->slots_.end(), f, cache), @@ -386,8 +386,8 @@ namespace boost { call_bound_slot f(&args); - typedef typename call_bound_slot::result_type result_type; - optional cache; + typedef typename call_bound_slot::result_type call_result_type; + optional cache; // Let the combiner call the slots via a pair of input iterators return combiner()(slot_call_iterator(notification.impl->slots_.begin(), diff --git a/boost/boost/static_assert.hpp b/boost/boost/static_assert.hpp index 5bded5ea28..9fe9bc0c0f 100644 --- a/boost/boost/static_assert.hpp +++ b/boost/boost/static_assert.hpp @@ -17,6 +17,12 @@ #include #include +#ifndef BOOST_NO_STATIC_ASSERT +# define BOOST_STATIC_ASSERT_MSG( B, Msg ) static_assert(B, Msg) +#else +# define BOOST_STATIC_ASSERT_MSG( B, Msg ) BOOST_STATIC_ASSERT( B ) +#endif + #ifdef __BORLANDC__ // // workaround for buggy integral-constant expression support: @@ -38,7 +44,7 @@ # define BOOST_STATIC_ASSERT_BOOL_CAST(x) (bool)(x) #endif -#ifdef BOOST_HAS_STATIC_ASSERT +#ifndef BOOST_NO_STATIC_ASSERT # define BOOST_STATIC_ASSERT( B ) static_assert(B, #B) #else @@ -125,7 +131,7 @@ template struct static_assert_test{}; enum { BOOST_JOIN(boost_static_assert_enum_, __LINE__) \ = sizeof(::boost::STATIC_ASSERTION_FAILURE< (bool)( B ) >) } #endif -#endif // ndef BOOST_HAS_STATIC_ASSERT +#endif // defined(BOOST_NO_STATIC_ASSERT) #endif // BOOST_STATIC_ASSERT_HPP diff --git a/boost/boost/throw_exception.hpp b/boost/boost/throw_exception.hpp index a38405400e..a73acb671b 100644 --- a/boost/boost/throw_exception.hpp +++ b/boost/boost/throw_exception.hpp @@ -79,7 +79,7 @@ template BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const set_info( set_info( set_info( - enable_error_info(x), + boost::enable_error_info(x), throw_function(current_function)), throw_file(file)), throw_line(line))); diff --git a/boost/boost/token_functions.hpp b/boost/boost/token_functions.hpp index 57d2954c0a..50f8330258 100644 --- a/boost/boost/token_functions.hpp +++ b/boost/boost/token_functions.hpp @@ -218,9 +218,9 @@ namespace boost{ { #if !defined(BOOST_NO_CWCTYPE) if (sizeof(char_type) == 1) - return std::isspace(c) != 0; + return std::isspace(static_cast(c)) != 0; else - return std::iswspace(c) != 0; + return std::iswspace(static_cast(c)) != 0; #else return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0; #endif @@ -230,9 +230,9 @@ namespace boost{ { #if !defined(BOOST_NO_CWCTYPE) if (sizeof(char_type) == 1) - return std::ispunct(c) != 0; + return std::ispunct(static_cast(c)) != 0; else - return std::iswpunct(c) != 0; + return std::iswpunct(static_cast(c)) != 0; #else return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0; #endif @@ -418,7 +418,7 @@ namespace boost{ class char_separator { typedef tokenizer_detail::traits_extension Traits; - typedef std::basic_string string_type; + typedef std::basic_string string_type; public: explicit char_separator(const Char* dropped_delims, @@ -561,7 +561,7 @@ namespace boost{ private: typedef tokenizer_detail::traits_extension Traits; - typedef std::basic_string string_type; + typedef std::basic_string string_type; string_type returnable_; string_type nonreturnable_; bool return_delims_; diff --git a/boost/boost/tuple/detail/tuple_basic.hpp b/boost/boost/tuple/detail/tuple_basic.hpp index 348fd80894..88f0d9023f 100644 --- a/boost/boost/tuple/detail/tuple_basic.hpp +++ b/boost/boost/tuple/detail/tuple_basic.hpp @@ -37,6 +37,7 @@ #include "boost/type_traits/cv_traits.hpp" #include "boost/type_traits/function_traits.hpp" +#include "boost/utility/swap.hpp" #include "boost/detail/workaround.hpp" // needed for BOOST_WORKAROUND @@ -86,45 +87,28 @@ namespace detail { template class generate_error; -// - cons getters -------------------------------------------------------- -// called: get_class::get(aTuple) - -template< int N > -struct get_class { - template - inline static RET get(const cons& t) - { -#if BOOST_WORKAROUND(__IBMCPP__,==600) - // vacpp 6.0 is not very consistent regarding the member template keyword - // Here it generates an error when the template keyword is used. - return get_class::get(t.tail); -#else - return get_class::BOOST_NESTED_TEMPLATE get(t.tail); -#endif - } - template - inline static RET get(cons& t) - { -#if BOOST_WORKAROUND(__IBMCPP__,==600) - return get_class::get(t.tail); -#else - return get_class::BOOST_NESTED_TEMPLATE get(t.tail); -#endif - } +template +struct drop_front { + template + struct apply { + typedef BOOST_DEDUCED_TYPENAME drop_front::BOOST_NESTED_TEMPLATE + apply next; + typedef BOOST_DEDUCED_TYPENAME next::type::tail_type type; + static const type& call(const Tuple& tup) { + return next::call(tup).tail; + } + }; }; template<> -struct get_class<0> { - template - inline static RET get(const cons& t) - { - return t.head; - } - template - inline static RET get(cons& t) - { - return t.head; - } +struct drop_front<0> { + template + struct apply { + typedef Tuple type; + static const type& call(const Tuple& tup) { + return tup; + } + }; }; } // end of namespace detail @@ -140,41 +124,23 @@ struct get_class<0> { template struct element { -private: - typedef typename T::tail_type Next; -public: - typedef typename element::type type; -}; -template -struct element<0,T> -{ - typedef typename T::head_type type; + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply::type::head_type type; }; template struct element { private: - typedef typename T::tail_type Next; - typedef typename element::type unqualified_type; + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply::type::head_type unqualified_type; public: #if BOOST_WORKAROUND(__BORLANDC__,<0x600) typedef const unqualified_type type; #else - typedef typename boost::add_const::type type; -#endif - -}; -template -struct element<0,const T> -{ -#if BOOST_WORKAROUND(__BORLANDC__,<0x600) - typedef const typename T::head_type type; -#else - typedef typename boost::add_const::type type; + typedef BOOST_DEDUCED_TYPENAME boost::add_const::type type; #endif }; - #else // def BOOST_NO_CV_SPECIALIZATIONS namespace detail { @@ -182,31 +148,16 @@ namespace detail { template struct element_impl { -private: - typedef typename T::tail_type Next; -public: - typedef typename element_impl::type type; + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply::type::head_type type; }; template struct element_impl { -private: - typedef typename T::tail_type Next; -public: - typedef const typename element_impl::type type; -}; - -template -struct element_impl<0, T, false /* IsConst */> -{ - typedef typename T::head_type type; -}; - -template -struct element_impl<0, T, true /* IsConst */> -{ - typedef const typename T::head_type type; + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply::type::head_type unqualified_type; + typedef const unqualified_type type; }; } // end of namespace detail @@ -258,17 +209,10 @@ inline typename access_traits< typename element >::type >::non_const_type get(cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) { -#if BOOST_WORKAROUND(__IBMCPP__,==600 ) - return detail::get_class:: -#else - return detail::get_class::BOOST_NESTED_TEMPLATE -#endif - get< - typename access_traits< - typename element >::type - >::non_const_type, - HT,TT - >(c); + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply > impl; + typedef BOOST_DEDUCED_TYPENAME impl::type cons_element; + return const_cast(impl::call(c)).head; } // get function for const cons-lists, returns a const reference to @@ -279,17 +223,10 @@ inline typename access_traits< typename element >::type >::const_type get(const cons& c BOOST_APPEND_EXPLICIT_TEMPLATE_NON_TYPE(int, N)) { -#if BOOST_WORKAROUND(__IBMCPP__,==600) - return detail::get_class:: -#else - return detail::get_class::BOOST_NESTED_TEMPLATE -#endif - get< - typename access_traits< - typename element >::type - >::const_type, - HT,TT - >(c); + typedef BOOST_DEDUCED_TYPENAME detail::drop_front::BOOST_NESTED_TEMPLATE + apply > impl; + typedef BOOST_DEDUCED_TYPENAME impl::type cons_element; + return impl::call(c).head; } // -- the cons template -------------------------------------------------- @@ -663,18 +600,21 @@ public: // Swallows any assignment (by Doug Gregor) namespace detail { +struct swallow_assign; +typedef void (detail::swallow_assign::*ignore_t)(); struct swallow_assign { - + swallow_assign(ignore_t(*)(ignore_t)) {} template swallow_assign const& operator=(const T&) const { return *this; } }; + } // namespace detail // "ignore" allows tuple positions to be ignored when using "tie". -detail::swallow_assign const ignore = detail::swallow_assign(); +inline detail::ignore_t ignore(detail::ignore_t) { return 0; } // --------------------------------------------------------------------------- // The call_traits for make_tuple @@ -756,6 +696,10 @@ struct make_tuple_traits >{ typedef T& type; }; +template<> +struct make_tuple_traits { + typedef detail::swallow_assign type; +}; @@ -877,71 +821,154 @@ make_tuple(const T0& t0, const T1& t1, const T2& t2, const T3& t3, return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); } +namespace detail { +template +struct tie_traits { + typedef T& type; +}; + +template<> +struct tie_traits { + typedef swallow_assign type; +}; + +template<> +struct tie_traits { + typedef null_type type; +}; + +template < + class T0 = void, class T1 = void, class T2 = void, + class T3 = void, class T4 = void, class T5 = void, + class T6 = void, class T7 = void, class T8 = void, + class T9 = void +> +struct tie_mapper { + typedef + tuple::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type, + typename tie_traits::type> type; +}; + +} // Tie function templates ------------------------------------------------- -template -inline tuple tie(T1& t1) { - return tuple (t1); +template +inline typename detail::tie_mapper::type +tie(T0& t0) { + typedef typename detail::tie_mapper::type t; + return t(t0); } -template -inline tuple tie(T1& t1, T2& t2) { - return tuple (t1, t2); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1) { + typedef typename detail::tie_mapper::type t; + return t(t0, t1); } -template -inline tuple tie(T1& t1, T2& t2, T3& t3) { - return tuple (t1, t2, t3); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2) { + typedef typename detail::tie_mapper::type t; + return t(t0, t1, t2); } -template -inline tuple tie(T1& t1, T2& t2, T3& t3, T4& t4) { - return tuple (t1, t2, t3, t4); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2, T3& t3) { + typedef typename detail::tie_mapper::type t; + return t(t0, t1, t2, t3); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5) { - return tuple (t1, t2, t3, t4, t5); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4) { + typedef typename detail::tie_mapper::type t; + return t(t0, t1, t2, t3, t4); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6) { - return tuple (t1, t2, t3, t4, t5, t6); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4, T5& t5) { + typedef typename detail::tie_mapper::type t; + return t(t0, t1, t2, t3, t4, t5); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7) { - return tuple (t1, t2, t3, t4, t5, t6, t7); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4, T5& t5, T6& t6) { + typedef typename detail::tie_mapper + ::type t; + return t(t0, t1, t2, t3, t4, t5, t6); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8) { - return tuple - (t1, t2, t3, t4, t5, t6, t7, t8); +template +inline typename detail::tie_mapper::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4, T5& t5, T6& t6, T7& t7) { + typedef typename detail::tie_mapper + ::type t; + return t(t0, t1, t2, t3, t4, t5, t6, t7); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, - T9& t9) { - return tuple - (t1, t2, t3, t4, t5, t6, t7, t8, t9); +template +inline typename detail::tie_mapper + ::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4, T5& t5, T6& t6, T7& t7, + T8& t8) { + typedef typename detail::tie_mapper + ::type t; + return t(t0, t1, t2, t3, t4, t5, t6, t7, t8); } -template -inline tuple -tie(T1& t1, T2& t2, T3& t3, T4& t4, T5& t5, T6& t6, T7& t7, T8& t8, - T9& t9, T10& t10) { - return tuple - (t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); +template +inline typename detail::tie_mapper + ::type +tie(T0& t0, T1& t1, T2& t2, T3& t3, + T4& t4, T5& t5, T6& t6, T7& t7, + T8& t8, T9& t9) { + typedef typename detail::tie_mapper + ::type t; + return t(t0, t1, t2, t3, t4, t5, t6, t7, t8, t9); +} + +template +void swap(tuple& lhs, + tuple& rhs); +inline void swap(null_type&, null_type&) {} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); +} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); + ::boost::tuples::swap(lhs.tail, rhs.tail); +} +template +inline void swap(tuple& lhs, + tuple& rhs) { + typedef tuple tuple_type; + typedef typename tuple_type::inherited base; + ::boost::tuples::swap(static_cast(lhs), static_cast(rhs)); } } // end of namespace tuples diff --git a/boost/boost/tuple/detail/tuple_basic_no_partial_spec.hpp b/boost/boost/tuple/detail/tuple_basic_no_partial_spec.hpp index bb38662c4a..7379bf8182 100644 --- a/boost/boost/tuple/detail/tuple_basic_no_partial_spec.hpp +++ b/boost/boost/tuple/detail/tuple_basic_no_partial_spec.hpp @@ -27,6 +27,7 @@ #define BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP #include "boost/type_traits.hpp" +#include "boost/utility/swap.hpp" #include #if defined BOOST_MSVC @@ -836,6 +837,29 @@ namespace tuples { detail::swallow_assign const ignore = detail::swallow_assign(); +template +void swap(tuple& lhs, + tuple& rhs); +inline void swap(null_type&, null_type&) {} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); +} +template +inline void swap(cons& lhs, cons& rhs) { + ::boost::swap(lhs.head, rhs.head); + ::boost::tuples::swap(lhs.tail, rhs.tail); +} +template +inline void swap(tuple& lhs, + tuple& rhs) { + typedef tuple tuple_type; + typedef typename tuple_type::inherited base; + ::boost::tuples::swap(static_cast(lhs), static_cast(rhs)); +} + } // namespace tuples } // namespace boost #endif // BOOST_TUPLE_BASIC_NO_PARTIAL_SPEC_HPP diff --git a/boost/boost/tuple/tuple_io.hpp b/boost/boost/tuple/tuple_io.hpp index 10cdb1cc26..06a2339297 100644 --- a/boost/boost/tuple/tuple_io.hpp +++ b/boost/boost/tuple/tuple_io.hpp @@ -384,6 +384,8 @@ extract_and_check_delimiter( if (is.good() && c!=d) { is.setstate(std::ios::failbit); } + } else { + is >> std::ws; } return is; } @@ -478,6 +480,8 @@ extract_and_check_delimiter( if (is.good() && c!=d) { is.setstate(std::ios::failbit); } + } else { + is >> std::ws; } return is; } diff --git a/boost/boost/type_traits.hpp b/boost/boost/type_traits.hpp index a46e90af05..c725296b90 100644 --- a/boost/boost/type_traits.hpp +++ b/boost/boost/type_traits.hpp @@ -12,10 +12,19 @@ #include "boost/type_traits/add_const.hpp" #include "boost/type_traits/add_cv.hpp" +#include "boost/type_traits/add_lvalue_reference.hpp" #include "boost/type_traits/add_pointer.hpp" #include "boost/type_traits/add_reference.hpp" +#include "boost/type_traits/add_rvalue_reference.hpp" #include "boost/type_traits/add_volatile.hpp" +#include "boost/type_traits/aligned_storage.hpp" #include "boost/type_traits/alignment_of.hpp" +#include "boost/type_traits/common_type.hpp" +#include "boost/type_traits/conditional.hpp" +#include "boost/type_traits/decay.hpp" +#include "boost/type_traits/extent.hpp" +#include "boost/type_traits/floating_point_promotion.hpp" +#include "boost/type_traits/function_traits.hpp" #if !defined(__BORLANDC__) && !defined(__CUDACC__) #include "boost/type_traits/has_new_operator.hpp" #endif @@ -28,14 +37,13 @@ #include "boost/type_traits/has_trivial_copy.hpp" #include "boost/type_traits/has_trivial_destructor.hpp" #include "boost/type_traits/has_virtual_destructor.hpp" -#include "boost/type_traits/is_signed.hpp" -#include "boost/type_traits/is_unsigned.hpp" #include "boost/type_traits/is_abstract.hpp" #include "boost/type_traits/is_arithmetic.hpp" #include "boost/type_traits/is_array.hpp" #include "boost/type_traits/is_base_and_derived.hpp" #include "boost/type_traits/is_base_of.hpp" #include "boost/type_traits/is_class.hpp" +#include #include "boost/type_traits/is_compound.hpp" #include "boost/type_traits/is_const.hpp" #include "boost/type_traits/is_convertible.hpp" @@ -46,6 +54,7 @@ #include "boost/type_traits/is_function.hpp" #include "boost/type_traits/is_fundamental.hpp" #include "boost/type_traits/is_integral.hpp" +#include "boost/type_traits/is_lvalue_reference.hpp" #include "boost/type_traits/is_member_function_pointer.hpp" #include "boost/type_traits/is_member_object_pointer.hpp" #include "boost/type_traits/is_member_pointer.hpp" @@ -55,16 +64,18 @@ #include "boost/type_traits/is_pointer.hpp" #include "boost/type_traits/is_reference.hpp" #include "boost/type_traits/is_rvalue_reference.hpp" -#include "boost/type_traits/is_lvalue_reference.hpp" +#include "boost/type_traits/is_signed.hpp" #include "boost/type_traits/is_same.hpp" #include "boost/type_traits/is_scalar.hpp" #include "boost/type_traits/is_stateless.hpp" #include "boost/type_traits/is_union.hpp" +#include "boost/type_traits/is_unsigned.hpp" #include "boost/type_traits/is_void.hpp" #include "boost/type_traits/is_virtual_base_of.hpp" #include "boost/type_traits/is_volatile.hpp" +#include +#include #include "boost/type_traits/rank.hpp" -#include "boost/type_traits/extent.hpp" #include "boost/type_traits/remove_bounds.hpp" #include "boost/type_traits/remove_extent.hpp" #include "boost/type_traits/remove_all_extents.hpp" @@ -74,17 +85,10 @@ #include "boost/type_traits/remove_reference.hpp" #include "boost/type_traits/remove_volatile.hpp" #include "boost/type_traits/type_with_alignment.hpp" -#include "boost/type_traits/function_traits.hpp" -#include "boost/type_traits/aligned_storage.hpp" -#include "boost/type_traits/floating_point_promotion.hpp" #if !(defined(__sgi) && defined(__EDG_VERSION__) && (__EDG_VERSION__ == 238)) #include "boost/type_traits/integral_promotion.hpp" #include "boost/type_traits/promote.hpp" #endif -#include -#include -#include -#include #include "boost/type_traits/ice.hpp" diff --git a/boost/boost/type_traits/add_lvalue_reference.hpp b/boost/boost/type_traits/add_lvalue_reference.hpp new file mode 100644 index 0000000000..41563728f4 --- /dev/null +++ b/boost/boost/type_traits/add_lvalue_reference.hpp @@ -0,0 +1,26 @@ +// Copyright 2010 John Maddock + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP +#define BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP + +#include + +// should be the last #include +#include + +namespace boost{ + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_lvalue_reference,T,typename boost::add_reference::type) + +#ifndef BOOST_NO_RVALUE_REFERENCES +BOOST_TT_AUX_TYPE_TRAIT_PARTIAL_SPEC1_1(typename T,add_lvalue_reference,T&&,T&) +#endif + +} + +#include + +#endif // BOOST_TYPE_TRAITS_EXT_ADD_LVALUE_REFERENCE__HPP diff --git a/boost/boost/type_traits/add_rvalue_reference.hpp b/boost/boost/type_traits/add_rvalue_reference.hpp new file mode 100644 index 0000000000..00b723ccd5 --- /dev/null +++ b/boost/boost/type_traits/add_rvalue_reference.hpp @@ -0,0 +1,67 @@ +// add_rvalue_reference.hpp ---------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP +#define BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP + +#include + +//----------------------------------------------------------------------------// + +#include +#include + +// should be the last #include +#include + +//----------------------------------------------------------------------------// +// // +// C++03 implementation of // +// 20.7.6.2 Reference modifications [meta.trans.ref] // +// Written by Vicente J. Botet Escriba // +// // +// If T names an object or function type then the member typedef type +// 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::type is not an rvalue +// reference. —end note ] +//----------------------------------------------------------------------------// + +namespace boost { + +namespace type_traits_detail { + + template + struct add_rvalue_reference_helper + { typedef T type; }; + + template + struct add_rvalue_reference_helper + { +#if !defined(BOOST_NO_RVALUE_REFERENCES) + typedef T&& type; +#else + typedef T type; +#endif + }; + + template + struct add_rvalue_reference_imp + { + typedef typename boost::type_traits_detail::add_rvalue_reference_helper + ::value && !is_reference::value) >::type type; + }; + +} + +BOOST_TT_AUX_TYPE_TRAIT_DEF1(add_rvalue_reference,T,typename boost::type_traits_detail::add_rvalue_reference_imp::type) + +} // namespace boost + +#include + +#endif // BOOST_TYPE_TRAITS_EXT_ADD_RVALUE_REFERENCE__HPP diff --git a/boost/boost/type_traits/common_type.hpp b/boost/boost/type_traits/common_type.hpp new file mode 100644 index 0000000000..74b036369f --- /dev/null +++ b/boost/boost/type_traits/common_type.hpp @@ -0,0 +1,158 @@ +// common_type.hpp ---------------------------------------------------------// + +// Copyright 2008 Howard Hinnant +// Copyright 2008 Beman Dawes + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TYPE_TRAITS_COMMON_TYPE_HPP +#define BOOST_TYPE_TRAITS_COMMON_TYPE_HPP + +#include + +#ifdef __SUNPRO_CC +# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF +#endif +#ifdef __IBMCPP__ +# define BOOST_COMMON_TYPE_DONT_USE_TYPEOF +#endif + +//----------------------------------------------------------------------------// +#if defined(BOOST_NO_VARIADIC_TEMPLATES) +#define BOOST_COMMON_TYPE_ARITY 3 +#endif + +//----------------------------------------------------------------------------// +#if defined(BOOST_NO_DECLTYPE) && !defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) +#define BOOST_TYPEOF_SILENT +#include // boost wonders never cease! +#endif + +//----------------------------------------------------------------------------// +#ifndef BOOST_NO_STATIC_ASSERT +#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) static_assert(CND,MSG) +#elif defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) +#include +#include +#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) \ + BOOST_MPL_ASSERT_MSG(boost::mpl::bool_< (CND) >::type::value, MSG, TYPES) +#else +#include +#define BOOST_COMMON_TYPE_STATIC_ASSERT(CND, MSG, TYPES) BOOST_STATIC_ASSERT(CND) +#endif + +#if !defined(BOOST_NO_STATIC_ASSERT) || !defined(BOOST_COMMON_TYPE_USES_MPL_ASSERT) +#define BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE "must be complete type" +#endif + +#if defined(BOOST_NO_DECLTYPE) && defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) +#include +#include +#endif +#include +#include +#include + +//----------------------------------------------------------------------------// +// // +// C++03 implementation of // +// 20.6.7 Other transformations [meta.trans.other] // +// Written by Howard Hinnant // +// Adapted for Boost by Beman Dawes, Vicente Botet and Jeffrey Hellrung // +// // +//----------------------------------------------------------------------------// + +namespace boost { + +// prototype +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) + template + struct common_type; +#else // or no specialization + template + struct common_type + { + public: + typedef typename common_type::type, V>::type type; + }; +#endif + + +// 1 arg + template +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) + struct common_type +#else + struct common_type + +#endif + { + BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); + public: + typedef T type; + }; + +// 2 args +namespace type_traits_detail { + + template + struct common_type_2 + { + private: + BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(T) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (T)); + BOOST_COMMON_TYPE_STATIC_ASSERT(sizeof(U) > 0, BOOST_COMMON_TYPE_MUST_BE_A_COMPLE_TYPE, (U)); + static bool declval_bool(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_T(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_U(); // workaround gcc bug; not required by std + static typename add_rvalue_reference::type declval_b(); + +#if !defined(BOOST_NO_DECLTYPE) + public: + typedef decltype(declval() ? declval() : declval()) type; +#elif defined(BOOST_COMMON_TYPE_DONT_USE_TYPEOF) + public: + typedef typename detail_type_traits_common_type::common_type_impl< + typename remove_cv::type, + typename remove_cv::type + >::type type; +#else + public: + typedef BOOST_TYPEOF_TPL(declval_b() ? declval_T() : declval_U()) type; +#endif + +#if defined(__GNUC__) && __GNUC__ == 3 && (__GNUC_MINOR__ == 2 || __GNUC_MINOR__ == 3) + public: + void public_dummy_function_just_to_silence_warning(); +#endif + }; + + template + struct common_type_2 + { + typedef T type; + }; + } + +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) + template + struct common_type +#else + template + struct common_type +#endif + : type_traits_detail::common_type_2 + { }; + + +// 3 or more args +#if !defined(BOOST_NO_VARIADIC_TEMPLATES) + template + struct common_type { + public: + typedef typename common_type::type, V...>::type type; + }; +#endif +} // namespace boost + +#endif // BOOST_TYPE_TRAITS_COMMON_TYPE_HPP diff --git a/boost/boost/type_traits/conditional.hpp b/boost/boost/type_traits/conditional.hpp new file mode 100644 index 0000000000..8bbda85fc6 --- /dev/null +++ b/boost/boost/type_traits/conditional.hpp @@ -0,0 +1,25 @@ + +// (C) Copyright John Maddock 2010. +// Use, modification and distribution are subject to the Boost Software License, +// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt). +// +// See http://www.boost.org/libs/type_traits for most recent version including documentation. + + +#ifndef BOOST_TT_CONDITIONAL_HPP_INCLUDED +#define BOOST_TT_CONDITIONAL_HPP_INCLUDED + +#include + +namespace boost { + +template +struct conditional : public mpl::if_c +{ +}; + +} // namespace boost + + +#endif // BOOST_TT_CONDITIONAL_HPP_INCLUDED diff --git a/boost/boost/type_traits/function_traits.hpp b/boost/boost/type_traits/function_traits.hpp index 6d708cd0cb..d71534572c 100644 --- a/boost/boost/type_traits/function_traits.hpp +++ b/boost/boost/type_traits/function_traits.hpp @@ -166,7 +166,7 @@ struct function_traits_helper template struct function_traits : - public boost::detail::function_traits_helper::type> + public boost::detail::function_traits_helper::type> { }; diff --git a/boost/boost/type_traits/intrinsics.hpp b/boost/boost/type_traits/intrinsics.hpp index 8f88036e20..9666456a55 100644 --- a/boost/boost/type_traits/intrinsics.hpp +++ b/boost/boost/type_traits/intrinsics.hpp @@ -159,6 +159,33 @@ # define BOOST_HAS_TYPE_TRAITS_INTRINSICS #endif +#if defined(__ghs__) && (__GHS_VERSION_NUMBER >= 600) +# include +# include +# include + +# 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::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::value && !is_reference::value) +# define BOOST_HAS_NOTHROW_ASSIGN(T) (__has_nothrow_assign(T) && !is_volatile::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::value) +# define BOOST_IS_CLASS(T) __is_class(T) +# define BOOST_IS_ENUM(T) __is_enum(T) +# define BOOST_IS_POLYMORPHIC(T) __is_polymorphic(T) +# define BOOST_ALIGNMENT_OF(T) __alignof__(T) + +# define BOOST_HAS_TYPE_TRAITS_INTRINSICS +#endif + # if defined(__CODEGEARC__) # include # include diff --git a/boost/boost/type_traits/is_const.hpp b/boost/boost/type_traits/is_const.hpp index 812ed1515f..99b0f3643a 100644 --- a/boost/boost/type_traits/is_const.hpp +++ b/boost/boost/type_traits/is_const.hpp @@ -59,16 +59,16 @@ template struct is_const_rvalue_filter { #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_const); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_const); #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_const); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_const); #endif }; #ifndef BOOST_NO_RVALUE_REFERENCES template struct is_const_rvalue_filter { - BOOST_STATIC_CONSTANT(bool, value = false); + BOOST_STATIC_CONSTANT(bool, value = false); }; #endif } diff --git a/boost/boost/type_traits/is_signed.hpp b/boost/boost/type_traits/is_signed.hpp index bf7bbfdb76..ba7d6e97cd 100644 --- a/boost/boost/type_traits/is_signed.hpp +++ b/boost/boost/type_traits/is_signed.hpp @@ -24,14 +24,19 @@ namespace boost { namespace detail{ -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) +#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) template struct is_signed_values { + // + // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's + // rather than "real" static constants simply doesn't work or give + // the correct answer. + // typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); - BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); + static const no_cv_t minus_one = (static_cast(-1)); + static const no_cv_t zero = (static_cast(0)); }; template diff --git a/boost/boost/type_traits/is_unsigned.hpp b/boost/boost/type_traits/is_unsigned.hpp index 98baf4e94e..d8e5a89d9d 100644 --- a/boost/boost/type_traits/is_unsigned.hpp +++ b/boost/boost/type_traits/is_unsigned.hpp @@ -24,14 +24,19 @@ namespace boost { namespace detail{ -#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) +#if !(defined(__EDG_VERSION__) && __EDG_VERSION__ <= 238) && !defined(BOOST_NO_INCLASS_MEMBER_INITIALIZATION) template struct is_unsigned_values { + // + // Note that we cannot use BOOST_STATIC_CONSTANT here, using enum's + // rather than "real" static constants simply doesn't work or give + // the correct answer. + // typedef typename remove_cv::type no_cv_t; - BOOST_STATIC_CONSTANT(no_cv_t, minus_one = (static_cast(-1))); - BOOST_STATIC_CONSTANT(no_cv_t, zero = (static_cast(0))); + static const no_cv_t minus_one = (static_cast(-1)); + static const no_cv_t zero = (static_cast(0)); }; template diff --git a/boost/boost/type_traits/is_virtual_base_of.hpp b/boost/boost/type_traits/is_virtual_base_of.hpp index 30b34f6ccb..8dcd988edd 100644 --- a/boost/boost/type_traits/is_virtual_base_of.hpp +++ b/boost/boost/type_traits/is_virtual_base_of.hpp @@ -22,7 +22,7 @@ namespace detail { #ifdef BOOST_MSVC #pragma warning( push ) -#pragma warning( disable : 4584 ) +#pragma warning( disable : 4584 4250) #elif defined __GNUC__ #pragma GCC system_header #endif @@ -37,37 +37,37 @@ template struct is_virtual_base_of_impl { #ifdef __BORLANDC__ - struct X : public virtual Derived, public virtual Base + struct boost_type_traits_internal_struct_X : public virtual Derived, public virtual Base { - X(); - X(const X&); - X& operator=(const X&); - ~X()throw(); + 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 Y : public virtual Derived + struct boost_type_traits_internal_struct_Y : public virtual Derived { - Y(); - Y(const Y&); - Y& operator=(const Y&); - ~Y()throw(); + boost_type_traits_internal_struct_Y(); + boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&); + boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&); + ~boost_type_traits_internal_struct_Y()throw(); }; #else - struct X : Derived, virtual Base + struct boost_type_traits_internal_struct_X : Derived, virtual Base { - X(); - X(const X&); - X& operator=(const X&); - ~X()throw(); + 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 Y : Derived + struct boost_type_traits_internal_struct_Y : Derived { - Y(); - Y(const Y&); - Y& operator=(const Y&); - ~Y()throw(); + boost_type_traits_internal_struct_Y(); + boost_type_traits_internal_struct_Y(const boost_type_traits_internal_struct_Y&); + boost_type_traits_internal_struct_Y& operator=(const boost_type_traits_internal_struct_Y&); + ~boost_type_traits_internal_struct_Y()throw(); }; #endif - BOOST_STATIC_CONSTANT(bool, value = (sizeof(X)==sizeof(Y))); + BOOST_STATIC_CONSTANT(bool, value = (sizeof(boost_type_traits_internal_struct_X)==sizeof(boost_type_traits_internal_struct_Y))); }; template diff --git a/boost/boost/type_traits/is_volatile.hpp b/boost/boost/type_traits/is_volatile.hpp index e531263200..43c3a8b65f 100644 --- a/boost/boost/type_traits/is_volatile.hpp +++ b/boost/boost/type_traits/is_volatile.hpp @@ -46,9 +46,9 @@ template struct is_volatile_rval_filter { #if BOOST_WORKAROUND(BOOST_MSVC, < 1400) - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_volatile); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::type*>::is_volatile); #else - BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_volatile); + BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp::is_volatile); #endif }; #ifndef BOOST_NO_RVALUE_REFERENCES @@ -59,7 +59,7 @@ struct is_volatile_rval_filter template struct is_volatile_rval_filter { - BOOST_STATIC_CONSTANT(bool, value = false); + BOOST_STATIC_CONSTANT(bool, value = false); }; #endif } diff --git a/boost/boost/type_traits/remove_cv.hpp b/boost/boost/type_traits/remove_cv.hpp index 668e755604..4061fd2b4c 100644 --- a/boost/boost/type_traits/remove_cv.hpp +++ b/boost/boost/type_traits/remove_cv.hpp @@ -32,7 +32,7 @@ namespace detail{ template struct rvalue_ref_filter_rem_cv { - typedef typename boost::detail::cv_traits_imp::unqualified_type type; + typedef typename boost::detail::cv_traits_imp::unqualified_type type; }; #ifndef BOOST_NO_RVALUE_REFERENCES @@ -43,7 +43,7 @@ struct rvalue_ref_filter_rem_cv template struct rvalue_ref_filter_rem_cv { - typedef T&& type; + typedef T&& type; }; #endif diff --git a/boost/boost/type_traits/remove_reference.hpp b/boost/boost/type_traits/remove_reference.hpp index a87db3395a..f4530861c1 100644 --- a/boost/boost/type_traits/remove_reference.hpp +++ b/boost/boost/type_traits/remove_reference.hpp @@ -32,13 +32,13 @@ namespace detail{ template struct remove_rvalue_ref { - typedef T type; + typedef T type; }; #ifndef BOOST_NO_RVALUE_REFERENCES template struct remove_rvalue_ref { - typedef T type; + typedef T type; }; #endif diff --git a/boost/boost/typeof/message.hpp b/boost/boost/typeof/message.hpp new file mode 100644 index 0000000000..cabbb828c3 --- /dev/null +++ b/boost/boost/typeof/message.hpp @@ -0,0 +1,8 @@ +// Copyright (C) 2005 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#if defined(_MSC_VER) && defined BOOST_TYPEOF_MESSAGES +# pragma message(BOOST_TYPEOF_TEXT) +#endif +#undef BOOST_TYPEOF_TEXT diff --git a/boost/boost/typeof/msvc/typeof_impl.hpp b/boost/boost/typeof/msvc/typeof_impl.hpp new file mode 100644 index 0000000000..74ebc70738 --- /dev/null +++ b/boost/boost/typeof/msvc/typeof_impl.hpp @@ -0,0 +1,283 @@ + +// Copyright (C) 2005 Igor Chesnokov, mailto:ichesnokov@gmail.com (VC 6.5,VC 7.1 + counter code) +// Copyright (C) 2005-2007 Peder Holt (VC 7.0 + framework) +// Copyright (C) 2006 Steven Watanabe (VC 8.0) + +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED +# define BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED + +# include +# include +# include +# include +# include + +# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) +# include +# endif + +namespace boost +{ + namespace type_of + { + + //Compile time constant code +# if BOOST_WORKAROUND(BOOST_MSVC,>=1300) && defined(_MSC_EXTENSIONS) + template struct the_counter; + + template + struct encode_counter + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + __if_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=(encode_counter::count)); + } + __if_not_exists(the_counter) + { + BOOST_STATIC_CONSTANT(unsigned,count=N); + typedef the_counter type; + } + } + } + } + } + }; + +# define BOOST_TYPEOF_INDEX(T) (encode_counter::count) +# define BOOST_TYPEOF_NEXT_INDEX(next) +# else + template struct encode_counter : encode_counter {}; + template<> struct encode_counter<0> {}; + + //Need to default to a larger value than 4, as due to MSVC's ETI errors. (sizeof(int)==4) + char (*encode_index(...))[5]; + +# define BOOST_TYPEOF_INDEX(T) (sizeof(*boost::type_of::encode_index((boost::type_of::encode_counter<1005>*)0))) +# define BOOST_TYPEOF_NEXT_INDEX(next) friend char (*encode_index(encode_counter*))[next]; +# endif + + //Typeof code + +# if BOOST_WORKAROUND(BOOST_MSVC,==1300) + template + struct msvc_extract_type + { + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + template<> + struct id2type_impl //VC7.0 specific bugfeature + { + typedef T type; + }; + }; +#elif BOOST_WORKAROUND(BOOST_MSVC,>=1400) + struct msvc_extract_type_default_param {}; + + template + struct msvc_extract_type; + + template + struct msvc_extract_type { + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_extract_type : msvc_extract_type + { + template<> + struct id2type_impl //VC8.0 specific bugfeature + { + typedef T type; + }; + template + struct id2type_impl; + + typedef id2type_impl id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + }; +# else + template + struct msvc_extract_type + { + struct id2type; + }; + + template + struct msvc_register_type : msvc_extract_type + { + typedef msvc_extract_type base_type; + struct base_type::id2type // This uses nice VC6.5 and VC7.1 bugfeature + { + typedef T type; + }; + }; +# endif +// EAN: preprocess this block out on advice of Peder Holt +// to eliminate errors in type_traits/common_type.hpp +# if 0 //BOOST_WORKAROUND(BOOST_MSVC,==1310) + template + struct msvc_typeid_wrapper { + typedef typename msvc_extract_type::id2type id2type; + typedef typename id2type::type wrapped_type; + typedef typename wrapped_type::type type; + }; + //This class is used for registering the type T. encode_type is mapped against typeid(encode_type). + //msvc_typeid_wrapper)> will now have a type typedef that equals encode_type. + template + struct encode_type + { + typedef encode_type input_type; + //Invoke registration of encode_type. typeid(encode_type) is now mapped to encode_type. Do not use registered_type for anything. + //The reason for registering encode_type rather than T, is that VC handles typeid(function reference) poorly. By adding another + //level of indirection, we solve this problem. + typedef typename msvc_register_type >::id2type registered_type; + typedef T type; + }; + + template typename disable_if< + typename is_function::type, + typename encode_type::input_type>::type encode_start(T const&); + + template typename enable_if< + typename is_function::type, + typename encode_type::input_type>::type encode_start(T&); + + template + msvc_register_type typeof_register_type(const T&); + + +# define BOOST_TYPEOF(expr) \ + boost::type_of::msvc_typeid_wrapper::type + +# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr) + +# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ +struct name {\ + enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type(expr)))};\ + typedef typename boost::type_of::msvc_extract_type::id2type id2type;\ + typedef typename id2type::type type;\ +}; + +# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ +struct name {\ + enum {_typeof_register_value=sizeof(typeid(boost::type_of::typeof_register_type(expr)))};\ + typedef boost::type_of::msvc_extract_type::id2type id2type;\ + typedef id2type::type type;\ +}; + +# else + template + struct msvc_typeid_wrapper { + typedef typename msvc_extract_type >::id2type id2type; + typedef typename id2type::type type; + }; + //Workaround for ETI-bug for VC6 and VC7 + template<> + struct msvc_typeid_wrapper<1> { + typedef msvc_typeid_wrapper<1> type; + }; + //Workaround for ETI-bug for VC7.1 + template<> + struct msvc_typeid_wrapper<4> { + typedef msvc_typeid_wrapper<4> type; + }; + + //Tie it all together + template + struct encode_type + { + //Get the next available compile time constants index + BOOST_STATIC_CONSTANT(unsigned,value=BOOST_TYPEOF_INDEX(T)); + //Instantiate the template + typedef typename msvc_register_type >::id2type type; + //Set the next compile time constants index + BOOST_STATIC_CONSTANT(unsigned,next=value+1); + //Increment the compile time constant (only needed when extensions are not active + BOOST_TYPEOF_NEXT_INDEX(next); + }; + + template + struct sizer + { + typedef char(*type)[encode_type::value]; + }; +# if BOOST_WORKAROUND(BOOST_MSVC,>=1310) + template typename disable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T const&); + + template typename enable_if< + typename is_function::type, + typename sizer::type>::type encode_start(T&); +# else + template + typename sizer::type encode_start(T const&); +# endif + template + msvc_register_type typeof_register_type(const T&,Organizer* =0); + +# define BOOST_TYPEOF(expr) \ + boost::type_of::msvc_typeid_wrapper::type + +# define BOOST_TYPEOF_TPL(expr) typename BOOST_TYPEOF(expr) + +# define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ + struct name {\ + BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type(expr)));\ + typedef typename boost::type_of::msvc_extract_type::id2type id2type;\ + typedef typename id2type::type type;\ + }; + +# define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ + struct name {\ + BOOST_STATIC_CONSTANT(int,_typeof_register_value=sizeof(boost::type_of::typeof_register_type(expr)));\ + typedef boost::type_of::msvc_extract_type::id2type id2type;\ + typedef id2type::type type;\ + }; + +#endif + } +} + +#endif//BOOST_TYPEOF_MSVC_TYPEOF_IMPL_HPP_INCLUDED diff --git a/boost/boost/typeof/native.hpp b/boost/boost/typeof/native.hpp new file mode 100644 index 0000000000..8197e28669 --- /dev/null +++ b/boost/boost/typeof/native.hpp @@ -0,0 +1,60 @@ +// Copyright (C) 2006 Arkadiy Vertleyb +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_NATIVE_HPP_INCLUDED +#define BOOST_TYPEOF_NATIVE_HPP_INCLUDED + +#ifndef MSVC_TYPEOF_HACK + +#ifdef BOOST_NO_SFINAE + +namespace boost { namespace type_of { + + template + T& ensure_obj(const T&); + +}} + +#else + +#include +#include + +namespace boost { namespace type_of { +# ifdef BOOST_NO_SFINAE + template + T& ensure_obj(const T&); +# else + template + typename enable_if, T&>::type + ensure_obj(T&); + + template + typename disable_if, T&>::type + ensure_obj(const T&); +# endif +}} + +#endif//BOOST_NO_SFINAE + +#define BOOST_TYPEOF(expr) BOOST_TYPEOF_KEYWORD(boost::type_of::ensure_obj(expr)) +#define BOOST_TYPEOF_TPL BOOST_TYPEOF + +#define BOOST_TYPEOF_NESTED_TYPEDEF_TPL(name,expr) \ + struct name {\ + typedef BOOST_TYPEOF_TPL(expr) type;\ + }; + +#define BOOST_TYPEOF_NESTED_TYPEDEF(name,expr) \ + struct name {\ + typedef BOOST_TYPEOF(expr) type;\ + }; + +#endif//MSVC_TYPEOF_HACK + +#define BOOST_TYPEOF_REGISTER_TYPE(x) +#define BOOST_TYPEOF_REGISTER_TEMPLATE(x, params) + +#endif//BOOST_TYPEOF_NATIVE_HPP_INCLUDED + diff --git a/boost/boost/typeof/typeof.hpp b/boost/boost/typeof/typeof.hpp new file mode 100644 index 0000000000..3e91649e2e --- /dev/null +++ b/boost/boost/typeof/typeof.hpp @@ -0,0 +1,203 @@ +// Copyright (C) 2004 Arkadiy Vertleyb +// Distributed under the Boost Software License, Version 1.0. (See accompanying +// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_TYPEOF_TYPEOF_HPP_INCLUDED +#define BOOST_TYPEOF_TYPEOF_HPP_INCLUDED + +#if defined(BOOST_TYPEOF_COMPLIANT) +# define BOOST_TYPEOF_EMULATION +#endif + +#if defined(BOOST_TYPEOF_EMULATION) && defined(BOOST_TYPEOF_NATIVE) +# error both typeof emulation and native mode requested +#endif + +#if defined(__COMO__) +# ifdef __GNUG__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD typeof +# endif +# else +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# error native typeof is not supported +# endif +# endif + +#elif defined(__INTEL_COMPILER) || defined(__ICL) || defined(__ICC) || defined(__ECC) +# ifdef __GNUC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif +# else +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# error native typeof is not supported +# endif +# endif + +#elif defined(__GNUC__) +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif + +#elif defined(__MWERKS__) +# if(__MWERKS__ <= 0x3003) // 8.x +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# else +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +# else // 9.x +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# define BOOST_TYPEOF_KEYWORD __typeof__ +# endif +# endif +#elif defined __CODEGEARC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +# else +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +#elif defined __BORLANDC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +# else +# define BOOST_TYPEOF_EMULATION_UNSUPPORTED +# endif +#elif defined __DMC__ +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# include +# define MSVC_TYPEOF_HACK +# endif +#elif defined(_MSC_VER) +# if (_MSC_VER <= 1300) // 6.5, 7.0 +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# define BOOST_TYPEOF_NATIVE +# endif +# include +# define MSVC_TYPEOF_HACK +# else +# error typeof emulation is not supported +# endif +# elif (_MSC_VER >= 1310) // 7.1 -> +# ifndef BOOST_TYPEOF_EMULATION +# ifndef BOOST_TYPEOF_NATIVE +# ifndef _MSC_EXTENSIONS +# define BOOST_TYPEOF_EMULATION +# else +# define BOOST_TYPEOF_NATIVE +# endif +# endif +# endif +# ifdef BOOST_TYPEOF_NATIVE +# include +# define MSVC_TYPEOF_HACK +# endif +# endif +#elif defined(__HP_aCC) +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# error native typeof is not supported +# endif + +#elif defined(__DECCXX) +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# error native typeof is not supported +# endif + +#elif defined(__BORLANDC__) +# if (__BORLANDC__ < 0x590) +# define BOOST_TYPEOF_NO_FUNCTION_TYPES +# define BOOST_TYPEOF_NO_MEMBER_FUNCTION_TYPES +# endif +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# error native typeof is not supported +# endif + +#else //unknown compiler +# ifndef BOOST_TYPEOF_NATIVE +# ifndef BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_EMULATION +# endif +# else +# ifndef BOOST_TYPEOF_KEYWORD +# define BOOST_TYPEOF_KEYWORD typeof +# endif +# endif + +#endif + +#define BOOST_TYPEOF_UNIQUE_ID()\ + BOOST_TYPEOF_REGISTRATION_GROUP * 0x10000 + __LINE__ + +#define BOOST_TYPEOF_INCREMENT_REGISTRATION_GROUP()\ + + +#ifdef BOOST_TYPEOF_EMULATION_UNSUPPORTED +# include +#elif defined BOOST_TYPEOF_EMULATION +# define BOOST_TYPEOF_TEXT "using typeof emulation" +# include +# include +# include +# include +# include +# include +# include +# include + +#elif defined(BOOST_TYPEOF_NATIVE) +# define BOOST_TYPEOF_TEXT "using native typeof" +# include +# include +#else +# error typeof configuration error +#endif + +// auto +#define BOOST_AUTO(Var, Expr) BOOST_TYPEOF(Expr) Var = Expr +#define BOOST_AUTO_TPL(Var, Expr) BOOST_TYPEOF_TPL(Expr) Var = Expr + +#endif//BOOST_TYPEOF_TYPEOF_HPP_INCLUDED diff --git a/boost/boost/utility/declval.hpp b/boost/boost/utility/declval.hpp new file mode 100644 index 0000000000..41ec3dcc69 --- /dev/null +++ b/boost/boost/utility/declval.hpp @@ -0,0 +1,44 @@ +// common_type.hpp ---------------------------------------------------------// + +// Copyright 2010 Vicente J. Botet Escriba + +// Distributed under the Boost Software License, Version 1.0. +// See http://www.boost.org/LICENSE_1_0.txt + +#ifndef BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP +#define BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP + +#include + +//----------------------------------------------------------------------------// + +#include + +//----------------------------------------------------------------------------// +// // +// C++03 implementation of // +// Written by Vicente J. Botet Escriba // +//~ 20.3.4 Function template declval [declval] +//~ 1 The library provides the function template declval to simplify the definition of expressions which occur as +//~ unevaluated operands. +//~ 2 Remarks: If this function is used, the program is ill-formed. +//~ 3 Remarks: The template parameter T of declval may be an incomplete type. +//~ [ Example: + +//~ template +//~ decltype(static_cast(declval())) convert(From&&); + +//~ declares a function template convert which only participats in overloading if the type From can be +//~ explicitly converted to type To. For another example see class template common_type (20.7.6.6). —end +//~ example ] +// // +//----------------------------------------------------------------------------// + +namespace boost { + + template + typename add_rvalue_reference::type declval(); //noexcept; // as unevaluated operand + +} // namespace boost + +#endif // BOOST_TYPE_TRAITS_EXT_DECLVAL__HPP diff --git a/boost/boost/version.hpp b/boost/boost/version.hpp index 8d996f8701..c80d428225 100644 --- a/boost/boost/version.hpp +++ b/boost/boost/version.hpp @@ -19,7 +19,7 @@ // BOOST_VERSION / 100 % 1000 is the minor version // BOOST_VERSION / 100000 is the major version -#define BOOST_VERSION 104400 +#define BOOST_VERSION 104601 // // BOOST_LIB_VERSION must be defined to be the same as BOOST_VERSION @@ -27,7 +27,7 @@ // number, y is the minor version number, and z is the patch level if not 0. // This is used by to select which library version to link to. -#define BOOST_LIB_VERSION "1_44" +#define BOOST_LIB_VERSION "1_46_1" #endif diff --git a/boost/libs/regex/src/cregex.cpp b/boost/libs/regex/src/cregex.cpp index f67d37185a..5c27330c8e 100644 --- a/boost/libs/regex/src/cregex.cpp +++ b/boost/libs/regex/src/cregex.cpp @@ -31,6 +31,9 @@ typedef boost::match_flag_type match_flag_type; #ifdef BOOST_MSVC #pragma warning(disable:4309) #endif +#ifdef BOOST_INTEL +#pragma warning(disable:981 383) +#endif namespace boost{ diff --git a/boost/libs/regex/src/icu.cpp b/boost/libs/regex/src/icu.cpp index 75ca144484..2fa2b3b17e 100755 --- a/boost/libs/regex/src/icu.cpp +++ b/boost/libs/regex/src/icu.cpp @@ -22,6 +22,10 @@ #define BOOST_REGEX_ICU_INSTANTIATE #include +#ifdef BOOST_INTEL +#pragma warning(disable:981 2259 383) +#endif + namespace boost{ namespace re_detail{ diff --git a/boost/libs/regex/src/regex.cpp b/boost/libs/regex/src/regex.cpp index 0a503820cb..27ac43cc09 100644 --- a/boost/libs/regex/src/regex.cpp +++ b/boost/libs/regex/src/regex.cpp @@ -44,6 +44,9 @@ #endif #endif +#ifdef BOOST_INTEL +#pragma warning(disable:383) +#endif namespace boost{ @@ -221,19 +224,3 @@ int WINAPI DllEntryPoint(HINSTANCE , unsigned long , void*) } #endif -#if defined(__IBMCPP__) && defined(BOOST_REGEX_DYN_LINK) -// -// Is this correct - linker complains without it ? -// -int main() -{ - return 0; -} - -#endif - - - - - - diff --git a/boost/libs/regex/src/regex_traits_defaults.cpp b/boost/libs/regex/src/regex_traits_defaults.cpp index 31b79184ec..5f06149c3e 100644 --- a/boost/libs/regex/src/regex_traits_defaults.cpp +++ b/boost/libs/regex/src/regex_traits_defaults.cpp @@ -100,7 +100,7 @@ BOOST_REGEX_DECL const char* BOOST_REGEX_CALL get_default_syntax(regex_constants "p", "P", "N", - "g", + "gk", "K", "R", }; diff --git a/boost/libs/regex/src/wide_posix_api.cpp b/boost/libs/regex/src/wide_posix_api.cpp index bdb7580e15..3c693c6720 100644 --- a/boost/libs/regex/src/wide_posix_api.cpp +++ b/boost/libs/regex/src/wide_posix_api.cpp @@ -29,6 +29,10 @@ #include #include +#ifdef BOOST_INTEL +#pragma warning(disable:981) +#endif + #if defined(BOOST_NO_STDC_NAMESPACE) || defined(__NetBSD__) namespace std{ # ifndef BOOST_NO_SWPRINTF