From 230777782955ffe5c1aadfd4ae6807b92ea4f28a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Thu, 20 Mar 2003 23:09:18 +0000 Subject: [PATCH] Boost version 1.30.0 git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6551 a592a061-630c-0410-9148-cb99ea01b6c8 --- boost/ChangeLog | 4 + boost/boost/detail/limits.hpp | 2 +- boost/boost/format.hpp | 15 +- boost/boost/format/parsing.hpp | 2 +- boost/boost/lexical_cast.hpp | 207 +++++-- boost/boost/mpl/aux_/integral_wrapper.hpp | 18 +- boost/boost/mpl/aux_/void_spec.hpp | 3 +- boost/boost/mpl/bool.hpp | 7 +- boost/boost/mpl/bool_fwd.hpp | 31 ++ boost/boost/mpl/if.hpp | 23 +- boost/boost/mpl/int_fwd.hpp | 25 + boost/boost/mpl/integral_c.hpp | 3 +- boost/boost/mpl/lambda_fwd.hpp | 2 +- boost/boost/mpl/size_t.hpp | 29 + boost/boost/mpl/size_t_fwd.hpp | 28 + boost/boost/regex/config.hpp | 7 +- boost/boost/regex/v3/regex_compile.hpp | 11 +- boost/boost/regex/v3/regex_match.hpp | 28 +- .../detail/is_mem_fun_pointer_impl.hpp | 526 +++++++++--------- .../type_traits/detail/size_t_trait_def.hpp | 10 +- .../boost/type_traits/is_base_and_derived.hpp | 86 +-- 21 files changed, 690 insertions(+), 377 deletions(-) create mode 100644 boost/boost/mpl/bool_fwd.hpp create mode 100644 boost/boost/mpl/int_fwd.hpp create mode 100644 boost/boost/mpl/size_t.hpp create mode 100644 boost/boost/mpl/size_t_fwd.hpp diff --git a/boost/ChangeLog b/boost/ChangeLog index ce2ef94118..dca61b62f7 100644 --- a/boost/ChangeLog +++ b/boost/ChangeLog @@ -1,3 +1,7 @@ +2003-03-21 Lars Gullik Bjønnes + + * update boot so version 1.30.0 + 2003-03-11 Lars Gullik Bjønnes * update from boost cvs branch RC_1_30_0 diff --git a/boost/boost/detail/limits.hpp b/boost/boost/detail/limits.hpp index 2dd2ad914b..5f478e3ece 100644 --- a/boost/boost/detail/limits.hpp +++ b/boost/boost/detail/limits.hpp @@ -51,7 +51,7 @@ // bit layout, but about floating-point NaN (etc.) bit patterns. #if defined(__sparc) || defined(__sparc__) || defined(__powerpc__) || defined(__ppc__) || defined(__hppa) || defined(_MIPSEB) || defined(_POWER) #define BOOST_BIG_ENDIAN -#elif defined(__i386__) || defined(__alpha__) +#elif defined(__i386__) || defined(__alpha__) || defined(__ia64) || defined(__ia64__) #define BOOST_LITTLE_ENDIAN #else #error The file boost/detail/limits.hpp needs to be set up for your CPU type. diff --git a/boost/boost/format.hpp b/boost/boost/format.hpp index 97c35c3a01..0cd5023fbd 100644 --- a/boost/boost/format.hpp +++ b/boost/boost/format.hpp @@ -40,12 +40,15 @@ #include // stlport workarounds #include -#if defined(BOOST_NO_STD_LOCALE) || ( BOOST_WORKAROUND(__BORLANDC__, <= 0x561) \ - && BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) ) -#define BOOST_BAD_ISDIGIT +#if defined(BOOST_NO_STD_LOCALE) || \ + ( BOOST_WORKAROUND(__BORLANDC__, <= 0x564) \ + || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x570 ) ) ) +// some future __BORLANDC__ >0x564 versions might not need this +// 0x570 is Borland's kylix branch +#define BOOST_NO_LOCALE_ISIDIGIT #endif -#ifdef BOOST_BAD_ISDIGIT +#ifdef BOOST_NO_LOCALE_ISIDIGIT #include // we'll use the non-locale 's std::isdigit(int) #endif @@ -85,8 +88,8 @@ #ifdef BOOST_NO_OVERLOAD_FOR_NON_CONST #undef BOOST_NO_OVERLOAD_FOR_NON_CONST #endif -#ifdef BOOST_BAD_ISDIGIT -#undef BOOST_BAD_ISDIGIT +#ifdef BOOST_NO_LOCALE_ISIDIGIT +#undef BOOST_NO_LOCALE_ISIDIGIT #endif #ifdef BOOST_IO_STD #undef BOOST_IO_STD diff --git a/boost/boost/format/parsing.hpp b/boost/boost/format/parsing.hpp index c9b7bf5f58..1e8bd904c3 100644 --- a/boost/boost/format/parsing.hpp +++ b/boost/boost/format/parsing.hpp @@ -34,7 +34,7 @@ namespace detail { template inline bool wrap_isdigit(Ch c, Stream &os) { -#ifndef BOOST_BAD_ISDIGIT +#ifndef BOOST_NO_LOCALE_ISIDIGIT return std::isdigit(c, os.rdbuf()->getloc() ); # else using namespace std; diff --git a/boost/boost/lexical_cast.hpp b/boost/boost/lexical_cast.hpp index bd37e9a28e..a247649bac 100644 --- a/boost/boost/lexical_cast.hpp +++ b/boost/boost/lexical_cast.hpp @@ -1,31 +1,42 @@ -// boost lexical_cast.hpp header -------------------------------------------// - -// See http://www.boost.org/libs/conversion for documentation. - #ifndef BOOST_LEXICAL_CAST_INCLUDED #define BOOST_LEXICAL_CAST_INCLUDED +// Boost lexical_cast.hpp header -------------------------------------------// +// +// See http://www.boost.org for most recent version including documentation. +// See end of this header for rights and permissions. +// // what: lexical_cast custom keyword cast -// who: contributed by Kevlin Henney, with alternative naming, behaviors -// and fixes contributed by Dave Abrahams, Daryle Walker and other -// Boosters on the list -// when: November 2000 -// where: tested with MSVC 6.0, BCC 5.5, and g++ 2.91 +// who: contributed by Kevlin Henney, +// enhanced with contributions from Terje Slettebø, +// with additional fixes and suggestions from Gennaro Prota, +// Beman Dawes, Dave Abrahams, Daryle Walker, Peter Dimov, +// and other Boosters +// when: November 2000, March 2003 +#include +#include #include +#include +#include -// Some sstream implementations are broken for the purposes of lexical cast. -# if defined(BOOST_NO_STRINGSTREAM) -# define BOOST_LEXICAL_CAST_USE_STRSTREAM -# endif - -#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM -# include +#ifdef BOOST_NO_STRINGSTREAM +#include #else -# include +#include #endif -#include +#if defined(BOOST_NO_STRINGSTREAM) || \ + defined(BOOST_NO_STD_WSTRING) || \ + defined(BOOST_NO_STD_LOCALE) || \ + defined(BOOST_NO_CWCHAR) || \ + defined(BOOST_MSVC) && (BOOST_MSVC <= 1200) +#define DISABLE_WIDE_CHAR_SUPPORT +#endif + +#ifdef BOOST_NO_INTRINSIC_WCHAR_T +#include +#endif namespace boost { @@ -33,35 +44,158 @@ namespace boost class bad_lexical_cast : public std::bad_cast { public: - // constructors, destructors, and assignment operator defaulted - - // function inlined for brevity and consistency with rest of library - virtual const char * what() const throw() + virtual ~bad_lexical_cast() throw() { - return "bad lexical cast: " - "source type value could not be interpreted as target"; } }; + namespace detail // actual underlying concrete exception type + { + template + class no_lexical_conversion : public bad_lexical_cast + { + public: + no_lexical_conversion() + : description( + std::string() + "bad lexical cast: " + + "source type value could not be interpreted as target, Target=" + + typeid(Target).name() + ", Source=" + typeid(Source).name()) + { + } + virtual ~no_lexical_conversion() throw() + { + } + virtual const char *what() const throw() + { + return description.c_str(); + } + private: + const std::string description; // static initialization fails on MSVC6 + }; + } + + namespace detail // selectors for choosing stream character type + { + template + struct stream_char + { + typedef char type; + }; + + #ifndef DISABLE_WIDE_CHAR_SUPPORT + template<> + struct stream_char + { + typedef wchar_t type; + }; + + template<> + struct stream_char + { + typedef wchar_t type; + }; + + template<> + struct stream_char + { + typedef wchar_t type; + }; + + template<> + struct stream_char + { + typedef wchar_t type; + }; + #endif + + template + struct widest_char + { + typedef TargetChar type; + }; + + template<> + struct widest_char + { + typedef wchar_t type; + }; + } + + namespace detail // stream wrapper for handling lexical conversions + { + template + class lexical_stream + { + public: + lexical_stream() + { + stream.unsetf(std::ios::skipws); + + if(std::numeric_limits::is_specialized) + stream.precision(std::numeric_limits::digits10 + 1); + else if(std::numeric_limits::is_specialized) + stream.precision(std::numeric_limits::digits10 + 1); + } + ~lexical_stream() + { + #if defined(BOOST_NO_STRINGSTREAM) + stream.freeze(false); + #endif + } + bool operator<<(const Source &input) + { + return stream << input; + } + template + bool operator>>(InputStreamable &output) + { + return !is_pointer::value && + stream >> output && + (stream >> std::ws).eof(); + } + bool operator>>(std::string &output) + { + #if defined(BOOST_NO_STRINGSTREAM) + stream << '\0'; + #endif + output = stream.str(); + return true; + } + #ifndef DISABLE_WIDE_CHAR_SUPPORT + bool operator>>(std::wstring &output) + { + output = stream.str(); + return true; + } + #endif + private: + typedef typename widest_char< + typename stream_char::type, + typename stream_char::type>::type char_type; + + #if defined(BOOST_NO_STRINGSTREAM) + std::strstream stream; + #elif defined(BOOST_NO_STD_LOCALE) + std::stringstream stream; + #else + std::basic_stringstream stream; + #endif + }; + } + template Target lexical_cast(Source arg) { -# ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM - std::strstream interpreter; // for out-of-the-box g++ 2.95.2 -# else - std::stringstream interpreter; -# endif + detail::lexical_stream interpreter; Target result; - if(!(interpreter << arg) || !(interpreter >> result) || - !(interpreter >> std::ws).eof()) - throw bad_lexical_cast(); - + if(!(interpreter << arg && interpreter >> result)) + throw detail::no_lexical_conversion(); return result; } } -// Copyright Kevlin Henney, 2000, 2001, 2002. All rights reserved. +// Copyright Kevlin Henney, 2000-2003. All rights reserved. // // Permission to use, copy, modify, and distribute this software for any // purpose is hereby granted without fee, provided that this copyright and @@ -69,8 +203,5 @@ namespace boost // // This software is provided "as is" without express or implied warranty. -#ifdef BOOST_LEXICAL_CAST_USE_STRSTREAM -# undef BOOST_LEXICAL_CAST_USE_STRSTREAM -#endif - +#undef DISABLE_WIDE_CHAR_SUPPORT #endif diff --git a/boost/boost/mpl/aux_/integral_wrapper.hpp b/boost/boost/mpl/aux_/integral_wrapper.hpp index f7e326a345..216ea3bbb9 100644 --- a/boost/boost/mpl/aux_/integral_wrapper.hpp +++ b/boost/boost/mpl/aux_/integral_wrapper.hpp @@ -26,7 +26,13 @@ #if !defined(AUX_WRAPPER_NAME) # define AUX_WRAPPER_NAME BOOST_PP_CAT(AUX_WRAPPER_VALUE_TYPE,_) +#endif + +#if !defined(AUX_WRAPPER_PARAMS) # define AUX_WRAPPER_PARAMS(N) BOOST_MPL_AUX_NTTP_DECL(AUX_WRAPPER_VALUE_TYPE, N) +#endif + +#if !defined(AUX_WRAPPER_INST) # define AUX_WRAPPER_INST(value) mpl::AUX_WRAPPER_NAME< value > #endif @@ -36,12 +42,18 @@ template< AUX_WRAPPER_PARAMS(N) > struct AUX_WRAPPER_NAME { BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, value = N); +// agurt, 08/mar/03: SGI MIPSpro C++ workaround, have to #ifdef because some +// other compilers (e.g. MSVC) are not particulary happy about it +#if BOOST_WORKAROUND(__EDG_VERSION__, <= 238) typedef struct AUX_WRAPPER_NAME type; +#else + typedef AUX_WRAPPER_NAME type; +#endif typedef AUX_WRAPPER_VALUE_TYPE value_type; - // have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), - // while some other don't like 'value + 1' (Borland), and some don't like - // either +// have to #ifdef here: some compilers don't like the 'N + 1' form (MSVC), +// while some other don't like 'value + 1' (Borland), and some don't like +// either #if BOOST_WORKAROUND(__EDG_VERSION__, <= 243) private: BOOST_STATIC_CONSTANT(AUX_WRAPPER_VALUE_TYPE, next_value = BOOST_MPL_AUX_ICE_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1))); diff --git a/boost/boost/mpl/aux_/void_spec.hpp b/boost/boost/mpl/aux_/void_spec.hpp index 286eeaf774..7363aa044e 100644 --- a/boost/boost/mpl/aux_/void_spec.hpp +++ b/boost/boost/mpl/aux_/void_spec.hpp @@ -19,6 +19,7 @@ #include "boost/mpl/lambda_fwd.hpp" #include "boost/mpl/void.hpp" +#include "boost/mpl/int_fwd.hpp" #include "boost/mpl/aux_/preprocessor/params.hpp" #include "boost/mpl/aux_/preprocessor/enum.hpp" #include "boost/mpl/aux_/preprocessor/def_params_tail.hpp" @@ -88,7 +89,7 @@ struct lambda< \ template<> \ struct lambda< \ name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > \ - BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(-1) \ + BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(int_<-1>) \ > \ { \ typedef name< BOOST_MPL_AUX_VOID_SPEC_PARAMS(i) > type; \ diff --git a/boost/boost/mpl/bool.hpp b/boost/boost/mpl/bool.hpp index 04854eabe9..38e8596644 100644 --- a/boost/boost/mpl/bool.hpp +++ b/boost/boost/mpl/bool.hpp @@ -3,7 +3,7 @@ #define BOOST_MPL_BOOL_HPP_INCLUDED // + file: boost/mpl/bool.hpp -// + last modified: 25/feb/03 +// + last modified: 08/mar/03 // Copyright (c) 2000-03 // Aleksey Gurtovoy @@ -18,6 +18,7 @@ // // See http://www.boost.org/libs/mpl for documentation. +#include "boost/mpl/bool_fwd.hpp" #include "boost/mpl/aux_/config/static_constant.hpp" namespace boost { namespace mpl { @@ -30,10 +31,6 @@ template< bool C_ > struct bool_ operator bool() const { return this->value; } }; -// shorcuts -typedef bool_ true_; -typedef bool_ false_; - }} // namespace boost::mpl #endif // BOOST_MPL_BOOL_HPP_INCLUDED diff --git a/boost/boost/mpl/bool_fwd.hpp b/boost/boost/mpl/bool_fwd.hpp new file mode 100644 index 0000000000..851293715c --- /dev/null +++ b/boost/boost/mpl/bool_fwd.hpp @@ -0,0 +1,31 @@ + +#ifndef BOOST_MPL_BOOL_FWD_HPP_INCLUDED +#define BOOST_MPL_BOOL_FWD_HPP_INCLUDED + +// + file: boost/mpl/bool_fwd.hpp +// + last modified: 08/mar/03 + +// Copyright (c) 2000-03 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +namespace boost { namespace mpl { + +template< bool C_ > struct bool_; + +// shorcuts +typedef bool_ true_; +typedef bool_ false_; + +}} + +#endif // BOOST_MPL_BOOL_FWD_HPP_INCLUDED diff --git a/boost/boost/mpl/if.hpp b/boost/boost/mpl/if.hpp index 1c13d9dab5..0ef343e196 100644 --- a/boost/boost/mpl/if.hpp +++ b/boost/boost/mpl/if.hpp @@ -1,9 +1,11 @@ -//----------------------------------------------------------------------------- -// boost/mpl/if.hpp header file -// See http://www.boost.org for updates, documentation, and revision history. -//----------------------------------------------------------------------------- -// -// Copyright (c) 2000-02 Boost.org + +#ifndef BOOST_MPL_IF_HPP_INCLUDED +#define BOOST_MPL_IF_HPP_INCLUDED + +// + file: boost/mpl/if.hpp +// + last modified: 10/mar/03 + +// Copyright (c) 2000-03 Boost.org // // Permission to use, copy, modify, distribute and sell this software // and its documentation for any purpose is hereby granted without fee, @@ -12,9 +14,8 @@ // supporting documentation. No representations are made about the // suitability of this software for any purpose. It is provided "as is" // without express or implied warranty. - -#ifndef BOOST_MPL_IF_HPP_INCLUDED -#define BOOST_MPL_IF_HPP_INCLUDED +// +// See http://www.boost.org/libs/mpl for documentation. #include "boost/mpl/aux_/value_wknd.hpp" #include "boost/mpl/aux_/ice_cast.hpp" @@ -85,7 +86,7 @@ struct if_c { private: template struct answer { typedef T1 type; }; - template<> struct answer { typedef T2 type; }; + template<> struct answer { typedef T2 type; }; public: typedef typename answer< C_ >::type type; @@ -102,7 +103,7 @@ struct if_ { private: template struct answer { typedef T1 type; }; - template<> struct answer { typedef T2 type; }; + template<> struct answer { typedef T2 type; }; // agurt, 17/sep/02: in some situations MSVC 7.0 doesn't // handle 'answer' expression very well diff --git a/boost/boost/mpl/int_fwd.hpp b/boost/boost/mpl/int_fwd.hpp new file mode 100644 index 0000000000..7165c24108 --- /dev/null +++ b/boost/boost/mpl/int_fwd.hpp @@ -0,0 +1,25 @@ + +#ifndef BOOST_MPL_INT_FWD_HPP_INCLUDED +#define BOOST_MPL_INT_FWD_HPP_INCLUDED + +// + file: boost/mpl/int_fwd.hpp +// + last modified: 08/mar/03 + +// Copyright (c) 2000-03 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +namespace boost { namespace mpl { +template< int N > struct int_; +}} + +#endif // BOOST_MPL_INT_FWD_HPP_INCLUDED diff --git a/boost/boost/mpl/integral_c.hpp b/boost/boost/mpl/integral_c.hpp index ef1aebab8c..0068e2eb7b 100644 --- a/boost/boost/mpl/integral_c.hpp +++ b/boost/boost/mpl/integral_c.hpp @@ -3,7 +3,7 @@ #define BOOST_MPL_INTEGRAL_C_HPP_INCLUDED // + file: boost/mpl/integral_c.hpp -// + last modified: 25/feb/03 +// + last modified: 08/mar/03 // Copyright (c) 2000-03 // Aleksey Gurtovoy @@ -18,6 +18,7 @@ // // See http://www.boost.org/libs/mpl for documentation. +#include "boost/mpl/integral_c_fwd.hpp" #include "boost/mpl/aux_/ice_cast.hpp" #include "boost/mpl/aux_/config/ctps.hpp" #include "boost/mpl/aux_/config/workaround.hpp" diff --git a/boost/boost/mpl/lambda_fwd.hpp b/boost/boost/mpl/lambda_fwd.hpp index ba9b4f6e1c..a4680b552e 100644 --- a/boost/boost/mpl/lambda_fwd.hpp +++ b/boost/boost/mpl/lambda_fwd.hpp @@ -24,7 +24,7 @@ namespace boost { namespace mpl { #if !defined(BOOST_MPL_NO_FULL_LAMBDA_SUPPORT) -template< typename T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(long Arity) > +template< typename T BOOST_MPL_AUX_LAMBDA_ARITY_PARAM(typename Arity) > struct lambda; #else template< typename T, bool Protect > struct lambda; diff --git a/boost/boost/mpl/size_t.hpp b/boost/boost/mpl/size_t.hpp new file mode 100644 index 0000000000..086d1dcb8b --- /dev/null +++ b/boost/boost/mpl/size_t.hpp @@ -0,0 +1,29 @@ + +#ifndef BOOST_MPL_SIZE_T_HPP_INCLUDED +#define BOOST_MPL_SIZE_T_HPP_INCLUDED + +// + file: boost/mpl/size_t.hpp +// + last modified: 08/mar/03 + +// Copyright (c) 2000-03 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/mpl/size_t_fwd.hpp" + +#define AUX_WRAPPER_VALUE_TYPE std::size_t +#define AUX_WRAPPER_NAME size_t +#define AUX_WRAPPER_PARAMS(N) std::size_t N + +#include "boost/mpl/aux_/integral_wrapper.hpp" + +#endif // BOOST_MPL_SIZE_T_HPP_INCLUDED diff --git a/boost/boost/mpl/size_t_fwd.hpp b/boost/boost/mpl/size_t_fwd.hpp new file mode 100644 index 0000000000..3cd63c4046 --- /dev/null +++ b/boost/boost/mpl/size_t_fwd.hpp @@ -0,0 +1,28 @@ + +#ifndef BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED +#define BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED + +// + file: boost/mpl/size_t_fwd.hpp +// + last modified: 08/mar/03 + +// Copyright (c) 2000-03 +// Aleksey Gurtovoy +// +// Permission to use, copy, modify, distribute and sell this software +// and its documentation for any purpose is hereby granted without fee, +// provided that the above copyright notice appears in all copies and +// that both the copyright notice and this permission notice appear in +// supporting documentation. No representations are made about the +// suitability of this software for any purpose. It is provided "as is" +// without express or implied warranty. +// +// See http://www.boost.org/libs/mpl for documentation. + +#include "boost/config.hpp" // make sure 'size_t' is placed into 'std' +#include + +namespace boost { namespace mpl { +template< std::size_t N > struct size_t; +}} + +#endif // BOOST_MPL_SIZE_T_FWD_HPP_INCLUDED diff --git a/boost/boost/regex/config.hpp b/boost/boost/regex/config.hpp index fa10278327..107824d882 100644 --- a/boost/boost/regex/config.hpp +++ b/boost/boost/regex/config.hpp @@ -125,8 +125,10 @@ // If there isn't good enough wide character support then there will // be no wide character regular expressions: // -#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) && !defined(BOOST_NO_WREGEX) -# define BOOST_NO_WREGEX +#if (defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_CWCTYPE) || defined(BOOST_NO_STD_WSTRING)) +# if !defined(BOOST_NO_WREGEX) +# define BOOST_NO_WREGEX +# endif #else # if defined(__sgi) && defined(__SGI_STL_PORT) // STLPort on IRIX is misconfigured: does not compile @@ -645,3 +647,4 @@ inline void pointer_construct(T* p, const T& t) + diff --git a/boost/boost/regex/v3/regex_compile.hpp b/boost/boost/regex/v3/regex_compile.hpp index 505353af67..78d098c1cd 100644 --- a/boost/boost/regex/v3/regex_compile.hpp +++ b/boost/boost/regex/v3/regex_compile.hpp @@ -1990,6 +1990,8 @@ unsigned int BOOST_REGEX_CALL reg_expression::probe_re { case re_detail::syntax_element_startmark: case re_detail::syntax_element_endmark: + if(static_cast(dat)->index == -2) + return regbase::restart_any; return probe_restart(dat->next.p); case re_detail::syntax_element_start_line: return regbase::restart_line; @@ -2018,7 +2020,7 @@ unsigned int BOOST_REGEX_CALL reg_expression::fixup_le if((leading_lit) && (static_cast(dat)->length > 2)) { // we can do a literal search for the leading literal string - // using Knuth-Morris-Pratt (or whatever), and only then check for + // using Knuth-Morris-Pratt (or whatever), and only then check for // matches. We need a decent length string though to make it // worth while. _leading_string = reinterpret_cast(reinterpret_cast(dat) + sizeof(re_detail::re_literal)); @@ -2066,10 +2068,14 @@ unsigned int BOOST_REGEX_CALL reg_expression::fixup_le case re_detail::syntax_element_rep: if((len == 0) && (1 == fixup_leading_rep(dat->next.p, static_cast(dat)->alt.p) )) { - static_cast(dat)->leading = true; + static_cast(dat)->leading = leading_lit; return len; } return len; + case re_detail::syntax_element_startmark: + if(static_cast(dat)->index == -2) + return 0; + // fall through: default: break; } @@ -2115,3 +2121,4 @@ void BOOST_REGEX_CALL reg_expression::fail(unsigned in + diff --git a/boost/boost/regex/v3/regex_match.hpp b/boost/boost/regex/v3/regex_match.hpp index 7576240ecf..ad5362c4a4 100644 --- a/boost/boost/regex/v3/regex_match.hpp +++ b/boost/boost/regex/v3/regex_match.hpp @@ -56,8 +56,10 @@ inline int string_compare(const std::basic_string& s, const C* p) { return s.compare(p); } inline int string_compare(const std::string& s, const char* p) { return std::strcmp(s.c_str(), p); } +# ifndef BOOST_NO_WREGEX inline int string_compare(const std::wstring& s, const wchar_t* p) { return std::wcscmp(s.c_str(), p); } +# endif # define STR_COMP(s,p) string_compare(s,p) #endif @@ -753,6 +755,15 @@ bool query_match_aux(iterator first, start_loop[cur_acc] = first; continue; } + else if((unsigned int)accumulators[cur_acc] < static_cast(ptr)->min) + { + // the repeat was null, and we haven't gone round min times yet, + // since all subsequent repeats will be null as well, just update + // our repeat count and skip out. + accumulators[cur_acc] = static_cast(ptr)->min; + ptr = static_cast(ptr)->alt.p; + continue; + } goto failure; } // see if we can skip the repeat: @@ -809,6 +820,15 @@ bool query_match_aux(iterator first, start_loop[cur_acc] = first; continue; } + else if((first == start_loop[cur_acc]) && accumulators[cur_acc] && ((unsigned int)accumulators[cur_acc] < static_cast(ptr)->min)) + { + // the repeat was null, and we haven't gone round min times yet, + // since all subsequent repeats will be null as well, just update + // our repeat count and skip out. + accumulators[cur_acc] = static_cast(ptr)->min; + ptr = static_cast(ptr)->alt.p; + continue; + } // if we get here then neither option is allowed so fail: goto failure; @@ -826,7 +846,7 @@ bool query_match_aux(iterator first, if(flags & match_not_eob) goto failure; iterator p(first); - while((p != last) && traits_inst.is_separator(traits_inst.translate(*first, icase)))++p; + while((p != last) && traits_inst.is_separator(traits_inst.translate(*p, icase)))++p; if(p != last) goto failure; ptr = ptr->next.p; @@ -958,6 +978,12 @@ bool query_match_aux(iterator first, goto failure; ptr = ptr->next.p; continue; + case syntax_element_backref: + if(temp_match[static_cast(ptr)->index].first + != temp_match[static_cast(ptr)->index].second) + goto failure; + ptr = ptr->next.p; + continue; default: goto failure; } diff --git a/boost/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp b/boost/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp index 9e4eac6721..0e2da0999d 100644 --- a/boost/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp +++ b/boost/boost/type_traits/detail/is_mem_fun_pointer_impl.hpp @@ -33,291 +33,291 @@ struct is_mem_fun_pointer_impl #if !defined(BOOST_TT_PREPROCESSING_MODE) // preprocessor-generated part, don't edit by hand! -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -template -struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool,value = true); }; -#endif // __MWERKS__ < 0x3000 +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +template +struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; +#endif #else @@ -341,8 +341,8 @@ struct is_mem_fun_pointer_impl struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; -// Metrowerks thinks this creates ambiguities -//: #if !defined(__MWERKS__) || __MWERKS__ >= 0x3000 +// Metrowerks and Visual Age think this creates ambiguities +//: #if !((defined(__MWERKS__) && __MWERKS__ < 0x3000) || (defined(__IBMCPP__) && __IBMCPP__ <= 600)) template struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; @@ -351,7 +351,7 @@ struct is_mem_fun_pointer_impl { template struct is_mem_fun_pointer_impl { BOOST_STATIC_CONSTANT(bool, value = true); }; -//: #endif // __MWERKS__ < 0x3000 +//: #endif #undef i diff --git a/boost/boost/type_traits/detail/size_t_trait_def.hpp b/boost/boost/type_traits/detail/size_t_trait_def.hpp index 36d18a292f..d3890e897d 100644 --- a/boost/boost/type_traits/detail/size_t_trait_def.hpp +++ b/boost/boost/type_traits/detail/size_t_trait_def.hpp @@ -17,7 +17,7 @@ // no include guards, the header is intended for multiple inclusion! #include "boost/type_traits/detail/template_arity_spec.hpp" -#include "boost/mpl/size_t_c.hpp" +#include "boost/mpl/size_t.hpp" #include "boost/mpl/aux_/lambda_support.hpp" #include @@ -26,7 +26,7 @@ # define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) /**/ #else # define BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ - typedef mpl::size_t_c< C > base_; \ + typedef mpl::size_t< C > base_; \ using base_::value; \ /**/ #endif @@ -34,7 +34,7 @@ #define BOOST_TT_AUX_SIZE_T_TRAIT_DEF1(trait,T,C) \ template< typename T > struct trait \ - : mpl::size_t_c< C > \ + : mpl::size_t< C > \ { \ BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ BOOST_MPL_AUX_LAMBDA_SUPPORT(1,trait,(T)) \ @@ -45,7 +45,7 @@ BOOST_TT_AUX_TEMPLATE_ARITY_SPEC(1,trait) \ #define BOOST_TT_AUX_SIZE_T_TRAIT_SPEC1(trait,spec,C) \ template<> struct trait \ - : mpl::size_t_c< C > \ + : mpl::size_t< C > \ { \ BOOST_TT_AUX_SIZE_T_TRAIT_VALUE_DECL(C) \ BOOST_MPL_AUX_LAMBDA_SUPPORT_SPEC(1,trait,(spec)) \ @@ -54,7 +54,7 @@ template<> struct trait \ #define BOOST_TT_AUX_SIZE_T_TRAIT_PARTIAL_SPEC1_1(param,trait,spec,C) \ template< param > struct trait \ - : mpl::size_t_c< C > \ + : mpl::size_t< C > \ { \ }; \ /**/ diff --git a/boost/boost/type_traits/is_base_and_derived.hpp b/boost/boost/type_traits/is_base_and_derived.hpp index 6b5eb58ecd..b699ae8d2f 100644 --- a/boost/boost/type_traits/is_base_and_derived.hpp +++ b/boost/boost/type_traits/is_base_and_derived.hpp @@ -1,5 +1,5 @@ -// (C) Copyright Rani Sharoni 2002. +// (C) Copyright Rani Sharoni 2003. // Permission to copy, use, modify, sell and distribute this software is // granted provided this copyright notice appears in all copies. This software // is provided "as is" without express or implied warranty, and with no claim @@ -25,6 +25,7 @@ namespace boost { namespace detail { #if !BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x570)) \ + && !BOOST_WORKAROUND(__SUNPRO_CC , BOOST_TESTED_AT(0x540)) \ && !BOOST_WORKAROUND(__EDG_VERSION__, <= 238) // The EDG version number is a lower estimate. // It is not currently known which EDG version @@ -35,58 +36,73 @@ namespace detail { This version detects ambiguous base classes and private base classes correctly, and was devised by Rani Sharoni. -The following explanation is by Terje Slettebo: +Explanation by Terje Slettebø and Rani Sharoni. -Let's take the multiple base class below as an example, and the -following will also show why there's not a problem with ambiguous base +Let's take the multiple base class below as an example, and the following +will also show why there's not a problem with private or ambiguous base class: struct B {}; struct B1 : B {}; struct B2 : B {}; -struct D : B1, private B2 {}; +struct D : private B1, private B2 {}; -typedef char Test[is_base_and_derived::result]; // improvement 1 - -multiple base +is_base_and_derived::value; +First, some terminology: -We have several possible conversion sequences: +SC - Standard conversion +UDC - User-defined conversion -For "static no check(B const volatile *, int)" we have the conversion +A user-defined conversion sequence consists of an SC, followed by an UDC, +followed by another SC. Either SC may be the identity conversion. + +When passing the default-constructed Host object to the overloaded check() +functions (initialization 8.5/14/4/3), we have several viable implicit +conversion sequences: + +For "static no_type check(B const volatile *, int)" we have the conversion sequences: - C -> C const -> B* -and - C -> D* -> B1*|B2* -> B* -For "static yes check(D const volatile *, T)" we have the conversion +C -> C const (SC - Qualification Adjustment) -> B const volatile* (UDC) +C -> D const volatile* (UDC) -> B1 const volatile* / B2 const volatile* -> + B const volatile* (SC - Conversion) + +For "static yes_type check(D const volatile *, T)" we have the conversion sequence: - C -> D* -Since, for the purpose of selecting the appropriate user-defined conversion -for a given function, it only considers up to the user-defined conversion, -for the first function this means choosing between C -> C const and C -> C, -and it chooses the latter. Therefore, we have: +C -> D const volatile* (UDC) -C -> D* -> B1*|B2* -> B* -C -> D* +According to 13.3.3.1/4, in context of user-defined conversion only the +standard conversion sequence is considered when selecting the best viable +function, so it only considers up to the user-defined conversion. For the +first function this means choosing between C -> C const and C -> C, and it +chooses the latter, because it's a proper subset (13.3.3.2/3/2) of the +former. Therefore, we have: -Here, the principle of the "shortest subsequence" applies, and it chooses -C -> D*. This shows that it doesn't even need to consider the multiple paths -to B, as that possibility is eliminated before it could possibly cause -ambiguity. Nifty. :) +C -> D const volatile* (UDC) -> B1 const volatile* / B2 const volatile* -> + B const volatile* (SC - Conversion) +C -> D const volatile* (UDC) -As Daveed notes in the posting Rani gives a link to in the clc++m posting, -if D is not derived from B, it has to choose between C -> C const -> B* for -the first function, and C -> D* for the second function, which are just as -good, _had it not been for the fact that "static no check(B const volatile -&, int)" is not templated (as Rani points out in the posting)_, which makes -C -> C const -> B* the best choice, resulting in "no". +Here, the principle of the "shortest subsequence" applies again, and it +chooses C -> D const volatile*. This shows that it doesn't even need to +consider the multiple paths to B, or accessibility, as that possibility is +eliminated before it could possibly cause ambiguity or access violation. -Also, if C::operator B* hadn't been const, the two conversion sequences for -"static no check(B const volatile *, int)" would have been ambiguous. +If D is not derived from B, it has to choose between C -> C const -> B const +volatile* for the first function, and C -> D const volatile* for the second +function, which are just as good (both requires a UDC, 13.3.3.2), had it not +been for the fact that "static no_type check(B const volatile *, int)" is +not templated, which makes C -> C const -> B const volatile* the best choice +(13.3.3/1/4), resulting in "no". -See also http://groups.google.com/groups?selm=df893da6.0301280859.522081f7%40posting.google.com -and links therein. +Also, if Host::operator B const volatile* hadn't been const, the two +conversion sequences for "static no_type check(B const volatile *, int)", in +the case where D is derived from B, would have been ambiguous. + +See also +http://groups.google.com/groups?selm=df893da6.0301280859.522081f7%40posting. +google.com and links therein. *************************************************************************/ @@ -189,5 +205,3 @@ BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC2_2(typename Base,typename Derived,is_base_a #include "boost/type_traits/detail/bool_trait_undef.hpp" #endif // BOOST_TT_IS_BASE_AND_DERIVED_HPP_INCLUDED - -