update boost to 1.44

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@35837 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Peter Kümmel 2010-10-25 19:11:25 +00:00
parent 85b1bba640
commit 228c1d22e4
126 changed files with 2393 additions and 970 deletions

View File

@ -13,6 +13,10 @@
* accompanying file LICENSE_1_0.txt or copy at
* http://www.boost.org/LICENSE_1_0.txt)
*
* 10 Mar 2010 - (mtc) fill method added, matching resolution of the standard library working group.
* See <http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#776> or Trac issue #3168
* Eventually, we should remove "assign" which is now a synonym for "fill" (Marshall Clow)
* 10 Mar 2010 - added workaround for SUNCC and !STLPort [trac #3893] (Marshall Clow)
* 29 Jan 2004 - c_array() added, BOOST_NO_PRIVATE_IN_AGGREGATE removed (Nico Josuttis)
* 23 Aug 2002 - fix for Non-MSVC compilers combined with MSVC libraries.
* 05 Aug 2001 - minor update (Nico Josuttis)
@ -29,6 +33,8 @@
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1400)
# pragma warning(push)
# pragma warning(disable:4996) // 'std::equal': Function call with parameters that may be unsafe
# pragma warning(disable:4510) // boost::array<T,N>' : default constructor could not be generated
# pragma warning(disable:4610) // warning C4610: class 'boost::array<T,N>' can never be instantiated - user defined constructor required
#endif
#include <cstddef>
@ -78,6 +84,11 @@ namespace boost {
reference, iterator, reference> > reverse_iterator;
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
const_reference, iterator, reference> > const_reverse_iterator;
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
value_type, reference, iterator, difference_type> reverse_iterator;
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
#else
// workaround for broken reverse_iterator implementations
typedef std::reverse_iterator<iterator,T> reverse_iterator;
@ -158,7 +169,8 @@ namespace boost {
}
// assign one value to all elements
void assign (const T& value)
void assign (const T& value) { fill ( value ); } // A synonym for fill
void fill (const T& value)
{
std::fill_n(begin(),size(),value);
}
@ -166,7 +178,8 @@ namespace boost {
// check range (may be private because it is static)
static void rangecheck (size_type i) {
if (i >= size()) {
throw std::out_of_range("array<>: index out of range");
std::out_of_range e("array<>: index out of range");
boost::throw_exception(e);
}
}
@ -202,6 +215,11 @@ namespace boost {
reference, iterator, reference> > reverse_iterator;
typedef std::reverse_iterator<std::_Ptrit<value_type, difference_type, const_iterator,
const_reference, iterator, reference> > const_reverse_iterator;
#elif defined(_RWSTD_NO_CLASS_PARTIAL_SPEC)
typedef std::reverse_iterator<iterator, std::random_access_iterator_tag,
value_type, reference, iterator, difference_type> reverse_iterator;
typedef std::reverse_iterator<const_iterator, std::random_access_iterator_tag,
value_type, const_reference, const_iterator, difference_type> const_reverse_iterator;
#else
// workaround for broken reverse_iterator implementations
typedef std::reverse_iterator<iterator,T> reverse_iterator;
@ -276,12 +294,14 @@ namespace boost {
}
// assign one value to all elements
void assign (const T& ) { }
void assign (const T& value) { fill ( value ); }
void fill (const T& ) {}
// check range (may be private because it is static)
static reference failed_rangecheck () {
std::out_of_range e("attempt to access element of an empty array");
boost::throw_exception(e);
#if defined(BOOST_NO_EXCEPTIONS) || !defined(BOOST_MSVC)
//
// We need to return something here to keep
// some compilers happy: however we will never
@ -289,6 +309,7 @@ namespace boost {
//
static T placeholder;
return placeholder;
#endif
}
};
#endif
@ -325,6 +346,38 @@ namespace boost {
x.swap(y);
}
// Specific for boost::array: simply returns its elems data member.
template <typename T, std::size_t N>
T(&get_c_array(boost::array<T,N>& arg))[N]
{
return arg.elems;
}
// Const version.
template <typename T, std::size_t N>
const T(&get_c_array(const boost::array<T,N>& arg))[N]
{
return arg.elems;
}
#if 0
// Overload for std::array, assuming that std::array will have
// explicit conversion functions as discussed at the WG21 meeting
// in Summit, March 2009.
template <typename T, std::size_t N>
T(&get_c_array(std::array<T,N>& arg))[N]
{
return static_cast<T(&)[N]>(arg);
}
// Const version.
template <typename T, std::size_t N>
const T(&get_c_array(const std::array<T,N>& arg))[N]
{
return static_cast<T(&)[N]>(arg);
}
#endif
} /* namespace boost */

View File

@ -25,7 +25,7 @@
namespace
{
#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ < 400)
#if defined(__BORLANDC__) || defined(__GNUC__) && (__GNUC__ < 4)
static inline boost::arg<1> _1() { return boost::arg<1>(); }
static inline boost::arg<2> _2() { return boost::arg<2>(); }
@ -38,7 +38,7 @@ static inline boost::arg<8> _8() { return boost::arg<8>(); }
static inline boost::arg<9> _9() { return boost::arg<9>(); }
#elif defined(BOOST_MSVC) || (defined(__DECCXX_VER) && __DECCXX_VER <= 60590031) || defined(__MWERKS__) || \
defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__ == 400)
defined(__GNUC__) && (__GNUC__ == 4 && __GNUC_MINOR__ < 2)
static boost::arg<1> _1;
static boost::arg<2> _2;

View File

@ -330,7 +330,16 @@ namespace boost
{
f(arg);
}
#if (BOOST_WORKAROUND(__GNUC__, BOOST_TESTED_AT(4) \
&& BOOST_WORKAROUND(__GNUC__, > 3)))
// Declare a dummy construktor 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::UnaryFunction<YourClassHere>::arg"
// in class without a constructor [-Wuninitialized])
UnaryFunction();
#endif
Func f;
Arg arg;
};

View File

@ -21,7 +21,7 @@
// 8026 - functions taking class by value arguments are not expanded inline
#pragma nopushoptwarn
# pragma option push -Vx -Ve -a8 -b -pc -Vmv -VC- -Vl- -w-8027 -w-8026
# pragma option push -a8 -Vx- -Ve- -b- -pc -Vmv -VC- -Vl- -w-8027 -w-8026

View File

@ -25,6 +25,9 @@ BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
of the library selected (useful for debugging).
BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib,
rather than a mangled-name version.
BOOST_AUTO_LINK_TAGGED: Specifies that we link to libraries built with the --layout=tagged option.
This is essentially the same as the default name-mangled version, but without
the compiler name and version, or the Boost version. Just the build options.
These macros will be undef'ed at the end of the header, further this header
has no include guards - so be sure to include it only once from your library!
@ -60,6 +63,8 @@ BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
a hiphen:
s static runtime (dynamic if not present).
g debug/diagnostic runtime (release if not present).
y Python debug/diagnostic runtime (release if not present).
d debug build (release if not present).
g debug/diagnostic runtime (release if not present).
p STLPort Build.
@ -183,8 +188,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydp"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdp"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -195,8 +208,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydpn"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-gdpn"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gydpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -207,7 +228,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else
# if defined(_DEBUG)
# if defined(_DEBUG) && defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-gyd"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gd"
# else
# define BOOST_LIB_RT_OPT
@ -219,8 +242,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# if (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)) && (defined(_STLP_OWN_IOSTREAMS) || defined(__STL_OWN_IOSTREAMS))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydp"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdp"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -231,8 +262,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# elif defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION)
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# if defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydpn"
# elif defined(_DEBUG) && (defined(__STL_DEBUG) || defined(_STLP_DEBUG))
# define BOOST_LIB_RT_OPT "-sgdpn"
# elif defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgydpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
# error "Build options aren't compatible with pre-built libraries"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1")
@ -243,7 +282,10 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else
# if defined(_DEBUG)
# if defined(_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sgyd"
# elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgd"
# else
# define BOOST_LIB_RT_OPT "-s"
@ -270,16 +312,26 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# ifdef _RTLDLL
# ifdef BOOST_BORLAND_DEBUG
# if defined(BOOST_BORLAND_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-yd"
# elif defined(BOOST_BORLAND_DEBUG)
# define BOOST_LIB_RT_OPT "-d"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT -y
# else
# define BOOST_LIB_RT_OPT
# endif
# else
# ifdef BOOST_BORLAND_DEBUG
# if defined(BOOST_BORLAND_DEBUG)\
&& defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-syd"
# elif defined(BOOST_BORLAND_DEBUG)
# define BOOST_LIB_RT_OPT "-sd"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sy"
# else
# define BOOST_LIB_RT_OPT "-s"
# endif
@ -309,16 +361,21 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
&& defined(BOOST_LIB_RT_OPT) \
&& defined(BOOST_LIB_VERSION)
#ifndef BOOST_AUTO_LINK_NOMANGLE
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".lib")
#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")
# 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
#else
#elif defined(BOOST_AUTO_LINK_NOMANGLE)
# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# endif
#else
# pragma comment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) "-" BOOST_LIB_TOOLSET BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT "-" BOOST_LIB_VERSION ".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
#endif
#else
@ -361,13 +418,3 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# undef BOOST_AUTO_LINK_NOMANGLE
#endif

View File

@ -218,7 +218,7 @@
//
// check for exception handling support:
//
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS)
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
//
@ -230,8 +230,9 @@
//
// all versions support __declspec:
//
#ifndef __STRICT_ANSI__
# define BOOST_HAS_DECLSPEC
#if defined(__STRICT_ANSI__)
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif
//
// ABI fixing headers:
@ -261,6 +262,13 @@
# define BOOST_NO_VOID_RETURNS
#endif
// Borland did not implement value-initialization completely, as I reported
// in 2007, Borland Report 51854, "Value-initialization: POD struct should be
// zero-initialized", http://qc.embarcadero.com/wc/qcmain.aspx?d=51854
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, April 2010)
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)

View File

@ -19,8 +19,8 @@
#endif
//
// versions check:
// last known and checked version is 0x620
#if (__CODEGEARC__ > 0x620)
// last known and checked version is 0x621
#if (__CODEGEARC__ > 0x621)
# if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results"
# else
@ -41,7 +41,7 @@
#endif
// CodeGear C++ Builder 2010
#if (__CODEGEARC__ <= 0x620)
#if (__CODEGEARC__ <= 0x621)
# define BOOST_NO_TYPENAME_WITH_CTOR // Cannot use typename keyword when making temporaries of a dependant type
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
@ -51,6 +51,15 @@
// Temporary hack, until specific MPL preprocessed headers are generated
# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS
// CodeGear has not yet completely implemented value-initialization, for
// example for array types, as I reported in 2010: Embarcadero Report 83751,
// "Value-initialization: arrays should have each element value-initialized",
// http://qc.embarcadero.com/wc/qcmain.aspx?d=83751
// Last checked version: Embarcadero C++ 6.21
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, April 2010)
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# ifdef NDEBUG
// fix broken <cstring> so that Boost.test works:
# include <cstring>
@ -66,6 +75,11 @@
//
// C++0x macros:
//
#if (__CODEGEARC__ <= 0x620)
#define BOOST_NO_STATIC_ASSERT
#else
#define BOOST_HAS_STATIC_ASSERT
#endif
#define BOOST_HAS_CHAR16_T
#define BOOST_HAS_CHAR32_T
#define BOOST_HAS_LONG_LONG
@ -91,7 +105,6 @@
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
@ -122,7 +135,7 @@
//
// check for exception handling support:
//
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS)
#if !defined(_CPPUNWIND) && !defined(BOOST_CPPUNWIND) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
//
@ -134,8 +147,9 @@
//
// all versions support __declspec:
//
#if !defined(__STRICT_ANSI__)
# define BOOST_HAS_DECLSPEC
#if defined(__STRICT_ANSI__)
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif
//
// ABI fixing headers:

View File

@ -44,7 +44,7 @@
#endif
// See also kai.hpp which checks a Kai-specific symbol for EH
# if !defined(__KCC) && !defined(__EXCEPTIONS)
# if !defined(__KCC) && !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
# endif
@ -59,6 +59,9 @@
//
// See above for BOOST_NO_LONG_LONG
//
#if (__EDG_VERSION__ < 310)
# define BOOST_NO_EXTERN_TEMPLATE
#endif
#if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
// No support for initializer lists
# define BOOST_NO_INITIALIZER_LISTS
@ -74,7 +77,6 @@
#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
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR

View File

@ -51,7 +51,7 @@
// check for exception handling support:
#ifndef _CPPUNWIND
#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif

View File

@ -42,6 +42,7 @@
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_EXTERN_TEMPLATE
#elif __GNUC__ == 3
# if defined (__PATHSCALE__)
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
@ -58,6 +59,7 @@
# if __GNUC_MINOR__ < 4
# define BOOST_NO_IS_ABSTRACT
# endif
# define BOOST_NO_EXTERN_TEMPLATE
#endif
#if __GNUC__ < 4
//
@ -69,7 +71,19 @@
# endif
#endif
#ifndef __EXCEPTIONS
#if __GNUC__ < 4 || ( __GNUC__ == 4 && __GNUC_MINOR__ < 4 )
// Previous versions of GCC did not completely implement value-initialization:
// GCC Bug 30111, "Value-initialization of POD base class doesn't initialize
// members", reported by Jonathan Wakely in 2006,
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=30111 (fixed for GCC 4.4)
// GCC Bug 33916, "Default constructor fails to initialize array members",
// reported by Michael Elizabeth Chastain in 2007,
// http://gcc.gnu.org/bugzilla/show_bug.cgi?id=33916 (fixed for GCC 4.2.4)
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#endif
#if !defined(__EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
@ -94,25 +108,47 @@
#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
#define BOOST_HAS_NRVO
#endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if __GNUC__ >= 4
# if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
// 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.
# define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __attribute__((dllexport))
# define BOOST_SYMBOL_IMPORT __attribute__((dllimport))
# else
# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
# define BOOST_SYMBOL_IMPORT
# endif
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
#else
// config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif
//
// RTTI and typeinfo detection is possible post gcc-4.3:
//
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
# ifndef __GXX_RTTI
# define BOOST_NO_TYPEID
# define BOOST_NO_RTTI
# ifndef BOOST_NO_TYPEID
# define BOOST_NO_TYPEID
# endif
# ifndef BOOST_NO_RTTI
# define BOOST_NO_RTTI
# endif
# endif
#endif
// C++0x features not implemented in any GCC version
//
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
// C++0x features in 4.3.n and later
//
@ -168,6 +204,9 @@
//
#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5) || !defined(__GXX_EXPERIMENTAL_CXX0X__)
# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_LAMBDAS
# define BOOST_NO_RAW_LITERALS
# define BOOST_NO_UNICODE_LITERALS
#endif
// ConceptGCC compiler:

View File

@ -25,6 +25,31 @@
//
#define BOOST_HAS_LONG_LONG
// C++0x features:
//
# define BOOST_NO_CONSTEXPR
# define BOOST_NO_NULLPTR
# define BOOST_NO_TEMPLATE_ALIASES
# define BOOST_NO_DECLTYPE
# define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
# define BOOST_NO_RVALUE_REFERENCES
# define BOOST_NO_STATIC_ASSERT
# define BOOST_NO_VARIADIC_TEMPLATES
# define BOOST_NO_AUTO_DECLARATIONS
# define BOOST_NO_AUTO_MULTIDECLARATIONS
# define BOOST_NO_CHAR16_T
# define BOOST_NO_CHAR32_T
# define BOOST_NO_DEFAULTED_FUNCTIONS
# define BOOST_NO_DELETED_FUNCTIONS
# define BOOST_NO_INITIALIZER_LISTS
# define BOOST_NO_SCOPED_ENUMS
# define BOOST_NO_SFINAE_EXPR
# define BOOST_NO_SCOPED_ENUMS
# define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
# define BOOST_NO_LAMBDAS
# define BOOST_NO_RAW_LITERALS
# define BOOST_NO_UNICODE_LITERALS
#define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__

View File

@ -157,6 +157,29 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif
//
// An attempt to value-initialize a pointer-to-member may trigger an
// internal error on Intel <= 11.1 (last checked version), as was
// reported by John Maddock, Intel support issue 589832, May 2010.
// Moreover, according to test results from Huang-Vista-x86_32_intel,
// intel-vc9-win-11.1 may leave a non-POD array uninitialized, in some
// cases when it should be value-initialized.
// (Niels Dekker, LKEB, May 2010)
#if defined(__INTEL_COMPILER)
# if __INTEL_COMPILER <= 1110
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# endif
#endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if defined(__GNUC__) && (__GNUC__ >= 4)
# define BOOST_SYMBOL_EXPORT __attribute__((visibility("default")))
# define BOOST_SYMBOL_IMPORT
# define BOOST_SYMBOL_VISIBLE __attribute__((visibility("default")))
#endif
//
// last known and checked version:
#if (BOOST_INTEL_CXX_VERSION > 1110)

View File

@ -17,7 +17,7 @@
# endif
// see also common_edg.hpp which needs a special check for __KCC
# if !defined(_EXCEPTIONS)
# if !defined(_EXCEPTIONS) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
# endif

View File

@ -48,7 +48,7 @@
# define BOOST_NO_INTRINSIC_WCHAR_T
#endif
#if !__option(exceptions)
#if !__option(exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif

View File

@ -16,11 +16,28 @@
// if no threading API is detected.
//
#if (__PGIC__ >= 7)
// PGI 10.x doesn't seem to define __PGIC__
// versions earlier than 10.x do define __PGIC__
#if __PGIC__ >= 10
// options requested by configure --enable-test
#define BOOST_HAS_PTHREADS
#define BOOST_HAS_NRVO
#define BOOST_HAS_LONG_LONG
// options --enable-test wants undefined
#undef BOOST_NO_STDC_NAMESPACE
#undef BOOST_NO_EXCEPTION_STD_NAMESPACE
#undef BOOST_DEDUCED_TYPENAME
#elif __PGIC__ >= 7
#define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
#define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#define BOOST_NO_SWPRINTF
#define BOOST_NO_AUTO_MULTIDECLARATIONS
#define BOOST_NO_AUTO_DECLARATIONS
#else
@ -32,8 +49,6 @@
//
// 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
#define BOOST_NO_CONCEPTS

View File

@ -69,6 +69,25 @@
# define BOOST_NO_IS_ABSTRACT
# endif
# if (__SUNPRO_CC <= 0x5100)
// Sun 5.10 may not correctly value-initialize objects of
// some user defined types, as was reported in April 2010
// (CR 6947016), and confirmed by Steve Clamage.
// (Niels Dekker, LKEB, May 2010).
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
# endif
//
// Dynamic shared object (DSO) and dynamic-link library (DLL) support
//
#if __SUNPRO_CC > 0x500
# define BOOST_SYMBOL_EXPORT __global
# define BOOST_SYMBOL_IMPORT __global
# define BOOST_SYMBOL_VISIBLE __global
#endif
//
// Issues that effect all known versions:
//
@ -78,12 +97,7 @@
//
// C++0x features
//
#if(__SUNPRO_CC >= 0x590)
# define BOOST_HAS_LONG_LONG
#else
# define BOOST_NO_LONG_LONG
#endif
#define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS

View File

@ -30,6 +30,14 @@
# define BOOST_NO_INITIALIZER_LISTS
#endif
#if (__IBMCPP__ <= 1110)
// XL C++ V11.1 and earlier versions may not always value-initialize
// a temporary object T(), when T is a non-POD aggregate class type.
// Michael Wong (IBM Canada Ltd) has confirmed this issue and gave it
// high priority. -- Niels Dekker (LKEB), May 2010.
# define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#endif
//
// On AIX thread support seems to be indicated by _THREAD_SAFE:
//

View File

@ -79,6 +79,8 @@
// although a conforming signature for swprint exists in VC7.1
// it appears not to actually work:
# define BOOST_NO_SWPRINTF
// Our extern template tests also fail for this compiler:
# define BOOST_NO_EXTERN_TEMPLATE
#endif
#if defined(UNDER_CE)
@ -99,6 +101,24 @@
# define BOOST_NO_ADL_BARRIER
#endif
#if (_MSC_VER <= 1600)
// MSVC (including the latest checked version) has not yet completely
// implemented value-initialization, as is reported:
// "VC++ does not value-initialize members of derived classes without
// user-declared constructor", reported in 2009 by Sylvester Hesp:
// https://connect.microsoft.com/VisualStudio/feedback/details/484295
// "Presence of copy constructor breaks member class initialization",
// reported in 2009 by Alex Vakulenko:
// https://connect.microsoft.com/VisualStudio/feedback/details/499606
// "Value-initialization in new-expression", reported in 2005 by
// Pavel Kuznetsov (MetaCommunications Engineering):
// https://connect.microsoft.com/VisualStudio/feedback/details/100744
// See also: http://www.boost.org/libs/utility/value_init.htm#compiler_issues
// (Niels Dekker, LKEB, May 2010)
#define BOOST_NO_COMPLETE_VALUE_INITIALIZATION
#endif
#if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
# define BOOST_NO_INITIALIZER_LISTS
#endif
@ -115,7 +135,7 @@
//
// check for exception handling support:
#ifndef _CPPUNWIND
#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
@ -125,7 +145,7 @@
#if (_MSC_VER >= 1200)
# define BOOST_HAS_MS_INT64
#endif
#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1500))
#if (_MSC_VER >= 1310) && (defined(_MSC_EXTENSIONS) || (_MSC_VER >= 1400))
# define BOOST_HAS_LONG_LONG
#else
# define BOOST_NO_LONG_LONG
@ -144,11 +164,6 @@
# define BOOST_NO_RTTI
#endif
//
// all versions support __declspec:
//
#define BOOST_HAS_DECLSPEC
//
// C++0x features
//
@ -159,11 +174,14 @@
#if _MSC_VER < 1600
#define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS
#define BOOST_NO_DECLTYPE
#define BOOST_NO_LAMBDAS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_NULLPTR
#endif // _MSC_VER < 1600
#if _MSC_VER >= 1600
#define BOOST_HAS_STDINT_H
#endif
// C++0x features not supported by any versions
#define BOOST_NO_CHAR16_T
@ -171,19 +189,17 @@
#define BOOST_NO_CONCEPTS
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_NULLPTR
#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
//
// prefix and suffix headers:
//

View File

@ -8,9 +8,6 @@
// cygwin specific config options:
#define BOOST_PLATFORM "Cygwin"
#define BOOST_NO_CWCTYPE
#define BOOST_NO_CWCHAR
#define BOOST_NO_SWPRINTF
#define BOOST_HAS_DIRENT_H
#define BOOST_HAS_LOG1P
#define BOOST_HAS_EXPM1

View File

@ -21,10 +21,17 @@
# define BOOST_NO_SWPRINTF
#endif
#if !defined(__GNUC__) && !defined(BOOST_HAS_DECLSPEC)
// Default defines for BOOST_SYMBOL_EXPORT and BOOST_SYMBOL_IMPORT
// If a compiler doesn't support __declspec(dllexport)/__declspec(dllimport),
// its boost/config/compiler/ file must define BOOST_SYMBOL_EXPORT and
// BOOST_SYMBOL_IMPORT
#ifndef BOOST_SYMBOL_EXPORT
# define BOOST_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __declspec(dllexport)
# 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

View File

@ -15,6 +15,7 @@
// 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
@ -31,6 +32,7 @@
# 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
@ -40,10 +42,18 @@
// GCC-XML emulates other compilers, it has to appear first here!
# define BOOST_COMPILER_CONFIG "boost/config/compiler/gcc_xml.hpp"
#elif defined __CUDACC__
// NVIDIA CUDA C++ compiler for GPU
# define BOOST_COMPILER_CONFIG "boost/config/compiler/nvcc.hpp"
#elif defined __COMO__
// Comeau C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp"
#elif defined __clang__
// Clang C++ emulates GCC, so it has to appear early.
# define BOOST_COMPILER_CONFIG "boost/config/compiler/clang.hpp"
#elif defined __DMC__
// Digital Mars C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"

View File

@ -65,6 +65,10 @@
// vxWorks:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/vxworks.hpp"
#elif defined(__SYMBIAN32__)
// Symbian:
# define BOOST_PLATFORM_CONFIG "boost/config/platform/symbian.hpp"
#else
# if defined(unix) \

View File

@ -86,6 +86,11 @@
# define BOOST_NO_STD_LOCALE
#endif
#include <typeinfo>
#if !_HAS_EXCEPTIONS
# define BOOST_NO_STD_TYPEINFO
#endif
// C++0x headers implemented in 520 (as shipped by Microsoft)
//
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
@ -100,6 +105,12 @@
# define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET
# define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPEINDEX
#endif
#if !defined(_HAS_TR1_IMPORTS) && !defined(BOOST_NO_0X_HDR_TUPLE)
# define BOOST_NO_0X_HDR_TUPLE
#endif
// C++0x headers not yet implemented
@ -114,7 +125,6 @@
# define BOOST_NO_0X_HDR_MUTEX
# define BOOST_NO_0X_HDR_RATIO
# define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE
#ifdef _CPPLIB_VER
# define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER

View File

@ -54,6 +54,7 @@
# 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

View File

@ -123,5 +123,6 @@
# define BOOST_NO_0X_HDR_FUTURE
# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
# define BOOST_NO_0X_HDR_TYPEINDEX
// --- end ---

View File

@ -43,6 +43,7 @@
# 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

View File

@ -67,6 +67,7 @@
# 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

View File

@ -173,6 +173,7 @@
# 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

View File

@ -126,6 +126,7 @@
# 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

View File

@ -221,6 +221,7 @@ namespace boost { using std::min; using std::max; }
# 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

View File

@ -33,6 +33,7 @@
# 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

View File

@ -8,7 +8,7 @@
// Copyright (c) 2002-2003 David Abrahams
// Copyright (c) 2003 Gennaro Prota
// Copyright (c) 2003 Eric Friedman
//
// Copyright (c) 2010 Eric Jourdanneau, Joel Falcou
// 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)
@ -25,6 +25,19 @@
#ifndef BOOST_CONFIG_SUFFIX_HPP
#define BOOST_CONFIG_SUFFIX_HPP
//
// ensure that visibility macros are always defined, thus symplifying use
//
#ifndef BOOST_SYMBOL_EXPORT
# define BOOST_SYMBOL_EXPORT
#endif
#ifndef BOOST_SYMBOL_IMPORT
# define BOOST_SYMBOL_IMPORT
#endif
#ifndef BOOST_SYMBOL_VISIBLE
# define BOOST_SYMBOL_VISIBLE
#endif
//
// look for long long by looking for the appropriate macros in <limits.h>.
// Note that we use limits.h rather than climits for maximal portability,
@ -82,6 +95,13 @@
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
#endif
//
// Normalize BOOST_NO_STATIC_ASSERT and (depricated) BOOST_HAS_STATIC_ASSERT:
//
#if !defined(BOOST_NO_STATIC_ASSERT) && !defined(BOOST_HAS_STATIC_ASSERT)
# define BOOST_HAS_STATIC_ASSERT
#endif
//
// if there is no __int64 then there is no specialisation
// for numeric_limits<__int64> either:
@ -314,6 +334,13 @@
# define BOOST_NO_INITIALIZER_LISTS
#endif
//
// Set BOOST_HAS_RVALUE_REFS when BOOST_NO_RVALUE_REFERENCES is not defined
//
#if !defined(BOOST_NO_RVALUE_REFERENCES) && !defined(BOOST_HAS_RVALUE_REFS)
#define BOOST_HAS_RVALUE_REFS
#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:
@ -554,6 +581,12 @@ namespace boost{
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS
// When BOOST_NO_STD_TYPEINFO is defined, we can just import
// the global definition into std namespace:
#ifdef BOOST_NO_STD_TYPEINFO
#include <typeinfo>
namespace std{ using ::typeinfo; }
#endif
// ---------------------------------------------------------------------------//
@ -596,6 +629,11 @@ namespace boost{
# endif
# endif
//
// Set some default values GPU support
//
# ifndef BOOST_GPU_ENABLED
# define BOOST_GPU_ENABLED
# endif
#endif

View File

@ -366,58 +366,87 @@ INT#_C macros if they're not already defined (John Maddock).
******************************************************/
#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && !defined(INT8_C)
#if !defined(BOOST__STDC_CONSTANT_MACROS_DEFINED) && \
(!defined(INT8_C) || !defined(INT16_C) || !defined(INT32_C) || !defined(INT64_C))
//
// For the following code we get several warnings along the lines of:
//
// boost/cstdint.hpp:428:35: error: use of C99 long long integer constant
//
// So we declare this a system header to suppress these warnings.
//
#if defined(__GNUC__) && (__GNUC__ >= 4)
#pragma GCC system_header
#endif
#include <limits.h>
# define BOOST__STDC_CONSTANT_MACROS_DEFINED
# if defined(BOOST_HAS_MS_INT64)
//
// Borland/Intel/Microsoft compilers have width specific suffixes:
//
#ifndef INT8_C
# define INT8_C(value) value##i8
#endif
#ifndef INT16_C
# define INT16_C(value) value##i16
#endif
#ifndef INT32_C
# define INT32_C(value) value##i32
#endif
#ifndef INT64_C
# define INT64_C(value) value##i64
#endif
# ifdef __BORLANDC__
// Borland bug: appending ui8 makes the type a signed char
# define UINT8_C(value) static_cast<unsigned char>(value##u)
# else
# define UINT8_C(value) value##ui8
# endif
#ifndef UINT16_C
# define UINT16_C(value) value##ui16
#endif
#ifndef UINT32_C
# define UINT32_C(value) value##ui32
#endif
#ifndef UINT64_C
# define UINT64_C(value) value##ui64
#endif
#ifndef INTMAX_C
# define INTMAX_C(value) value##i64
# define UINTMAX_C(value) value##ui64
#endif
# else
// do it the old fashioned way:
// 8-bit types ------------------------------------------------------------//
# if UCHAR_MAX == 0xff
# if (UCHAR_MAX == 0xff) && !defined(INT8_C)
# define INT8_C(value) static_cast<boost::int8_t>(value)
# define UINT8_C(value) static_cast<boost::uint8_t>(value##u)
# endif
// 16-bit types -----------------------------------------------------------//
# if USHRT_MAX == 0xffff
# if (USHRT_MAX == 0xffff) && !defined(INT16_C)
# define INT16_C(value) static_cast<boost::int16_t>(value)
# define UINT16_C(value) static_cast<boost::uint16_t>(value##u)
# endif
// 32-bit types -----------------------------------------------------------//
# if UINT_MAX == 0xffffffff
#ifndef INT32_C
# if (UINT_MAX == 0xffffffff)
# define INT32_C(value) value
# define UINT32_C(value) value##u
# elif ULONG_MAX == 0xffffffff
# define INT32_C(value) value##L
# define UINT32_C(value) value##uL
# endif
#endif
// 64-bit types + intmax_t and uintmax_t ----------------------------------//
#ifndef INT64_C
# if defined(BOOST_HAS_LONG_LONG) && \
(defined(ULLONG_MAX) || defined(ULONG_LONG_MAX) || defined(ULONGLONG_MAX) || defined(_LLONG_MAX))
@ -462,7 +491,7 @@ INT#_C macros if they're not already defined (John Maddock).
# define INTMAX_C(value) INT64_C(value)
# define UINTMAX_C(value) UINT64_C(value)
# endif
#endif
# endif // Borland/Microsoft specific width suffixes
#endif // INT#_C macros.

View File

@ -40,115 +40,30 @@
#include <algorithm>
#include <vector>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/algorithm/copy.hpp>
#include <boost/range/algorithm/equal.hpp>
#include <boost/range/algorithm/sort.hpp>
#include <boost/range/algorithm/stable_sort.hpp>
#include <boost/range/algorithm/find_if.hpp>
#include <boost/range/algorithm/count.hpp>
#include <boost/range/algorithm/count_if.hpp>
#include <boost/range/algorithm_ext/is_sorted.hpp>
#include <boost/range/algorithm_ext/iota.hpp>
namespace boost {
template <typename Iter1, typename Iter2>
Iter1 begin(const std::pair<Iter1, Iter2>& p) { return p.first; }
template <typename Iter1, typename Iter2>
Iter2 end(const std::pair<Iter1, Iter2>& p) { return p.second; }
template <typename Iter1, typename Iter2>
typename boost::detail::iterator_traits<Iter1>::difference_type
size(const std::pair<Iter1, Iter2>& p) {
return std::distance(p.first, p.second);
}
#if 0
// These seem to interfere with the std::pair overloads :(
template <typename Container>
typename Container::iterator
begin(Container& c) { return c.begin(); }
template <typename Container>
typename Container::const_iterator
begin(const Container& c) { return c.begin(); }
template <typename Container>
typename Container::iterator
end(Container& c) { return c.end(); }
template <typename Container>
typename Container::const_iterator
end(const Container& c) { return c.end(); }
template <typename Container>
typename Container::size_type
size(const Container& c) { return c.size(); }
#else
template <typename T>
typename std::vector<T>::iterator
begin(std::vector<T>& c) { return c.begin(); }
template <typename T>
typename std::vector<T>::const_iterator
begin(const std::vector<T>& c) { return c.begin(); }
template <typename T>
typename std::vector<T>::iterator
end(std::vector<T>& c) { return c.end(); }
template <typename T>
typename std::vector<T>::const_iterator
end(const std::vector<T>& c) { return c.end(); }
template <typename T>
typename std::vector<T>::size_type
size(const std::vector<T>& c) { return c.size(); }
#endif
template <class ForwardIterator, class T>
void iota(ForwardIterator first, ForwardIterator last, T value)
{
for (; first != last; ++first, ++value)
*first = value;
}
template <typename Container, typename T>
void iota(Container& c, const T& value)
{
iota(begin(c), end(c), value);
}
// Also do version with 2nd container?
template <typename Container, typename OutIter>
OutIter copy(const Container& c, OutIter result) {
return std::copy(begin(c), end(c), result);
}
template <typename Container1, typename Container2>
bool equal(const Container1& c1, const Container2& c2)
{
if (size(c1) != size(c2))
return false;
return std::equal(begin(c1), end(c1), begin(c2));
}
template <typename Container>
void sort(Container& c) { std::sort(begin(c), end(c)); }
template <typename Container, typename Predicate>
void sort(Container& c, const Predicate& p) {
std::sort(begin(c), end(c), p);
}
template <typename Container>
void stable_sort(Container& c) { std::stable_sort(begin(c), end(c)); }
template <typename Container, typename Predicate>
void stable_sort(Container& c, const Predicate& p) {
std::stable_sort(begin(c), end(c), p);
}
template <typename InputIterator, typename Predicate>
bool any_if(InputIterator first, InputIterator last, Predicate p)
{
return std::find_if(first, last, p) != last;
}
template <typename Container, typename Predicate>
bool any_if(const Container& c, Predicate p)
{
return any_if(begin(c), end(c), p);
return any_if(boost::begin(c), boost::end(c), p);
}
template <typename InputIterator, typename T>
@ -159,62 +74,7 @@ namespace boost {
template <typename Container, typename T>
bool container_contains(const Container& c, const T& value)
{
return container_contains(begin(c), end(c), value);
}
template <typename Container, typename T>
std::size_t count(const Container& c, const T& value)
{
return std::count(begin(c), end(c), value);
}
template <typename Container, typename Predicate>
std::size_t count_if(const Container& c, Predicate p)
{
return std::count_if(begin(c), end(c), p);
}
template <typename ForwardIterator>
bool is_sorted(ForwardIterator first, ForwardIterator last)
{
if (first == last)
return true;
ForwardIterator next = first;
for (++next; next != last; first = next, ++next) {
if (*next < *first)
return false;
}
return true;
}
template <typename ForwardIterator, typename StrictWeakOrdering>
bool is_sorted(ForwardIterator first, ForwardIterator last,
StrictWeakOrdering comp)
{
if (first == last)
return true;
ForwardIterator next = first;
for (++next; next != last; first = next, ++next) {
if (comp(*next, *first))
return false;
}
return true;
}
template <typename Container>
bool is_sorted(const Container& c)
{
return is_sorted(begin(c), end(c));
}
template <typename Container, typename StrictWeakOrdering>
bool is_sorted(const Container& c, StrictWeakOrdering comp)
{
return is_sorted(begin(c), end(c), comp);
return container_contains(boost::begin(c), boost::end(c), value);
}
} // namespace boost

View File

@ -13,7 +13,9 @@
#include <boost/config.hpp>
#include <boost/detail/workaround.hpp>
#if ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) && defined(_GLIBCXX_DEBUG)) \
#if defined(BOOST_DETAIL_NO_CONTAINER_FWD) \
|| ((defined(__GLIBCPP__) || defined(__GLIBCXX__)) \
&& (defined(_GLIBCXX_DEBUG) || defined(_GLIBCXX_PARALLEL))) \
|| BOOST_WORKAROUND(__BORLANDC__, > 0x551) \
|| BOOST_WORKAROUND(__DMC__, BOOST_TESTED_AT(0x842)) \
|| (defined(__SGI_STL_PORT) || defined(_STLPORT_VERSION))

View File

@ -1,5 +1,6 @@
// Copyright 2005 Caleb Epstein
// Copyright 2006 John Maddock
// Copyright 2010 Rene Rivera
// Distributed under the Boost Software License, Version 1.0. (See accompany-
// ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
@ -42,10 +43,12 @@
# error Unknown machine endianness detected.
# endif
# define BOOST_BYTE_ORDER __BYTE_ORDER
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN)
#elif defined(_BIG_ENDIAN) && !defined(_LITTLE_ENDIAN) || \
defined(__BIG_ENDIAN__) && !defined(__LITTLE_ENDIAN__)
# define BOOST_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
#elif defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN) || \
defined(__LITTLE_ENDIAN__) && !defined(__BIG_ENDIAN__)
# define BOOST_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \

View File

@ -173,8 +173,8 @@ inline void lcast_set_precision(std::ios_base& stream, T*)
template<class Source, class Target>
inline void lcast_set_precision(std::ios_base& stream, Source*, Target*)
{
std::streamsize const s = lcast_get_precision((Source*)0);
std::streamsize const t = lcast_get_precision((Target*)0);
std::streamsize const s = lcast_get_precision(static_cast<Source*>(0));
std::streamsize const t = lcast_get_precision(static_cast<Target*>(0));
stream.precision(s > t ? s : t);
}

View File

@ -4,7 +4,7 @@
// 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/lib/optional for documentation.
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com

View File

@ -41,9 +41,9 @@
#ifdef BOOST_NO_SCOPED_ENUMS
# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_t
# define BOOST_SCOPED_ENUM_START(name) struct name { enum enum_type
# define BOOST_SCOPED_ENUM_END };
# define BOOST_SCOPED_ENUM(name) name::enum_t
# define BOOST_SCOPED_ENUM(name) name::enum_type
#else

View File

@ -74,7 +74,7 @@ template<class T> struct sp_typeid_
}
};
template<class T> sp_typeinfo sp_typeid_< T >::ti_( sp_typeid_< T >::name() );
template<class T> sp_typeinfo sp_typeid_< T >::ti_ = sp_typeid_< T >::name();
template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
{

View File

@ -65,6 +65,11 @@
#else
#define BOOST_MSVC_WORKAROUND_GUARD 0
#endif
#ifndef BOOST_MSVC_FULL_VER
#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 1
#else
#define BOOST_MSVC_FULL_VER_WORKAROUND_GUARD 0
#endif
#ifndef __GNUC__
#define __GNUC___WORKAROUND_GUARD 1
#else

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
@ -25,7 +25,7 @@ boost
{
public:
virtual char const * tag_typeid_name() const = 0;
virtual std::string tag_typeid_name() const = 0;
virtual std::string value_as_string() const = 0;
protected:
@ -62,7 +62,7 @@ boost
private:
char const * tag_typeid_name() const;
std::string tag_typeid_name() const;
std::string value_as_string() const;
value_type value_;

View File

@ -28,6 +28,26 @@
namespace
boost
{
typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
exception_ptr current_exception();
template <class T>
inline
exception_ptr
copy_exception( T const & e )
{
try
{
throw enable_current_exception(e);
}
catch(
... )
{
return current_exception();
}
}
#ifndef BOOST_NO_RTTI
typedef error_info<struct tag_original_exception_type,std::type_info const *> original_exception_type;
@ -39,91 +59,47 @@ boost
}
#endif
class exception_ptr;
exception_ptr current_exception();
void rethrow_exception( exception_ptr const & );
class
exception_ptr
namespace
exception_detail
{
typedef bool exception_ptr::*unspecified_bool_type;
friend exception_ptr current_exception();
friend void rethrow_exception( exception_ptr const & );
shared_ptr<exception_detail::clone_base const> c_;
bool bad_alloc_;
struct
bad_alloc_tag
bad_alloc_:
boost::exception,
std::bad_alloc
{
};
template <int Dummy>
exception_ptr
get_bad_alloc()
{
bad_alloc_ ba;
exception_detail::clone_impl<bad_alloc_> c(ba);
c <<
throw_function(BOOST_CURRENT_FUNCTION) <<
throw_file(__FILE__) <<
throw_line(__LINE__);
static exception_ptr ep(new exception_detail::clone_impl<bad_alloc_>(c));
return ep;
}
template <int Dummy>
struct
exception_ptr_bad_alloc
{
static exception_ptr const e;
};
explicit
exception_ptr( bad_alloc_tag ):
bad_alloc_(true)
{
}
explicit
exception_ptr( shared_ptr<exception_detail::clone_base const> const & c ):
c_(c),
bad_alloc_(false)
{
BOOST_ASSERT(c);
}
void
rethrow() const
{
BOOST_ASSERT(*this);
if( bad_alloc_ )
throw enable_current_exception(std::bad_alloc());
else
c_->rethrow();
}
bool
empty() const
{
return !bad_alloc_ && !c_;
}
public:
exception_ptr():
bad_alloc_(false)
{
}
~exception_ptr() throw()
{
}
operator unspecified_bool_type() const
{
return empty() ? 0 : &exception_ptr::bad_alloc_;
}
friend
bool
operator==( exception_ptr const & a, exception_ptr const & b )
{
return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_;
}
friend
bool
operator!=( exception_ptr const & a, exception_ptr const & b )
{
return !(a==b);
}
};
template <int Dummy>
exception_ptr const
exception_ptr_bad_alloc<Dummy>::
e = get_bad_alloc<Dummy>();
}
class
unknown_exception:
public exception,
public std::exception,
public exception_detail::clone_base
public boost::exception,
public std::exception
{
public:
@ -150,18 +126,6 @@ boost
private:
exception_detail::clone_base const *
clone() const
{
return new unknown_exception(*this);
}
void
rethrow() const
{
throw*this;
}
template <class E>
void
add_original_type( E const & e )
@ -179,8 +143,7 @@ boost
class
current_exception_std_exception_wrapper:
public T,
public boost::exception,
public clone_base
public boost::exception
{
public:
@ -204,18 +167,6 @@ boost
private:
clone_base const *
clone() const
{
return new current_exception_std_exception_wrapper(*this);
}
void
rethrow() const
{
throw *this;
}
template <class E>
void
add_original_type( E const & e )
@ -228,7 +179,7 @@ boost
#ifdef BOOST_NO_RTTI
template <class T>
exception const *
boost::exception const *
get_boost_exception( T const * )
{
try
@ -236,7 +187,7 @@ boost
throw;
}
catch(
exception & x )
boost::exception & x )
{
return &x;
}
@ -247,50 +198,50 @@ boost
}
#else
template <class T>
exception const *
boost::exception const *
get_boost_exception( T const * x )
{
return dynamic_cast<exception const *>(x);
return dynamic_cast<boost::exception const *>(x);
}
#endif
template <class T>
inline
shared_ptr<clone_base const>
exception_ptr
current_exception_std_exception( T const & e1 )
{
if( boost::exception const * e2 = get_boost_exception(&e1) )
return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1,*e2));
return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1,*e2));
else
return shared_ptr<current_exception_std_exception_wrapper<T> const>(new current_exception_std_exception_wrapper<T>(e1));
return boost::copy_exception(current_exception_std_exception_wrapper<T>(e1));
}
inline
shared_ptr<clone_base const>
exception_ptr
current_exception_unknown_exception()
{
return shared_ptr<unknown_exception const>(new unknown_exception());
return boost::copy_exception(unknown_exception());
}
inline
shared_ptr<clone_base const>
exception_ptr
current_exception_unknown_boost_exception( boost::exception const & e )
{
return shared_ptr<unknown_exception const>(new unknown_exception(e));
return boost::copy_exception(unknown_exception(e));
}
inline
shared_ptr<clone_base const>
exception_ptr
current_exception_unknown_std_exception( std::exception const & e )
{
if( boost::exception const * be = get_boost_exception(&e) )
return current_exception_unknown_boost_exception(*be);
else
return shared_ptr<unknown_exception const>(new unknown_exception(e));
return boost::copy_exception(unknown_exception(e));
}
inline
shared_ptr<clone_base const>
exception_ptr
current_exception_impl()
{
try
@ -300,7 +251,7 @@ boost
catch(
exception_detail::clone_base & e )
{
return shared_ptr<exception_detail::clone_base const>(e.clone());
return exception_ptr(e.clone());
}
catch(
std::domain_error & e )
@ -396,24 +347,28 @@ boost
exception_ptr
current_exception()
{
exception_ptr ret;
BOOST_ASSERT(!ret);
try
{
return exception_ptr(exception_detail::current_exception_impl());
ret=exception_detail::current_exception_impl();
}
catch(
std::bad_alloc & )
{
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
}
catch(
... )
{
try
{
return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception()));
ret=exception_detail::current_exception_std_exception(std::bad_exception());
}
catch(
std::bad_alloc & )
{
ret=exception_detail::exception_ptr_bad_alloc<42>::e;
}
catch(
... )
@ -421,30 +376,16 @@ boost
BOOST_ASSERT(0);
}
}
return exception_ptr(exception_ptr::bad_alloc_tag());
}
template <class T>
inline
exception_ptr
copy_exception( T const & e )
{
try
{
throw enable_current_exception(e);
}
catch(
... )
{
return current_exception();
}
BOOST_ASSERT(ret);
return ret;
}
inline
void
rethrow_exception( exception_ptr const & p )
{
p.rethrow();
BOOST_ASSERT(p);
p->rethrow();
}
inline

View File

@ -20,8 +20,21 @@ boost
namespace
to_string_detail
{
template <class T,class CharT,class Traits>
char operator<<( std::basic_ostream<CharT,Traits> &, T const & );
struct
partial_ordering_helper1
{
template <class CharT,class Traits>
partial_ordering_helper1( std::basic_ostream<CharT,Traits> & );
};
struct
partial_ordering_helper2
{
template <class T>
partial_ordering_helper2( T const & );
};
char operator<<( partial_ordering_helper1, partial_ordering_helper2 );
template <class T,class CharT,class Traits>
struct

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
@ -15,31 +15,35 @@
#include <boost/detail/sp_typeinfo.hpp>
#include <boost/current_function.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_TYPEID
#include <boost/units/detail/utility.hpp>
#endif
#include <string>
namespace
boost
{
template <class T>
inline
char const *
std::string
tag_type_name()
{
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return typeid(T*).name();
return units::detail::demangle(typeid(T*).name());
#endif
}
template <class T>
inline
char const *
std::string
type_name()
{
#ifdef BOOST_NO_TYPEID
return BOOST_CURRENT_FUNCTION;
#else
return typeid(T).name();
return units::detail::demangle(typeid(T).name());
#endif
}

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
@ -15,7 +15,9 @@
#include <boost/config.hpp>
#include <boost/exception/get_error_info.hpp>
#include <boost/utility/enable_if.hpp>
#include <boost/config.hpp>
#ifndef BOOST_NO_RTTI
#include <boost/units/detail/utility.hpp>
#endif
#include <exception>
#include <sstream>
#include <string>
@ -135,7 +137,7 @@ boost
}
#ifndef BOOST_NO_RTTI
tmp << std::string("Dynamic exception type: ") <<
(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';

View File

@ -9,8 +9,10 @@
namespace
boost
{
namespace exception_detail { class clone_base; };
template <class Tag,class T> class error_info;
class exception_ptr;
template <class T> class shared_ptr;
typedef shared_ptr<exception_detail::clone_base const> exception_ptr;
typedef error_info<struct errinfo_nested_exception_,exception_ptr> errinfo_nested_exception;
}

View File

@ -75,8 +75,8 @@ boost
void
release()
{
if( px_ )
px_->release();
if( px_ && px_->release() )
px_=0;
}
};
}
@ -132,21 +132,9 @@ boost
}
};
template <class E,class Tag,class T>
E const & operator<<( E const &, error_info<Tag,T> const & );
template <class E>
E const & operator<<( E const &, throw_function const & );
template <class E>
E const & operator<<( E const &, throw_file const & );
template <class E>
E const & operator<<( E const &, throw_line const & );
class exception;
template <class>
template <class T>
class shared_ptr;
namespace
@ -162,7 +150,8 @@ boost
virtual shared_ptr<error_info_base> get( type_info_ const & ) const = 0;
virtual void set( shared_ptr<error_info_base> const &, type_info_ const & ) = 0;
virtual void add_ref() const = 0;
virtual void release() const = 0;
virtual bool release() const = 0;
virtual refcount_ptr<exception_detail::error_info_container> clone() const = 0;
protected:
@ -184,6 +173,20 @@ boost
struct get_info<throw_line>;
char const * get_diagnostic_information( exception const &, char const * );
void copy_boost_exception( exception *, exception const * );
template <class E,class Tag,class T>
E const & set_info( E const &, error_info<Tag,T> const & );
template <class E>
E const & set_info( E const &, throw_function const & );
template <class E>
E const & set_info( E const &, throw_file const & );
template <class E>
E const & set_info( E const &, throw_line const & );
}
class
@ -216,30 +219,31 @@ boost
#endif
;
#if defined(__MWERKS__) && __MWERKS__<=0x3207
#if (defined(__MWERKS__) && __MWERKS__<=0x3207) || (defined(_MSC_VER) && _MSC_VER<=1310)
public:
#else
private:
template <class E>
friend E const & operator<<( E const &, throw_function const & );
friend E const & exception_detail::set_info( E const &, throw_function const & );
template <class E>
friend E const & operator<<( E const &, throw_file const & );
friend E const & exception_detail::set_info( E const &, throw_file const & );
template <class E>
friend E const & operator<<( E const &, throw_line const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
friend E const & exception_detail::set_info( E const &, throw_line const & );
template <class E,class Tag,class T>
friend E const & operator<<( E const &, error_info<Tag,T> const & );
friend E const & exception_detail::set_info( E const &, error_info<Tag,T> const & );
friend char const * exception_detail::get_diagnostic_information( exception const &, char const * );
template <class>
friend struct exception_detail::get_info;
friend struct exception_detail::get_info<throw_function>;
friend struct exception_detail::get_info<throw_file>;
friend struct exception_detail::get_info<throw_line>;
friend void exception_detail::copy_boost_exception( exception *, exception const * );
#endif
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
mutable char const * throw_function_;
@ -253,28 +257,32 @@ boost
{
}
template <class E>
E const &
operator<<( E const & x, throw_function const & y )
namespace
exception_detail
{
x.throw_function_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_function const & y )
{
x.throw_function_=y.v_;
return x;
}
template <class E>
E const &
operator<<( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
E const &
set_info( E const & x, throw_file const & y )
{
x.throw_file_=y.v_;
return x;
}
template <class E>
E const &
operator<<( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
template <class E>
E const &
set_info( E const & x, throw_line const & y )
{
x.throw_line_=y.v_;
return x;
}
}
////////////////////////////////////////////////////////////////////////
@ -300,10 +308,10 @@ boost
};
struct large_size { char c[256]; };
large_size dispatch( exception * );
large_size dispatch_boost_exception( exception const * );
struct small_size { };
small_size dispatch( void * );
small_size dispatch_boost_exception( void const * );
template <class,int>
struct enable_error_info_helper;
@ -326,7 +334,7 @@ boost
struct
enable_error_info_return_type
{
typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch((T*)0))>::type type;
typedef typename enable_error_info_helper<T,sizeof(exception_detail::dispatch_boost_exception((T*)0))>::type type;
};
}
@ -363,7 +371,13 @@ boost
void
copy_boost_exception( exception * a, exception const * b )
{
*a = *b;
refcount_ptr<error_info_container> data;
if( error_info_container * d=b->data_.get() )
data = d->clone();
a->throw_file_ = b->throw_file_;
a->throw_line_ = b->throw_line_;
a->throw_function_ = b->throw_function_;
a->data_ = data;
}
inline

View File

@ -1,4 +1,4 @@
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
//Copyright (c) 2006-2010 Emil Dotchevski and Reverge Studios, Inc.
//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)
@ -47,7 +47,7 @@ boost
template <class Tag,class T>
inline
char const *
std::string
error_info<Tag,T>::
tag_typeid_name() const
{
@ -114,8 +114,8 @@ boost
tmp << header;
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
{
shared_ptr<error_info_base const> const & x = i->second;
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << '\n';
error_info_base const & x = *i->second;
tmp << '[' << x.tag_typeid_name() << "] = " << x.value_as_string() << '\n';
}
tmp.str().swap(diagnostic_info_str_);
}
@ -131,33 +131,66 @@ boost
mutable std::string diagnostic_info_str_;
mutable int count_;
error_info_container_impl( error_info_container_impl const & );
error_info_container_impl & operator=( error_info_container const & );
void
add_ref() const
{
++count_;
}
void
bool
release() const
{
if( !--count_ )
if( --count_ )
return false;
else
{
delete this;
return true;
}
}
refcount_ptr<error_info_container>
clone() const
{
refcount_ptr<error_info_container> p;
error_info_container_impl * c=new error_info_container_impl;
p.adopt(c);
c->info_ = info_;
return p;
}
};
template <class E,class Tag,class T>
inline
E const &
set_info( E const & x, error_info<Tag,T> const & v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
}
template <class T>
struct
derives_boost_exception
{
enum e { value = (sizeof(dispatch_boost_exception((T*)0))==sizeof(large_size)) };
};
}
template <class E,class Tag,class T>
inline
E const &
typename enable_if<exception_detail::derives_boost_exception<E>,E const &>::type
operator<<( E const & x, error_info<Tag,T> const & v )
{
typedef error_info<Tag,T> error_info_tag_t;
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
exception_detail::error_info_container * c=x.data_.get();
if( !c )
x.data_.adopt(c=new exception_detail::error_info_container_impl);
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
return x;
return exception_detail::set_info(x,v);
}
}

View File

@ -37,7 +37,12 @@ namespace boost {
str (const string_type& s) {
size_type sz=s.size();
if(sz != 0 && mode_ & (::std::ios_base::in | ::std::ios_base::out) ) {
#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
void *vd_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
Ch *new_ptr = static_cast<Ch *>(vd_ptr);
#else
Ch *new_ptr = alloc_.allocate(sz, is_allocated_? eback() : 0);
#endif
// if this didnt throw, we're safe, update the buffer
dealloc();
sz = s.copy(new_ptr, sz);
@ -140,7 +145,7 @@ namespace boost {
typename basic_altstringbuf<Ch, Tr, Alloc>::pos_type
basic_altstringbuf<Ch, Tr, Alloc>::
seekpos (pos_type pos, ::std::ios_base::openmode which) {
off_type off = off_type(pos); // operation guaranteed by §27.4.3.2 table 88
off_type off = off_type(pos); // operation guaranteed by 27.4.3.2 table 88
if(pptr() != NULL && putend_ < pptr())
putend_ = pptr();
if(off != off_type(-1)) {
@ -249,7 +254,12 @@ namespace boost {
add_size /= 2;
if(0 < add_size) {
new_size += add_size;
#ifdef _RWSTD_NO_CLASS_PARTIAL_SPEC
void *vdptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
newptr = static_cast<Ch *>(vdptr);
#else
newptr = alloc_.allocate(new_size, is_allocated_? oldptr : 0);
#endif
}
if(0 < prev_size)

View File

@ -68,6 +68,31 @@ namespace boost {
{ return io::detail::feed<CharT, Tr, Alloc, T&>(*this,x); }
#endif
#if defined(__GNUC__)
// GCC can't handle anonymous enums without some help
// ** arguments passing ** //
basic_format& operator%(const int& x)
{ return io::detail::feed<CharT, Tr, Alloc, const int&>(*this,x); }
#ifndef BOOST_NO_OVERLOAD_FOR_NON_CONST
basic_format& operator%(int& x)
{ return io::detail::feed<CharT, Tr, Alloc, int&>(*this,x); }
#endif
#endif
// The total number of arguments expected to be passed to the format objectt
int expected_args() const
{ return num_args_; }
// The number of arguments currently bound (see bind_arg(..) )
int bound_args() const;
// The number of arguments currently fed to the format object
int fed_args() const;
// The index (1-based) of the current argument (i.e. next to be formatted)
int cur_arg() const;
// The number of arguments still required to be fed
int remaining_args() const; // same as expected_args() - bound_args() - fed_args()
// ** object modifying **//
template<class T>
basic_format& bind_arg(int argN, const T& val)

View File

@ -67,7 +67,7 @@ namespace boost {
template< class Ch, class Tr, class Alloc> // just don't copy the buf_ member
basic_format<Ch, Tr, Alloc>:: basic_format(const basic_format& x)
: items_(x.items_), bound_(x.bound_), style_(x.style_),
cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(false),
cur_arg_(x.cur_arg_), num_args_(x.num_args_), dumped_(x.dumped_),
prefix_(x.prefix_), exceptions_(x.exceptions_), loc_(x.loc_)
{
}
@ -171,6 +171,47 @@ namespace boost {
return *this;
}
template< class Ch, class Tr, class Alloc>
int basic_format<Ch,Tr, Alloc>::
bound_args() const {
if(bound_.size()==0)
return 0;
int n=0;
for(int i=0; i<num_args_ ; ++i)
if(bound_[i])
++n;
return n;
}
template< class Ch, class Tr, class Alloc>
int basic_format<Ch,Tr, Alloc>::
fed_args() const {
if(bound_.size()==0)
return cur_arg_;
int n=0;
for(int i=0; i<cur_arg_ ; ++i)
if(!bound_[i])
++n;
return n;
}
template< class Ch, class Tr, class Alloc>
int basic_format<Ch,Tr, Alloc>::
cur_arg() const {
return cur_arg_+1; }
template< class Ch, class Tr, class Alloc>
int basic_format<Ch,Tr, Alloc>::
remaining_args() const {
if(bound_.size()==0)
return num_args_-cur_arg_;
int n=0;
for(int i=cur_arg_; i<num_args_ ; ++i)
if(!bound_[i])
++n;
return n;
}
template< class Ch, class Tr, class Alloc>
typename basic_format<Ch, Tr, Alloc>::string_type
basic_format<Ch,Tr, Alloc>::
@ -261,7 +302,7 @@ namespace detail {
while(self.cur_arg_ < self.num_args_ && self.bound_[self.cur_arg_])
++self.cur_arg_;
}
// In any case, we either have all args, or are on a non-binded arg :
// In any case, we either have all args, or are on an unbound arg :
BOOST_ASSERT( self.cur_arg_ >= self.num_args_ || ! self.bound_[self.cur_arg_]);
return self;
}

View File

@ -148,7 +148,7 @@ namespace detail {
template<class Ch, class Tr> inline
void stream_format_state<Ch,Tr>:: reset(Ch fill) {
// set our params to standard's default state. cf § 27.4.4.1 of the C++ norm
// set our params to standard's default state. cf 27.4.4.1 of the C++ norm
width_=0; precision_=6;
fill_=fill; // default is widen(' '), but we cant compute it without the locale
flags_ = std::ios_base::dec | std::ios_base::skipws;

View File

@ -264,12 +264,12 @@ namespace boost {
A(a)
{
}
functor_wrapper(const functor_wrapper& f) :
functor_wrapper(const functor_wrapper& f) :
F(static_cast<const F&>(f)),
A(static_cast<const A&>(f))
{
}
{
}
};
/**

View File

@ -51,17 +51,15 @@ namespace boost
limits<T>::min_exponent;
}
// The result of frexp is always between 0.5 and 1, so its
// top bit will always be 1. Subtract by 0.5 to remove that.
v -= T(0.5);
v = ldexp(v, limits<std::size_t>::digits + 1);
v = ldexp(v, limits<std::size_t>::digits);
std::size_t seed = static_cast<std::size_t>(v);
v -= seed;
// ceiling(digits(T) * log2(radix(T))/ digits(size_t)) - 1;
std::size_t const length
= (limits<T>::digits *
boost::static_log2<limits<T>::radix>::value - 1)
boost::static_log2<limits<T>::radix>::value
+ limits<std::size_t>::digits - 1)
/ limits<std::size_t>::digits;
for(std::size_t i = 0; i != length; ++i)

View File

@ -16,6 +16,10 @@
#include <string>
#include <boost/limits.hpp>
#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
#include <boost/static_assert.hpp>
#endif
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
#include <boost/type_traits/is_pointer.hpp>
#endif
@ -29,6 +33,18 @@
namespace boost
{
#if defined(BOOST_HASH_NO_IMPLICIT_CASTS)
// If you get a static assertion here, it's because hash_value
// isn't declared for your type.
template <typename T>
std::size_t hash_value(T const&) {
BOOST_STATIC_ASSERT((T*) 0 && false);
return 0;
}
#endif
std::size_t hash_value(bool);
std::size_t hash_value(char);
std::size_t hash_value(unsigned char);
@ -44,7 +60,7 @@ namespace boost
std::size_t hash_value(wchar_t);
#endif
#if defined(BOOST_HAS_LONG_LONG)
#if !defined(BOOST_NO_LONG_LONG)
std::size_t hash_value(boost::long_long_type);
std::size_t hash_value(boost::ulong_long_type);
#endif
@ -174,7 +190,7 @@ namespace boost
}
#endif
#if defined(BOOST_HAS_LONG_LONG)
#if !defined(BOOST_NO_LONG_LONG)
inline std::size_t hash_value(boost::long_long_type v)
{
return hash_detail::hash_value_signed(v);
@ -408,7 +424,7 @@ namespace boost
BOOST_HASH_SPECIALIZE_REF(std::wstring)
#endif
#if defined(BOOST_HAS_LONG_LONG)
#if !defined(BOOST_NO_LONG_LONG)
BOOST_HASH_SPECIALIZE(boost::long_long_type)
BOOST_HASH_SPECIALIZE(boost::ulong_long_type)
#endif

View File

@ -57,6 +57,8 @@ namespace boost
// no specializations for 0 and 5: requests for a type > long are in error
#ifdef BOOST_HAS_LONG_LONG
template<> struct int_least_helper<1> { typedef boost::long_long_type least; };
#elif defined(BOOST_HAS_MS_INT64)
template<> struct int_least_helper<1> { typedef __int64 least; };
#endif
template<> struct int_least_helper<2> { typedef long least; };
template<> struct int_least_helper<3> { typedef int least; };
@ -64,6 +66,8 @@ namespace boost
template<> struct int_least_helper<5> { typedef signed char least; };
#ifdef BOOST_HAS_LONG_LONG
template<> struct int_least_helper<6> { typedef boost::ulong_long_type least; };
#elif defined(BOOST_HAS_MS_INT64)
template<> struct int_least_helper<6> { typedef unsigned __int64 least; };
#endif
template<> struct int_least_helper<7> { typedef unsigned long least; };
template<> struct int_least_helper<8> { typedef unsigned int least; };

View File

@ -77,12 +77,18 @@ template < >
template < >
class integer_traits< unsigned long >;
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && (defined(BOOST_HAS_LONG_LONG) || defined(BOOST_HAS_MS_INT64))
#if !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_LONG_LONG)
template < >
class integer_traits< ::boost::long_long_type>;
class integer_traits< ::boost::long_long_type>;
template < >
class integer_traits< ::boost::ulong_long_type >;
class integer_traits< ::boost::ulong_long_type >;
#elif !defined(BOOST_NO_INTEGRAL_INT64_T) && !defined(BOOST_NO_INT64_T) && defined(BOOST_HAS_MS_INT64)
template < >
class integer_traits<__int64>;
template < >
class integer_traits<unsigned __int64>;
#endif

View File

@ -7,7 +7,6 @@
#ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#include <boost/function.hpp>
#include <boost/iterator.hpp>
#include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp>

View File

@ -11,9 +11,9 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_xxx.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: has_xxx.hpp 63518 2010-07-02 08:32:03Z agurtovoy $
// $Date: 2010-07-02 04:32:03 -0400 (Fri, 02 Jul 2010) $
// $Revision: 63518 $
#include <boost/mpl/aux_/config/overload_resolution.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
@ -27,6 +27,7 @@
)
# define BOOST_MPL_CFG_NO_HAS_XXX
# define BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE
#endif

View File

@ -6,11 +6,10 @@
// http://www.boost.org/LICENSE_1_0.txt)
//
// Preprocessed version of "boost/mpl/aux_/template_arity.hpp" header
// *Preprocessed* version of the main "template_arity.hpp" header
// -- DO NOT modify by hand!
namespace boost { namespace mpl { namespace aux {
template< int N > struct arity_tag
{
typedef char (&type)[N + 1];
@ -23,7 +22,6 @@ struct max_arity
{
BOOST_STATIC_CONSTANT(int, value =
( C6 > 0 ? C6 : ( C5 > 0 ? C5 : ( C4 > 0 ? C4 : ( C3 > 0 ? C3 : ( C2 > 0 ? C2 : ( C1 > 0 ? C1 : -1 ) ) ) ) ) )
);
};
@ -83,7 +81,7 @@ template< typename F, int N >
struct template_arity_impl
{
BOOST_STATIC_CONSTANT(int, value =
sizeof(arity_helper(type_wrapper<F>(), arity_tag<N>())) - 1
sizeof(::boost::mpl::aux::arity_helper(type_wrapper<F>(), arity_tag<N>())) - 1
);
};
@ -92,9 +90,7 @@ struct template_arity
{
BOOST_STATIC_CONSTANT(int, value = (
max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value
));
typedef mpl::int_<value> type;
};

View File

@ -14,9 +14,9 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: template_arity.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: template_arity.hpp 61584 2010-04-26 18:48:26Z agurtovoy $
// $Date: 2010-04-26 14:48:26 -0400 (Mon, 26 Apr 2010) $
// $Revision: 61584 $
#include <boost/mpl/aux_/config/ttp.hpp>
#include <boost/mpl/aux_/config/lambda.hpp>
@ -98,7 +98,7 @@ template< typename F, BOOST_MPL_AUX_NTTP_DECL(int, N) >
struct template_arity_impl
{
BOOST_STATIC_CONSTANT(int, value =
sizeof(arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1
sizeof(::boost::mpl::aux::arity_helper(type_wrapper<F>(),arity_tag<N>())) - 1
);
};

View File

@ -2,7 +2,7 @@
#ifndef BOOST_MPL_BITAND_HPP_INCLUDED
#define BOOST_MPL_BITAND_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Aleksey Gurtovoy 2000-2009
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
@ -11,13 +11,35 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitand.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: bitand.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
// $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
// $Revision: 63520 $
// agurt, 23/jan/10: workaround a conflict with <iso646.h> header's
// macros, see http://tinyurl.com/ycwdxco; 'defined(bitand)'
// has to be checked in a separate condition, otherwise GCC complains
// about 'bitand' being an alternative token
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(bitand)
# pragma push_macro("bitand")
# undef bitand
# define bitand(x)
#endif
#endif
#endif
#define AUX778076_OP_NAME bitand_
#define AUX778076_OP_PREFIX bitand
#define AUX778076_OP_TOKEN &
#include <boost/mpl/aux_/arithmetic_op.hpp>
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(bitand)
# pragma pop_macro("bitand")
#endif
#endif
#endif
#endif // BOOST_MPL_BITAND_HPP_INCLUDED

View File

@ -2,7 +2,7 @@
#ifndef BOOST_MPL_BITOR_HPP_INCLUDED
#define BOOST_MPL_BITOR_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2004
// Copyright Aleksey Gurtovoy 2000-2009
// Copyright Jaap Suter 2003
//
// Distributed under the Boost Software License, Version 1.0.
@ -11,13 +11,35 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: bitor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: bitor.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
// $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
// $Revision: 63520 $
// agurt, 23/jan/10: workaround a conflict with <iso646.h> header's
// macros, see http://tinyurl.com/ycwdxco; 'defined(bitor)'
// has to be checked in a separate condition, otherwise GCC complains
// about 'bitor' being an alternative token
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(bitor)
# pragma push_macro("bitor")
# undef bitor
# define bitor(x)
#endif
#endif
#endif
#define AUX778076_OP_NAME bitor_
#define AUX778076_OP_PREFIX bitor
#define AUX778076_OP_TOKEN |
#include <boost/mpl/aux_/arithmetic_op.hpp>
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(bitor)
# pragma pop_macro("bitor")
#endif
#endif
#endif
#endif // BOOST_MPL_BITOR_HPP_INCLUDED

View File

@ -10,9 +10,9 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: eval_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: eval_if.hpp 61921 2010-05-11 21:33:24Z neilgroves $
// $Date: 2010-05-11 17:33:24 -0400 (Tue, 11 May 2010) $
// $Revision: 61921 $
#include <boost/mpl/if.hpp>
#include <boost/mpl/aux_/na_spec.hpp>

View File

@ -4,6 +4,7 @@
// Copyright Aleksey Gurtovoy 2002-2006
// Copyright David Abrahams 2002-2003
// Copyright Daniel Walker 2007
//
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE_1_0.txt or copy at
@ -11,20 +12,26 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: has_xxx.hpp 49273 2008-10-11 06:54:06Z agurtovoy $
// $Date: 2008-10-11 02:54:06 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49273 $
// $Id: has_xxx.hpp 64146 2010-07-19 00:46:31Z djwalker $
// $Date: 2010-07-18 20:46:31 -0400 (Sun, 18 Jul 2010) $
// $Revision: 64146 $
#include <boost/mpl/bool.hpp>
#include <boost/mpl/aux_/na_spec.hpp>
#include <boost/mpl/aux_/type_wrapper.hpp>
#include <boost/mpl/aux_/yes_no.hpp>
#include <boost/mpl/aux_/config/gcc.hpp>
#include <boost/mpl/aux_/config/has_xxx.hpp>
#include <boost/mpl/aux_/config/msvc_typename.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/preprocessor/array/elem.hpp>
#include <boost/preprocessor/cat.hpp>
#include <boost/preprocessor/control/if.hpp>
#include <boost/preprocessor/repetition/enum_params.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) )
# include <boost/type_traits/is_class.hpp>
@ -271,4 +278,363 @@ struct trait \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(BOOST_PP_CAT(has_,name), name, false) \
/**/
#if !defined(BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE)
// Create a boolean Metafunction to detect a nested template
// member. This implementation is based on a USENET newsgroup's
// posting by Aleksey Gurtovoy (comp.lang.c++.moderated, 2002-03-19),
// Rani Sharoni's USENET posting cited above, the non-template has_xxx
// implementations above, and discussion on the Boost mailing list.
# if !defined(BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES)
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
# define BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES 1
# endif
# endif
# if !defined(BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION)
# if (defined(BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS))
# define BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION 1
# endif
# endif
# if !defined(BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE)
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
# define BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE 1
# endif
# endif
// NOTE: Many internal implementation macros take a Boost.Preprocessor
// array argument called args which is of the following form.
// ( 4, ( trait, name, max_arity, default_ ) )
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_NAME(args) \
BOOST_PP_CAT(BOOST_PP_ARRAY_ELEM(0, args) , _introspect) \
/**/
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME(args, n) \
BOOST_PP_CAT(BOOST_PP_CAT(BOOST_PP_ARRAY_ELEM(0, args) , _substitute), n) \
/**/
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args) \
BOOST_PP_CAT(BOOST_PP_ARRAY_ELEM(0, args) , _test) \
/**/
// Thanks to Guillaume Melquiond for pointing out the need for the
// "substitute" template as an argument to the overloaded test
// functions to get SFINAE to work for member templates with the
// correct name but different number of arguments.
# define BOOST_MPL_HAS_MEMBER_MULTI_SUBSTITUTE(z, n, args) \
template< \
template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), typename V) > class V \
> \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME(args, n) { \
}; \
/**/
# define BOOST_MPL_HAS_MEMBER_SUBSTITUTE(args, substitute_macro) \
BOOST_PP_REPEAT( \
BOOST_PP_ARRAY_ELEM(2, args) \
, BOOST_MPL_HAS_MEMBER_MULTI_SUBSTITUTE \
, args \
) \
/**/
# if !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
# define BOOST_MPL_HAS_MEMBER_REJECT(args, member_macro) \
template< typename V > \
static boost::mpl::aux::no_tag \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)(...); \
/**/
# else
# define BOOST_MPL_HAS_MEMBER_REJECT(args, member_macro) \
static boost::mpl::aux::no_tag \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)(...); \
/**/
# endif
# if !BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES
# define BOOST_MPL_HAS_MEMBER_MULTI_ACCEPT(z, n, args) \
template< typename V > \
static boost::mpl::aux::yes_tag \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)( \
boost::mpl::aux::type_wrapper< V > const volatile* \
, BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME(args, n) < \
V::template BOOST_PP_ARRAY_ELEM(1, args) \
>* = 0 \
); \
/**/
# define BOOST_MPL_HAS_MEMBER_ACCEPT(args, member_macro) \
BOOST_PP_REPEAT( \
BOOST_PP_ARRAY_ELEM(2, args) \
, BOOST_MPL_HAS_MEMBER_MULTI_ACCEPT \
, args \
) \
/**/
# else
# define BOOST_MPL_HAS_MEMBER_ACCEPT(args, member_macro) \
template< typename V > \
static boost::mpl::aux::yes_tag \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)( \
V const volatile* \
, member_macro(args, V, T)* = 0 \
); \
/**/
# endif
# if !BOOST_MPL_HAS_XXX_NO_EXPLICIT_TEST_FUNCTION
# define BOOST_MPL_HAS_MEMBER_TEST(args) \
sizeof(BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)< U >(0)) \
== sizeof(boost::mpl::aux::yes_tag) \
/**/
# else
# if !BOOST_MPL_HAS_XXX_NO_WRAPPED_TYPES
# define BOOST_MPL_HAS_MEMBER_TEST(args) \
sizeof( \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)( \
static_cast< boost::mpl::aux::type_wrapper< U >* >(0) \
) \
) == sizeof(boost::mpl::aux::yes_tag) \
/**/
# else
# define BOOST_MPL_HAS_MEMBER_TEST(args) \
sizeof( \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)( \
static_cast< U* >(0) \
) \
) == sizeof(boost::mpl::aux::yes_tag) \
/**/
# endif
# endif
# define BOOST_MPL_HAS_MEMBER_INTROSPECT( \
args, substitute_macro, member_macro \
) \
template< typename U > \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_NAME(args) { \
BOOST_MPL_HAS_MEMBER_SUBSTITUTE(args, substitute_macro) \
BOOST_MPL_HAS_MEMBER_REJECT(args, member_macro) \
BOOST_MPL_HAS_MEMBER_ACCEPT(args, member_macro) \
BOOST_STATIC_CONSTANT( \
bool, value = BOOST_MPL_HAS_MEMBER_TEST(args) \
); \
typedef boost::mpl::bool_< value > type; \
}; \
/**/
# define BOOST_MPL_HAS_MEMBER_IMPLEMENTATION( \
args, introspect_macro, substitute_macro, member_macro \
) \
template< \
typename T \
, typename fallback_ \
= boost::mpl::bool_< BOOST_PP_ARRAY_ELEM(3, args) > \
> \
class BOOST_PP_ARRAY_ELEM(0, args) { \
introspect_macro(args, substitute_macro, member_macro) \
public: \
static const bool value \
= BOOST_MPL_HAS_MEMBER_INTROSPECTION_NAME(args)< T >::value; \
typedef typename BOOST_MPL_HAS_MEMBER_INTROSPECTION_NAME(args)< \
T \
>::type type; \
}; \
/**/
// BOOST_MPL_HAS_MEMBER_WITH_FUNCTION_SFINAE expands to the full
// implementation of the function-based metafunction. Compile with -E
// to see the preprocessor output for this macro.
# define BOOST_MPL_HAS_MEMBER_WITH_FUNCTION_SFINAE( \
args, substitute_macro, member_macro \
) \
BOOST_MPL_HAS_MEMBER_IMPLEMENTATION( \
args \
, BOOST_MPL_HAS_MEMBER_INTROSPECT \
, substitute_macro \
, member_macro \
) \
/**/
# if BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE
# if !defined(BOOST_MPL_HAS_XXX_NEEDS_NAMESPACE_LEVEL_SUBSTITUTE)
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
# define BOOST_MPL_HAS_XXX_NEEDS_NAMESPACE_LEVEL_SUBSTITUTE 1
# endif
# endif
# if !BOOST_MPL_HAS_XXX_NEEDS_NAMESPACE_LEVEL_SUBSTITUTE
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME_WITH_TEMPLATE_SFINAE( \
args, n \
) \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME(args, n) \
/**/
# else
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME_WITH_TEMPLATE_SFINAE( \
args, n \
) \
BOOST_PP_CAT( \
boost_mpl_has_xxx_ \
, BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME(args, n) \
) \
/**/
# endif
# define BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_TAG_NAME( \
args \
) \
BOOST_PP_CAT( \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME_WITH_TEMPLATE_SFINAE( \
args, 0 \
) \
, _tag \
) \
/**/
# define BOOST_MPL_HAS_MEMBER_MULTI_SUBSTITUTE_WITH_TEMPLATE_SFINAE( \
z, n, args \
) \
template< \
template< BOOST_PP_ENUM_PARAMS(BOOST_PP_INC(n), typename U) > class U \
> \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME_WITH_TEMPLATE_SFINAE( \
args, n \
) { \
typedef \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_TAG_NAME(args) \
type; \
}; \
/**/
# define BOOST_MPL_HAS_MEMBER_SUBSTITUTE_WITH_TEMPLATE_SFINAE( \
args, substitute_macro \
) \
typedef void \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_TAG_NAME(args); \
BOOST_PP_REPEAT( \
BOOST_PP_ARRAY_ELEM(2, args) \
, BOOST_MPL_HAS_MEMBER_MULTI_SUBSTITUTE_WITH_TEMPLATE_SFINAE \
, args \
) \
/**/
# define BOOST_MPL_HAS_MEMBER_REJECT_WITH_TEMPLATE_SFINAE( \
args, member_macro \
) \
template< \
typename U \
, typename V \
= BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_TAG_NAME(args) \
> \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args) { \
BOOST_STATIC_CONSTANT(bool, value = false); \
typedef boost::mpl::bool_< value > type; \
}; \
/**/
# define BOOST_MPL_HAS_MEMBER_MULTI_ACCEPT_WITH_TEMPLATE_SFINAE( \
z, n, args \
) \
template< typename U > \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)< \
U \
, typename \
BOOST_MPL_HAS_MEMBER_INTROSPECTION_SUBSTITUTE_NAME_WITH_TEMPLATE_SFINAE( \
args, n \
)< \
BOOST_MSVC_TYPENAME U::BOOST_PP_ARRAY_ELEM(1, args)< > \
>::type \
> { \
BOOST_STATIC_CONSTANT(bool, value = true); \
typedef boost::mpl::bool_< value > type; \
}; \
/**/
# define BOOST_MPL_HAS_MEMBER_ACCEPT_WITH_TEMPLATE_SFINAE( \
args, member_macro \
) \
BOOST_PP_REPEAT( \
BOOST_PP_ARRAY_ELEM(2, args) \
, BOOST_MPL_HAS_MEMBER_MULTI_ACCEPT_WITH_TEMPLATE_SFINAE \
, args \
) \
/**/
# define BOOST_MPL_HAS_MEMBER_INTROSPECT_WITH_TEMPLATE_SFINAE( \
args, substitute_macro, member_macro \
) \
BOOST_MPL_HAS_MEMBER_REJECT_WITH_TEMPLATE_SFINAE(args, member_macro) \
BOOST_MPL_HAS_MEMBER_ACCEPT_WITH_TEMPLATE_SFINAE(args, member_macro) \
template< typename U > \
struct BOOST_MPL_HAS_MEMBER_INTROSPECTION_NAME(args) \
: BOOST_MPL_HAS_MEMBER_INTROSPECTION_TEST_NAME(args)< U > { \
}; \
/**/
// BOOST_MPL_HAS_MEMBER_WITH_TEMPLATE_SFINAE expands to the full
// implementation of the template-based metafunction. Compile with -E
// to see the preprocessor output for this macro.
//
// Note that if BOOST_MPL_HAS_XXX_NEEDS_NAMESPACE_LEVEL_SUBSTITUTE is
// defined BOOST_MPL_HAS_MEMBER_SUBSTITUTE_WITH_TEMPLATE_SFINAE needs
// to be expanded at namespace level before
// BOOST_MPL_HAS_MEMBER_WITH_TEMPLATE_SFINAE can be used.
# define BOOST_MPL_HAS_MEMBER_WITH_TEMPLATE_SFINAE( \
args, substitute_macro, member_macro \
) \
BOOST_MPL_HAS_MEMBER_SUBSTITUTE_WITH_TEMPLATE_SFINAE( \
args, substitute_macro \
) \
BOOST_MPL_HAS_MEMBER_IMPLEMENTATION( \
args \
, BOOST_MPL_HAS_MEMBER_INTROSPECT_WITH_TEMPLATE_SFINAE \
, substitute_macro \
, member_macro \
) \
/**/
# endif // BOOST_MPL_HAS_XXX_NEEDS_TEMPLATE_SFINAE
// Note: In the current implementation the parameter and access macros
// are no longer expanded.
# if !BOOST_WORKAROUND(BOOST_MSVC, <= 1400)
# define BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(trait, name, default_) \
BOOST_MPL_HAS_MEMBER_WITH_FUNCTION_SFINAE( \
( 4, ( trait, name, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, default_ ) ) \
, BOOST_MPL_HAS_MEMBER_TEMPLATE_SUBSTITUTE_PARAMETER \
, BOOST_MPL_HAS_MEMBER_TEMPLATE_ACCESS \
) \
/**/
# else
# define BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(trait, name, default_) \
BOOST_MPL_HAS_MEMBER_WITH_TEMPLATE_SFINAE( \
( 4, ( trait, name, BOOST_MPL_LIMIT_METAFUNCTION_ARITY, default_ ) ) \
, BOOST_MPL_HAS_MEMBER_TEMPLATE_SUBSTITUTE_PARAMETER \
, BOOST_MPL_HAS_MEMBER_TEMPLATE_ACCESS \
) \
/**/
# endif
#else // BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE
// placeholder implementation
# define BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF(trait, name, default_) \
template< typename T \
, typename fallback_ = boost::mpl::bool_< default_ > > \
struct trait { \
BOOST_STATIC_CONSTANT(bool, value = fallback_::value); \
typedef fallback_ type; \
}; \
/**/
#endif // BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE
# define BOOST_MPL_HAS_XXX_TEMPLATE_DEF(name) \
BOOST_MPL_HAS_XXX_TEMPLATE_NAMED_DEF( \
BOOST_PP_CAT(has_, name), name, false \
) \
/**/
#endif // BOOST_MPL_HAS_XXX_HPP_INCLUDED

View File

@ -240,6 +240,18 @@ namespace boost { namespace mpl
};
};
template<typename Tag>
struct has_push_back_impl;
template<>
struct has_push_back_impl<mpl::string_tag>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct pop_back_impl;
@ -267,6 +279,18 @@ namespace boost { namespace mpl
#undef M0
};
template<typename Tag>
struct has_pop_back_impl;
template<>
struct has_pop_back_impl<mpl::string_tag>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct push_front_impl;
@ -341,6 +365,18 @@ namespace boost { namespace mpl
};
};
template<typename Tag>
struct has_push_front_impl;
template<>
struct has_push_front_impl<mpl::string_tag>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct pop_front_impl;
@ -375,6 +411,18 @@ namespace boost { namespace mpl
};
};
template<typename Tag>
struct has_pop_front_impl;
template<>
struct has_pop_front_impl<mpl::string_tag>
{
template<typename Sequence>
struct apply
: mpl::true_
{};
};
template<typename Tag>
struct insert_range_impl;

View File

@ -2,7 +2,7 @@
#ifndef BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
#define BOOST_MPL_ZIP_VIEW_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2000-2002
// Copyright Aleksey Gurtovoy 2000-2010
// Copyright David Abrahams 2000-2002
//
// Distributed under the Boost Software License, Version 1.0.
@ -11,9 +11,9 @@
//
// See http://www.boost.org/libs/mpl for documentation.
// $Id: zip_view.hpp 49267 2008-10-11 06:19:02Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $
// $Revision: 49267 $
// $Id: zip_view.hpp 61591 2010-04-26 21:31:09Z agurtovoy $
// $Date: 2010-04-26 17:31:09 -0400 (Mon, 26 Apr 2010) $
// $Revision: 61591 $
#include <boost/mpl/transform.hpp>
#include <boost/mpl/begin_end.hpp>
@ -53,6 +53,7 @@ struct zip_view
public:
typedef nested_begin_end_tag tag;
typedef zip_view type;
typedef zip_iterator<first_ones_> begin;
typedef zip_iterator<last_ones_> end;
};

View File

@ -4,7 +4,7 @@
// 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/lib/optional for documentation.
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com
@ -168,8 +168,10 @@ class optional_base : public optional_tag
typedef BOOST_DEDUCED_TYPENAME is_reference<T>::type is_reference_predicate ;
public:
typedef BOOST_DEDUCED_TYPENAME mpl::if_<is_reference_predicate,types_when_ref,types_when_not_ref>::type types ;
protected:
typedef bool (this_type::*unspecified_bool_type)() const;
typedef BOOST_DEDUCED_TYPENAME types::reference_type reference_type ;

View File

@ -4,7 +4,7 @@
// 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/lib/optional for documentation.
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com

View File

@ -4,7 +4,7 @@
// 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/lib/optional for documentation.
// See http://www.boost.org/libs/optional for documentation.
//
// You are welcome to contact the author at:
// fernando_cacciola@hotmail.com

View File

@ -76,6 +76,49 @@ namespace std{
typedef boost::char_architype char_type;
};
}
//
// Allocator architype:
//
template <class T>
class allocator_architype
{
public:
typedef T* pointer;
typedef const T* const_pointer;
typedef T& reference;
typedef const T& const_reference;
typedef T value_type;
typedef unsigned size_type;
typedef int difference_type;
template <class U>
struct rebind
{
typedef allocator_architype<U> other;
};
pointer address(reference r);
const_pointer address(const_reference r);
pointer allocate(size_type);
pointer allocate(size_type, pointer);
void deallocate(pointer, size_type);
size_type max_size()const;
allocator_architype();
allocator_architype(const allocator_architype&);
template <class Other>
allocator_architype(const allocator_architype<Other>&);
void construct(pointer, const_reference);
void destroy(pointer);
};
template <class T>
bool operator == (const allocator_architype<T>&, const allocator_architype<T>&);
template <class T>
bool operator != (const allocator_architype<T>&, const allocator_architype<T>&);
namespace boost{
//
// regex_traits_architype:
@ -244,7 +287,8 @@ struct BaseRegexConcept
typedef const value_type* pointer_type;
typedef bidirectional_iterator_archetype<value_type> BidiIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
typedef output_iterator_archetype<value_type> OutIterator;
typedef typename regex_traits_computer<Regex>::type traits_type;
typedef global_regex_namespace::regex_iterator<BidiIterator, value_type, traits_type> regex_iterator_type;
@ -318,7 +362,7 @@ struct BaseRegexConcept
const global_regex_namespace::regex_error except(e1);
e1 = except.code();
typedef typename Regex::value_type value_type;
typedef typename Regex::value_type regex_value_type;
function_requires< RegexTraitsConcept<global_regex_namespace::regex_traits<char> > >();
function_requires< BaseRegexConcept<global_regex_namespace::basic_regex<char> > >();
}
@ -484,10 +528,10 @@ struct BaseRegexConcept
typedef typename regex_iterator_type::reference rit_reference;
typedef typename regex_iterator_type::iterator_category rit_iterator_category;
BOOST_STATIC_ASSERT((::boost::is_same<rit_regex_type, Regex>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_value_type, match_results_type>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_value_type, match_results_default_type>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_difference_type, std::ptrdiff_t>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_pointer, const match_results_type*>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_reference, const match_results_type&>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_pointer, const match_results_default_type*>::value));
BOOST_STATIC_ASSERT((::boost::is_same<rit_reference, const match_results_default_type&>::value));
BOOST_STATIC_ASSERT((::boost::is_convertible<rit_iterator_category*, std::forward_iterator_tag*>::value));
// this takes care of most of the checks needed:
function_requires<ForwardIteratorConcept<regex_iterator_type> >();
@ -540,7 +584,10 @@ struct BaseRegexConcept
OutIterator m_out;
BidiIterator m_in;
global_regex_namespace::regex_constants::match_flag_type m_mft;
global_regex_namespace::match_results<pointer_type> m_pmatch;
global_regex_namespace::match_results<
pointer_type,
allocator_architype<global_regex_namespace::sub_match<pointer_type> > >
m_pmatch;
BaseRegexConcept();
BaseRegexConcept(const BaseRegexConcept&);
@ -564,7 +611,7 @@ struct RegexConcept
typedef std::basic_string<value_type> string_type;
typedef boost::bidirectional_iterator_archetype<value_type> BidiIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
typedef output_iterator_archetype<value_type> OutIterator;
@ -739,7 +786,7 @@ struct RegexConcept
OutIterator m_out;
BidiIterator m_in;
global_regex_namespace::regex_constants::match_flag_type m_mft;
global_regex_namespace::match_results<typename string_type::const_iterator> m_smatch;
global_regex_namespace::match_results<typename string_type::const_iterator, allocator_architype<global_regex_namespace::sub_match<typename string_type::const_iterator> > > m_smatch;
RegexConcept();
RegexConcept(const RegexConcept&);
@ -752,7 +799,7 @@ template <class M>
struct functor1
{
typedef typename M::char_type char_type;
const char_type* operator()(const M&)
const char_type* operator()(const M&)const
{
static const char_type c = static_cast<char_type>(0);
return &c;
@ -762,7 +809,7 @@ template <class M>
struct functor1b
{
typedef typename M::char_type char_type;
std::vector<char_type> operator()(const M&)
std::vector<char_type> operator()(const M&)const
{
static const std::vector<char_type> c;
return c;
@ -772,7 +819,7 @@ template <class M>
struct functor2
{
template <class O>
O operator()(const M& /*m*/, O i)
O operator()(const M& /*m*/, O i)const
{
return i;
}
@ -781,7 +828,7 @@ template <class M>
struct functor3
{
template <class O>
O operator()(const M& /*m*/, O i, regex_constants::match_flag_type)
O operator()(const M& /*m*/, O i, regex_constants::match_flag_type)const
{
return i;
}
@ -806,7 +853,8 @@ struct BoostRegexConcept
typedef bidirectional_iterator_archetype<value_type> BidiIterator;
typedef output_iterator_archetype<value_type> OutputIterator;
typedef global_regex_namespace::sub_match<BidiIterator> sub_match_type;
typedef global_regex_namespace::match_results<BidiIterator> match_results_type;
typedef global_regex_namespace::match_results<BidiIterator, allocator_architype<sub_match_type> > match_results_type;
typedef global_regex_namespace::match_results<BidiIterator> match_results_default_type;
void constraints()
{
@ -930,36 +978,90 @@ struct BoostRegexConcept
//
regex_constants::match_flag_type f = regex_constants::match_default;
OutputIterator out = static_object<OutputIterator>::get();
functor3<match_results_type> func3;
out = regex_format(out, m_cresults, func3, f);
out = regex_format(out, m_cresults, func3);
functor2<match_results_type> func2;
out = regex_format(out, m_cresults, func2, f);
out = regex_format(out, m_cresults, func2);
functor1<match_results_type> func1;
out = regex_format(out, m_cresults, func1, f);
out = regex_format(out, m_cresults, func1);
functor3<match_results_default_type> func3;
functor2<match_results_default_type> func2;
functor1<match_results_default_type> func1;
functor3<match_results_type> func3b;
functor2<match_results_type> func2b;
functor1<match_results_type> func1b;
m_string += regex_format(m_cresults, func3, f);
m_string += regex_format(m_cresults, func3);
m_string += regex_format(m_cresults, func2, f);
m_string += regex_format(m_cresults, func2);
m_string += regex_format(m_cresults, func1, f);
m_string += regex_format(m_cresults, func1);
out = regex_format(out, m_cresults, func3b, f);
out = regex_format(out, m_cresults, func3b);
out = regex_format(out, m_cresults, func2b, f);
out = regex_format(out, m_cresults, func2b);
out = regex_format(out, m_cresults, func1b, f);
out = regex_format(out, m_cresults, func1b);
out = regex_format(out, m_cresults, boost::ref(func3b), f);
out = regex_format(out, m_cresults, boost::ref(func3b));
out = regex_format(out, m_cresults, boost::ref(func2b), f);
out = regex_format(out, m_cresults, boost::ref(func2b));
out = regex_format(out, m_cresults, boost::ref(func1b), f);
out = regex_format(out, m_cresults, boost::ref(func1b));
out = regex_format(out, m_cresults, boost::cref(func3b), f);
out = regex_format(out, m_cresults, boost::cref(func3b));
out = regex_format(out, m_cresults, boost::cref(func2b), f);
out = regex_format(out, m_cresults, boost::cref(func2b));
out = regex_format(out, m_cresults, boost::cref(func1b), f);
out = regex_format(out, m_cresults, boost::cref(func1b));
out = m_cresults.format(out, func3, f);
out = m_cresults.format(out, func3);
out = m_cresults.format(out, func2, f);
out = m_cresults.format(out, func2);
out = m_cresults.format(out, func1, f);
out = m_cresults.format(out, func1);
m_string += regex_format(m_cresults, func3b, f);
m_string += regex_format(m_cresults, func3b);
m_string += regex_format(m_cresults, func2b, f);
m_string += regex_format(m_cresults, func2b);
m_string += regex_format(m_cresults, func1b, f);
m_string += regex_format(m_cresults, func1b);
m_string += regex_format(m_cresults, boost::ref(func3b), f);
m_string += regex_format(m_cresults, boost::ref(func3b));
m_string += regex_format(m_cresults, boost::ref(func2b), f);
m_string += regex_format(m_cresults, boost::ref(func2b));
m_string += regex_format(m_cresults, boost::ref(func1b), f);
m_string += regex_format(m_cresults, boost::ref(func1b));
m_string += regex_format(m_cresults, boost::cref(func3b), f);
m_string += regex_format(m_cresults, boost::cref(func3b));
m_string += regex_format(m_cresults, boost::cref(func2b), f);
m_string += regex_format(m_cresults, boost::cref(func2b));
m_string += regex_format(m_cresults, boost::cref(func1b), f);
m_string += regex_format(m_cresults, boost::cref(func1b));
m_string += m_cresults.format(func3, f);
m_string += m_cresults.format(func3);
m_string += m_cresults.format(func2, f);
m_string += m_cresults.format(func2);
m_string += m_cresults.format(func1, f);
m_string += m_cresults.format(func1);
out = m_cresults.format(out, func3b, f);
out = m_cresults.format(out, func3b);
out = m_cresults.format(out, func2b, f);
out = m_cresults.format(out, func2b);
out = m_cresults.format(out, func1b, f);
out = m_cresults.format(out, func1b);
out = m_cresults.format(out, boost::ref(func3b), f);
out = m_cresults.format(out, boost::ref(func3b));
out = m_cresults.format(out, boost::ref(func2b), f);
out = m_cresults.format(out, boost::ref(func2b));
out = m_cresults.format(out, boost::ref(func1b), f);
out = m_cresults.format(out, boost::ref(func1b));
out = m_cresults.format(out, boost::cref(func3b), f);
out = m_cresults.format(out, boost::cref(func3b));
out = m_cresults.format(out, boost::cref(func2b), f);
out = m_cresults.format(out, boost::cref(func2b));
out = m_cresults.format(out, boost::cref(func1b), f);
out = m_cresults.format(out, boost::cref(func1b));
m_string += m_cresults.format(func3b, f);
m_string += m_cresults.format(func3b);
m_string += m_cresults.format(func2b, f);
m_string += m_cresults.format(func2b);
m_string += m_cresults.format(func1b, f);
m_string += m_cresults.format(func1b);
m_string += m_cresults.format(boost::ref(func3b), f);
m_string += m_cresults.format(boost::ref(func3b));
m_string += m_cresults.format(boost::ref(func2b), f);
m_string += m_cresults.format(boost::ref(func2b));
m_string += m_cresults.format(boost::ref(func1b), f);
m_string += m_cresults.format(boost::ref(func1b));
m_string += m_cresults.format(boost::cref(func3b), f);
m_string += m_cresults.format(boost::cref(func3b));
m_string += m_cresults.format(boost::cref(func2b), f);
m_string += m_cresults.format(boost::cref(func2b));
m_string += m_cresults.format(boost::cref(func1b), f);
m_string += m_cresults.format(boost::cref(func1b));
out = regex_replace(out, m_in, m_in, ce, func3, f);
out = regex_replace(out, m_in, m_in, ce, func3);
@ -967,6 +1069,18 @@ struct BoostRegexConcept
out = regex_replace(out, m_in, m_in, ce, func2);
out = regex_replace(out, m_in, m_in, ce, func1, f);
out = regex_replace(out, m_in, m_in, ce, func1);
out = regex_replace(out, m_in, m_in, ce, boost::ref(func3), f);
out = regex_replace(out, m_in, m_in, ce, boost::ref(func3));
out = regex_replace(out, m_in, m_in, ce, boost::ref(func2), f);
out = regex_replace(out, m_in, m_in, ce, boost::ref(func2));
out = regex_replace(out, m_in, m_in, ce, boost::ref(func1), f);
out = regex_replace(out, m_in, m_in, ce, boost::ref(func1));
out = regex_replace(out, m_in, m_in, ce, boost::cref(func3), f);
out = regex_replace(out, m_in, m_in, ce, boost::cref(func3));
out = regex_replace(out, m_in, m_in, ce, boost::cref(func2), f);
out = regex_replace(out, m_in, m_in, ce, boost::cref(func2));
out = regex_replace(out, m_in, m_in, ce, boost::cref(func1), f);
out = regex_replace(out, m_in, m_in, ce, boost::cref(func1));
functor3<match_results<typename string_type::const_iterator> > func3s;
functor2<match_results<typename string_type::const_iterator> > func2s;
@ -977,6 +1091,18 @@ struct BoostRegexConcept
m_string += regex_replace(m_string, ce, func2s);
m_string += regex_replace(m_string, ce, func1s, f);
m_string += regex_replace(m_string, ce, func1s);
m_string += regex_replace(m_string, ce, boost::ref(func3s), f);
m_string += regex_replace(m_string, ce, boost::ref(func3s));
m_string += regex_replace(m_string, ce, boost::ref(func2s), f);
m_string += regex_replace(m_string, ce, boost::ref(func2s));
m_string += regex_replace(m_string, ce, boost::ref(func1s), f);
m_string += regex_replace(m_string, ce, boost::ref(func1s));
m_string += regex_replace(m_string, ce, boost::cref(func3s), f);
m_string += regex_replace(m_string, ce, boost::cref(func3s));
m_string += regex_replace(m_string, ce, boost::cref(func2s), f);
m_string += regex_replace(m_string, ce, boost::cref(func2s));
m_string += regex_replace(m_string, ce, boost::cref(func1s), f);
m_string += regex_replace(m_string, ce, boost::cref(func1s));
}
std::basic_ostream<value_type> m_stream;

View File

@ -186,16 +186,19 @@
*
****************************************************************************/
#if defined(BOOST_HAS_DECLSPEC) && (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
# if defined(BOOST_REGEX_SOURCE)
# define BOOST_REGEX_DECL __declspec(dllexport)
# define BOOST_REGEX_BUILD_DLL
# else
# define BOOST_REGEX_DECL __declspec(dllimport)
# endif
#ifndef BOOST_SYMBOL_EXPORT
# define BOOST_SYMBOL_EXPORT
# define BOOST_SYMBOL_IMPORT
#endif
#ifndef BOOST_REGEX_DECL
#if (defined(BOOST_REGEX_DYN_LINK) || defined(BOOST_ALL_DYN_LINK)) && !defined(BOOST_REGEX_STATIC_LINK)
# if defined(BOOST_REGEX_SOURCE)
# define BOOST_REGEX_DECL BOOST_SYMBOL_EXPORT
# define BOOST_REGEX_BUILD_DLL
# else
# define BOOST_REGEX_DECL BOOST_SYMBOL_IMPORT
# endif
#else
# define BOOST_REGEX_DECL
#endif

View File

@ -27,6 +27,10 @@
#include <boost/mpl/int_fwd.hpp>
#include <bitset>
#ifdef BOOST_MSVC
#pragma warning (push)
#pragma warning (disable: 4251)
#endif
namespace boost{
@ -1015,6 +1019,10 @@ inline U_NAMESPACE_QUALIFIER UnicodeString u32regex_replace(const U_NAMESPACE_QU
} // namespace boost.
#ifdef BOOST_MSVC
#pragma warning (pop)
#endif
#include <boost/regex/v4/u32regex_iterator.hpp>
#include <boost/regex/v4/u32regex_token_iterator.hpp>

View File

@ -769,14 +769,14 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
case syntax_element_assert_backref:
{
// just check that the index is valid:
int id = static_cast<const re_brace*>(state)->index;
if(id < 0)
int idx = static_cast<const re_brace*>(state)->index;
if(idx < 0)
{
id = -id-1;
if(id >= 10000)
idx = -idx-1;
if(idx >= 10000)
{
id = m_pdata->get_id(id);
if(id <= 0)
idx = m_pdata->get_id(idx);
if(idx <= 0)
{
// check of sub-expression that doesn't exist:
if(0 == this->m_pdata->m_status) // update the error code if not already set
@ -804,12 +804,12 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
{
bool ok = false;
re_syntax_base* p = base;
int id = static_cast<re_jump*>(state)->alt.i;
if(id > 10000)
id = m_pdata->get_id(id);
std::ptrdiff_t idx = static_cast<re_jump*>(state)->alt.i;
if(idx > 10000)
idx = m_pdata->get_id(idx);
while(p)
{
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == id))
if((p->type == syntax_element_startmark) && (static_cast<re_brace*>(p)->index == idx))
{
//
// We've found the target of the recursion, set the jump target:
@ -833,7 +833,7 @@ void basic_regex_creator<charT, traits>::fixup_recursions(re_syntax_base* state)
next_rep_id = static_cast<re_repeat*>(p)->state_id;
break;
case syntax_element_endmark:
if(static_cast<const re_brace*>(p)->index == id)
if(static_cast<const re_brace*>(p)->index == idx)
next_rep_id = -1;
break;
default:
@ -1039,6 +1039,14 @@ int basic_regex_creator<charT, traits>::calculate_backstep(re_syntax_base* state
case syntax_element_jump:
state = static_cast<re_jump*>(state)->alt.p;
continue;
case syntax_element_alt:
{
int r1 = calculate_backstep(state->next.p);
int r2 = calculate_backstep(static_cast<re_alt*>(state)->alt.p);
if((r1 < 0) || (r1 != r2))
return -1;
return result + r1;
}
default:
break;
}
@ -1543,3 +1551,4 @@ void basic_regex_creator<charT, traits>::probe_leading_repeat(re_syntax_base* st
#endif
#endif

View File

@ -1906,7 +1906,9 @@ bool basic_regex_parser<charT, traits>::parse_perl_extension()
m_has_case_change = false;
charT name_delim;
int mark_reset = m_mark_reset;
int max_mark = m_max_mark;
m_mark_reset = -1;
m_max_mark = m_mark_count;
int v;
//
// select the actual extension used:
@ -2536,6 +2538,7 @@ option_group_jump:
m_mark_count = m_max_mark;
}
m_mark_reset = mark_reset;
m_max_mark = max_mark;
if(markid > 0)

View File

@ -56,7 +56,7 @@
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4786)
#pragma warning(disable:4786 4251)
#endif
namespace boost{

View File

@ -118,10 +118,14 @@ template class BOOST_REGEX_TEMPLATE_DECL ::boost::re_detail::perl_matcher< std::
#undef BOOST_REGEX_TEMPLATE_DECL
#elif (defined(__GNUC__) && (__GNUC__ >= 3))
#elif (defined(__GNUC__) && (__GNUC__ >= 3)) || !defined(BOOST_NO_EXTERN_TEMPLATE)
# ifndef BOOST_REGEX_INSTANTIATE
# define template __extension__ extern template
# ifdef __GNUC__
# define template __extension__ extern template
# else
# define template extern template
# endif
# endif
#if !defined(BOOST_NO_STD_LOCALE) && !defined(BOOST_REGEX_ICU_INSTANCES)

View File

@ -393,7 +393,6 @@ public:
std::swap(m_subs, that.m_subs);
std::swap(m_named_subs, that.m_named_subs);
std::swap(m_last_closed_paren, that.m_last_closed_paren);
std::swap(m_is_singular, that.m_is_singular);
if(m_is_singular)
{
if(!that.m_is_singular)
@ -412,6 +411,7 @@ public:
std::swap(m_base, that.m_base);
std::swap(m_null, that.m_null);
}
std::swap(m_is_singular, that.m_is_singular);
}
bool operator==(const match_results& that)const
{
@ -457,7 +457,7 @@ public:
void BOOST_REGEX_CALL set_second(BidiIterator i, size_type pos, bool m = true, bool escape_k = false)
{
if(pos)
m_last_closed_paren = pos;
m_last_closed_paren = static_cast<int>(pos);
pos += 2;
BOOST_ASSERT(m_subs.size() > pos);
m_subs[pos].second = i;

View File

@ -336,7 +336,7 @@ struct recursion_info
{
typedef typename Results::value_type value_type;
typedef typename value_type::iterator iterator;
int id;
int idx;
const re_syntax_base* preturn_address;
Results results;
repeater_count<iterator>* repeater_stack;
@ -366,7 +366,7 @@ public:
BidiIterator l_base)
: m_result(what), base(first), last(end),
position(first), backstop(l_base), re(e), traits_inst(e.get_traits()),
m_independent(false), next_count(&rep_obj), rep_obj(&next_count), recursion_stack_position(0)
m_independent(false), next_count(&rep_obj), rep_obj(&next_count)
{
construct_init(e, f);
}
@ -468,9 +468,9 @@ private:
// matching flags in use:
match_flag_type m_match_flags;
// how many states we have examined so far:
boost::uintmax_t state_count;
std::ptrdiff_t state_count;
// max number of states to examine before giving up:
boost::uintmax_t max_state_count;
std::ptrdiff_t max_state_count;
// whether we should ignore case or not:
bool icase;
// set to true when (position == last), indicates that we may have a partial match:
@ -488,8 +488,7 @@ private:
// the bitmask to use when determining whether a match_any matches a newline or not:
unsigned char match_any_mask;
// recursion information:
recursion_info<results_type> recursion_stack[50];
unsigned recursion_stack_position;
std::vector<recursion_info<results_type> > recursion_stack;
#ifdef BOOST_REGEX_NON_RECURSIVE
//
@ -523,7 +522,7 @@ private:
void push_repeater_count(int i, repeater_count<BidiIterator>** s);
void push_single_repeat(std::size_t c, const re_repeat* r, BidiIterator last_position, int state_id);
void push_non_greedy_repeat(const re_syntax_base* ps);
void push_recursion(int id, const re_syntax_base* p, results_type* presults);
void push_recursion(int idx, const re_syntax_base* p, results_type* presults);
void push_recursion_pop();
// pointer to base of stack:

View File

@ -98,23 +98,23 @@ void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(std
//
// Calculate NS^2 first:
//
static const boost::uintmax_t k = 100000;
boost::uintmax_t dist = boost::re_detail::distance(base, last);
static const std::ptrdiff_t k = 100000;
std::ptrdiff_t dist = boost::re_detail::distance(base, last);
if(dist == 0)
dist = 1;
boost::uintmax_t states = re.size();
std::ptrdiff_t states = re.size();
if(states == 0)
states = 1;
states *= states;
if((std::numeric_limits<boost::uintmax_t>::max)() / dist < states)
if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states)
{
max_state_count = (std::numeric_limits<boost::uintmax_t>::max)() - 2;
max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2);
return;
}
states *= dist;
if((std::numeric_limits<boost::uintmax_t>::max)() - k < states)
if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states)
{
max_state_count = (std::numeric_limits<boost::uintmax_t>::max)() - 2;
max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2);
return;
}
states += k;
@ -125,15 +125,15 @@ void perl_matcher<BidiIterator, Allocator, traits>::estimate_max_state_count(std
// Now calculate N^2:
//
states = dist;
if((std::numeric_limits<boost::uintmax_t>::max)() / dist < states)
if((std::numeric_limits<std::ptrdiff_t>::max)() / dist < states)
{
max_state_count = (std::numeric_limits<boost::uintmax_t>::max)() - 2;
max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2);
return;
}
states *= dist;
if((std::numeric_limits<boost::uintmax_t>::max)() - k < states)
if((std::numeric_limits<std::ptrdiff_t>::max)() - k < states)
{
max_state_count = (std::numeric_limits<boost::uintmax_t>::max)() - 2;
max_state_count = (std::min)((std::ptrdiff_t)BOOST_REGEX_MAX_STATE_COUNT, (std::numeric_limits<std::ptrdiff_t>::max)() - 2);
return;
}
states += k;
@ -732,10 +732,10 @@ inline bool perl_matcher<BidiIterator, Allocator, traits>::match_assert_backref(
{
// Have we recursed into subexpression "index"?
// If index == 0 then check for any recursion at all, otherwise for recursion to -index-1.
int id = -index-1;
if(id >= 10000)
id = re.get_data().get_id(id);
result = recursion_stack_position && ((recursion_stack[recursion_stack_position-1].id == id) || (index == 0));
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));
pstate = pstate->next.p;
}
return result;

View File

@ -130,8 +130,8 @@ struct saved_single_repeat : public saved_state
template <class Results>
struct saved_recursion : public saved_state
{
saved_recursion(int id, const re_syntax_base* p, Results* pr)
: saved_state(14), recursion_id(id), preturn_address(p), results(*pr)
saved_recursion(int idx, const re_syntax_base* p, Results* pr)
: saved_state(14), recursion_id(idx), preturn_address(p), results(*pr)
{}
int recursion_id;
const re_syntax_base* preturn_address;
@ -329,7 +329,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_single_repeat(st
}
template <class BidiIterator, class Allocator, class traits>
inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int id, const re_syntax_base* p, results_type* presults)
inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int idx, const re_syntax_base* p, results_type* presults)
{
saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
--pmp;
@ -339,7 +339,7 @@ inline void perl_matcher<BidiIterator, Allocator, traits>::push_recursion(int id
pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
--pmp;
}
(void) new (pmp)saved_recursion<results_type>(id, p, presults);
(void) new (pmp)saved_recursion<results_type>(idx, p, presults);
m_backup_state = pmp;
}
@ -898,20 +898,19 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
//
// Set new call stack:
//
if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0])))
if(recursion_stack.capacity() == 0)
{
return false;
recursion_stack.reserve(50);
}
recursion_stack[recursion_stack_position].preturn_address = pstate->next.p;
recursion_stack[recursion_stack_position].results = *m_presult;
recursion_stack.push_back(recursion_info<results_type>());
recursion_stack.back().preturn_address = pstate->next.p;
recursion_stack.back().results = *m_presult;
if(static_cast<const re_recurse*>(pstate)->state_id > 0)
{
push_repeater_count(static_cast<const re_recurse*>(pstate)->state_id, &next_count);
}
pstate = static_cast<const re_jump*>(pstate)->alt.p;
recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index;
++recursion_stack_position;
//BOOST_ASSERT(recursion_stack[recursion_stack_position-1].id);
recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
return true;
}
@ -927,14 +926,14 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
{
m_presult->set_second(position, index);
}
if(recursion_stack_position)
if(!recursion_stack.empty())
{
if(index == recursion_stack[recursion_stack_position-1].id)
if(index == recursion_stack.back().idx)
{
--recursion_stack_position;
pstate = recursion_stack[recursion_stack_position].preturn_address;
*m_presult = recursion_stack[recursion_stack_position].results;
push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results);
pstate = recursion_stack.back().preturn_address;
*m_presult = recursion_stack.back().results;
push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
recursion_stack.pop_back();
}
}
}
@ -951,13 +950,13 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
{
if(recursion_stack_position)
if(!recursion_stack.empty())
{
BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id);
--recursion_stack_position;
pstate = recursion_stack[recursion_stack_position].preturn_address;
*m_presult = recursion_stack[recursion_stack_position].results;
push_recursion(recursion_stack[recursion_stack_position].id, recursion_stack[recursion_stack_position].preturn_address, &recursion_stack[recursion_stack_position].results);
BOOST_ASSERT(0 == recursion_stack.back().idx);
pstate = recursion_stack.back().preturn_address;
*m_presult = recursion_stack.back().results;
push_recursion(recursion_stack.back().idx, recursion_stack.back().preturn_address, &recursion_stack.back().results);
recursion_stack.pop_back();
return true;
}
if((m_match_flags & match_not_null) && (position == (*m_presult)[0].first))
@ -1523,10 +1522,10 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion(bool r)
saved_recursion<results_type>* pmp = static_cast<saved_recursion<results_type>*>(m_backup_state);
if(!r)
{
recursion_stack[recursion_stack_position].id = pmp->recursion_id;
recursion_stack[recursion_stack_position].preturn_address = pmp->preturn_address;
recursion_stack[recursion_stack_position].results = pmp->results;
++recursion_stack_position;
recursion_stack.push_back(recursion_info<results_type>());
recursion_stack.back().idx = pmp->recursion_id;
recursion_stack.back().preturn_address = pmp->preturn_address;
recursion_stack.back().results = pmp->results;
}
boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp;
@ -1539,7 +1538,7 @@ bool perl_matcher<BidiIterator, Allocator, traits>::unwind_recursion_pop(bool r)
saved_state* pmp = static_cast<saved_state*>(m_backup_state);
if(!r)
{
--recursion_stack_position;
recursion_stack.pop_back();
}
boost::re_detail::inplace_destroy(pmp++);
m_backup_state = pmp;

View File

@ -857,16 +857,16 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
//
// Set new call stack:
//
if(recursion_stack_position >= static_cast<int>(sizeof(recursion_stack)/sizeof(recursion_stack[0])))
if(recursion_stack.capacity() == 0)
{
return false;
recursion_stack.reserve(50);
}
recursion_stack[recursion_stack_position].preturn_address = pstate->next.p;
recursion_stack[recursion_stack_position].results = *m_presult;
recursion_stack[recursion_stack_position].repeater_stack = next_count;
recursion_stack.push_back(recursion_info<results_type>());
recursion_stack.back().preturn_address = pstate->next.p;
recursion_stack.back().results = *m_presult;
recursion_stack.back().repeater_stack = next_count;
pstate = static_cast<const re_jump*>(pstate)->alt.p;
recursion_stack[recursion_stack_position].id = static_cast<const re_brace*>(pstate)->index;
++recursion_stack_position;
recursion_stack.back().idx = static_cast<const re_brace*>(pstate)->index;
repeater_count<BidiIterator>* saved = next_count;
repeater_count<BidiIterator> r(&next_count); // resets all repeat counts since we're recursing and starting fresh on those
@ -876,9 +876,9 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_recursion()
if(!result)
{
--recursion_stack_position;
next_count = recursion_stack[recursion_stack_position].repeater_stack;
*m_presult = recursion_stack[recursion_stack_position].results;
next_count = recursion_stack.back().repeater_stack;
*m_presult = recursion_stack.back().results;
recursion_stack.pop_back();
return false;
}
return true;
@ -895,20 +895,19 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
{
m_presult->set_second(position, index);
}
if(recursion_stack_position)
if(!recursion_stack.empty())
{
if(index == recursion_stack[recursion_stack_position-1].id)
if(index == recursion_stack.back().idx)
{
--recursion_stack_position;
recursion_info<results_type> saved = recursion_stack[recursion_stack_position];
recursion_info<results_type> saved = recursion_stack.back();
recursion_stack.pop_back();
const re_syntax_base* saved_state = pstate = saved.preturn_address;
repeater_count<BidiIterator>* saved_count = next_count;
next_count = saved.repeater_stack;
*m_presult = saved.results;
if(!match_all_states())
{
recursion_stack[recursion_stack_position] = saved;
++recursion_stack_position;
recursion_stack.push_back(saved);
next_count = saved_count;
return false;
}
@ -928,17 +927,17 @@ bool perl_matcher<BidiIterator, Allocator, traits>::match_endmark()
template <class BidiIterator, class Allocator, class traits>
bool perl_matcher<BidiIterator, Allocator, traits>::match_match()
{
if(recursion_stack_position)
if(!recursion_stack.empty())
{
BOOST_ASSERT(0 == recursion_stack[recursion_stack_position-1].id);
--recursion_stack_position;
const re_syntax_base* saved_state = pstate = recursion_stack[recursion_stack_position].preturn_address;
*m_presult = recursion_stack[recursion_stack_position].results;
BOOST_ASSERT(0 == recursion_stack.back().idx);
const re_syntax_base* saved_state = pstate = recursion_stack.back().preturn_address;
*m_presult = recursion_stack.back().results;
recursion_stack.pop_back();
if(!match_all_states())
{
recursion_stack[recursion_stack_position].preturn_address = saved_state;
recursion_stack[recursion_stack_position].results = *m_presult;
++recursion_stack_position;
recursion_stack.push_back(recursion_info<results_type>());
recursion_stack.back().preturn_address = saved_state;
recursion_stack.back().results = *m_presult;
return false;
}
return true;

View File

@ -34,6 +34,7 @@
#ifndef BOOST_NO_SFINAE
#include <boost/mpl/has_xxx.hpp>
#endif
#include <boost/ref.hpp>
namespace boost{
@ -334,7 +335,7 @@ void basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::format
m_position = --base;
}
}
put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]);
put((this->m_results)[this->m_results.size() > 1 ? static_cast<int>(this->m_results.size() - 1) : 1]);
break;
case '{':
have_brace = true;
@ -384,7 +385,7 @@ bool basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::handle
if(have_brace && (*m_position == '^'))
++m_position;
int max_len = m_end - m_position;
std::ptrdiff_t max_len = m_end - m_position;
if((max_len >= 5) && std::equal(m_position, m_position + 5, MATCH))
{
@ -447,7 +448,7 @@ bool basic_regex_formatter<OutputIterator, Results, traits, ForwardIter>::handle
return false;
}
}
put((this->m_results)[this->m_results.size() > 1 ? this->m_results.size() - 1 : 1]);
put((this->m_results)[this->m_results.size() > 1 ? static_cast<int>(this->m_results.size() - 1) : 1]);
return true;
}
if((max_len >= 20) && std::equal(m_position, m_position + 20, LAST_SUBMATCH_RESULT))
@ -895,7 +896,7 @@ private:
// F must be a pointer, a function, or a class with a function call operator:
//
BOOST_STATIC_ASSERT((::boost::is_pointer<F>::value || ::boost::is_function<F>::value || ::boost::is_class<F>::value));
static formatter_wrapper<F> f;
static formatter_wrapper<typename unwrap_reference<F>::type> f;
static M m;
static O out;
static boost::regex_constants::match_flag_type flags;
@ -963,7 +964,7 @@ struct format_functor3
template <class OutputIter>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f)
{
return func(m, i, f);
return boost::unwrap_ref(func)(m, i, f);
}
template <class OutputIter, class Traits>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&)
@ -983,7 +984,7 @@ struct format_functor2
template <class OutputIter>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/)
{
return func(m, i);
return boost::unwrap_ref(func)(m, i);
}
template <class OutputIter, class Traits>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&)
@ -1020,7 +1021,7 @@ struct format_functor1
template <class OutputIter>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type /*f*/)
{
return do_format_string(func(m), i);
return do_format_string(boost::unwrap_ref(func)(m), i);
}
template <class OutputIter, class Traits>
OutputIter operator()(const Match& m, OutputIter i, boost::regex_constants::match_flag_type f, const Traits&)

View File

@ -149,7 +149,37 @@ namespace boost{ namespace re_detail{
{
return stdext::unchecked_equal(first, last, with);
}
#elif BOOST_WORKAROUND(BOOST_MSVC, > 1500)
//
// MSVC 10 will either emit warnings or else refuse to compile
// code that makes perfectly legitimate use of std::copy, when
// the OutputIterator type is a user-defined class (apparently all user
// defined iterators are "unsafe"). What's more Microsoft have removed their
// non-standard "unchecked" versions, even though their still in the MS
// documentation!! Work around this as best we can:
//
template<class InputIterator, class OutputIterator>
inline OutputIterator copy(
InputIterator first,
InputIterator last,
OutputIterator dest
)
{
while(first != last)
*dest++ = *first++;
return dest;
}
template<class InputIterator1, class InputIterator2>
inline bool equal(
InputIterator1 first,
InputIterator1 last,
InputIterator2 with
)
{
while(first != last)
if(*first++ != *with++) return false;
return true;
}
#else
using std::copy;
using std::equal;

View File

@ -292,7 +292,7 @@ template <class charT, class Traits, class Alloc>
inline u32regex_token_iterator<typename std::basic_string<charT, Traits, Alloc>::const_iterator> make_u32regex_token_iterator(const std::basic_string<charT, Traits, Alloc>& p, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default)
{
typedef typename std::basic_string<charT, Traits, Alloc>::const_iterator iter_type;
return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, m);
return u32regex_token_iterator<iter_type>(p.begin(), p.end(), e, submatch, m);
}
inline u32regex_token_iterator<const UChar*> make_u32regex_token_iterator(const U_NAMESPACE_QUALIFIER UnicodeString& s, const u32regex& e, int submatch = 0, regex_constants::match_flag_type m = regex_constants::match_default)
{

View File

@ -25,7 +25,7 @@
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ <= 0x620 )
#if !defined( BOOST_SP_NO_SP_CONVERTIBLE ) && defined( __BORLANDC__ ) && ( __BORLANDC__ < 0x630 )
# define BOOST_SP_NO_SP_CONVERTIBLE
#endif
@ -45,7 +45,7 @@ template< class Y, class T > struct sp_convertible
static yes f( T* );
static no f( ... );
enum _vt { value = sizeof( f( static_cast<Y*>(0) ) ) == sizeof(yes) };
enum _vt { value = sizeof( (f)( static_cast<Y*>(0) ) ) == sizeof(yes) };
};
struct sp_empty

View File

@ -55,7 +55,7 @@ namespace detail
{
#if !defined( BOOST_USE_WINDOWS_H )
extern "C" void __stdcall Sleep( unsigned ms );
extern "C" void __stdcall Sleep( unsigned long ms );
#endif
inline void yield( unsigned k )

View File

@ -87,10 +87,12 @@ public:
};
#if defined( BOOST_HAS_RVALUE_REFS )
template< class T > T&& forward( T &&t )
template< class T > T&& sp_forward( T & t )
{
return t;
return static_cast< T&& >( t );
}
#endif
} // namespace detail
@ -101,9 +103,9 @@ template< class T > T&& forward( T &&t )
template< class T > boost::shared_ptr< T > make_shared()
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -118,9 +120,9 @@ template< class T > boost::shared_ptr< T > make_shared()
template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -137,15 +139,15 @@ template< class T, class A > boost::shared_ptr< T > allocate_shared( A const & a
// Variadic templates, rvalue reference
template< class T, class... Args > boost::shared_ptr< T > make_shared( Args && ... args )
template< class T, class Arg1, class... Args > boost::shared_ptr< T > make_shared( Arg1 && arg1, Args && ... args )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T( detail::forward<Args>( args )... );
::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ), boost::detail::sp_forward<Args>( args )... );
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
@ -154,15 +156,15 @@ template< class T, class... Args > boost::shared_ptr< T > make_shared( Args && .
return boost::shared_ptr< T >( pt, pt2 );
}
template< class T, class A, class... Args > boost::shared_ptr< T > allocate_shared( A const & a, Args && ... args )
template< class T, class A, class Arg1, class... Args > boost::shared_ptr< T > allocate_shared( A const & a, Arg1 && arg1, Args && ... args )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
::new( pv ) T( detail::forward<Args>( args )... );
::new( pv ) T( boost::detail::sp_forward<Arg1>( arg1 ), boost::detail::sp_forward<Args>( args )... );
pd->set_initialized();
T * pt2 = static_cast< T* >( pv );
@ -178,9 +180,9 @@ template< class T, class A, class... Args > boost::shared_ptr< T > allocate_shar
template< class T, class A1 >
boost::shared_ptr< T > make_shared( A1 const & a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -196,9 +198,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1 )
template< class T, class A, class A1 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -214,9 +216,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1 )
template< class T, class A1, class A2 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -232,9 +234,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2 )
template< class T, class A, class A1, class A2 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -250,9 +252,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -268,9 +270,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3
template< class T, class A, class A1, class A2, class A3 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -286,9 +288,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -304,9 +306,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -322,9 +324,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -340,9 +342,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -358,9 +360,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -376,9 +378,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -394,9 +396,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -412,9 +414,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -430,9 +432,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -448,9 +450,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -466,9 +468,9 @@ boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a
template< class T, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >() );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >() );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();
@ -484,9 +486,9 @@ boost::shared_ptr< T > make_shared( A1 const & a1, A2 const & a2, A3 const & a3,
template< class T, class A, class A1, class A2, class A3, class A4, class A5, class A6, class A7, class A8, class A9 >
boost::shared_ptr< T > allocate_shared( A const & a, A1 const & a1, A2 const & a2, A3 const & a3, A4 const & a4, A5 const & a5, A6 const & a6, A7 const & a7, A8 const & a8, A9 const & a9 )
{
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), detail::sp_ms_deleter< T >(), a );
boost::shared_ptr< T > pt( static_cast< T* >( 0 ), boost::detail::sp_ms_deleter< T >(), a );
detail::sp_ms_deleter< T > * pd = boost::get_deleter< detail::sp_ms_deleter< T > >( pt );
boost::detail::sp_ms_deleter< T > * pd = boost::get_deleter< boost::detail::sp_ms_deleter< T > >( pt );
void * pv = pd->address();

View File

@ -36,17 +36,13 @@
#if !defined( BOOST_EXCEPTION_DISABLE )
# include <boost/exception/exception.hpp>
# include <boost/current_function.hpp>
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
::boost::throw_file(__FILE__) <<\
::boost::throw_line(__LINE__))
# define BOOST_THROW_EXCEPTION(x) ::boost::exception_detail::throw_exception_(x,BOOST_CURRENT_FUNCTION,__FILE__,__LINE__)
#else
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
#endif
namespace boost
{
#ifdef BOOST_NO_EXCEPTIONS
void throw_exception( std::exception const & e ); // user defined
@ -70,6 +66,26 @@ template<class E> BOOST_ATTRIBUTE_NORETURN inline void throw_exception( E const
#endif
#if !defined( BOOST_EXCEPTION_DISABLE )
namespace
exception_detail
{
template <class E>
BOOST_ATTRIBUTE_NORETURN
void
throw_exception_( E const & x, char const * current_function, char const * file, int line )
{
boost::throw_exception(
set_info(
set_info(
set_info(
enable_error_info(x),
throw_function(current_function)),
throw_file(file)),
throw_line(line)));
}
}
#endif
} // namespace boost
#endif // #ifndef BOOST_THROW_EXCEPTION_HPP_INCLUDED

View File

@ -40,6 +40,9 @@
#include <boost/assert.hpp>
#include <boost/detail/workaround.hpp>
#include <boost/mpl/if.hpp>
#if !defined(BOOST_NO_CWCTYPE)
#include <cwctype>
#endif
//
// the following must not be macros if we are to prefix them
@ -48,9 +51,15 @@
#ifdef ispunct
# undef ispunct
#endif
#ifdef iswpunct
# undef iswpunct
#endif
#ifdef isspace
# undef isspace
#endif
#ifdef iswspace
# undef iswspace
#endif
//
// fix namespace problems:
//
@ -58,11 +67,14 @@
namespace std{
using ::ispunct;
using ::isspace;
#if !defined(BOOST_NO_CWCTYPE)
using ::iswpunct;
using ::iswspace;
#endif
}
#endif
namespace boost{
//===========================================================================
// The escaped_list_separator class. Which is a model of TokenizerFunction
// An escaped list is a super-set of what is commonly known as a comma
@ -76,17 +88,12 @@ namespace boost{
struct escaped_list_error : public std::runtime_error{
escaped_list_error(const std::string& what_arg):std::runtime_error(what_arg) { }
};
// The out of the box GCC 2.95 on cygwin does not have a char_traits class.
// MSVC does not like the following typename
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
template <class Char,
class Traits = typename std::basic_string<Char>::traits_type >
#else
template <class Char,
class Traits = std::basic_string<Char>::traits_type >
#endif
template <class Char,
class Traits = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type >
class escaped_list_separator {
private:
@ -100,7 +107,7 @@ namespace boost{
};
string_type escape_;
string_type c_;
string_type quote_;
string_type quote_;
bool last_;
bool is_escape(Char e) {
@ -140,21 +147,21 @@ namespace boost{
}
public:
explicit escaped_list_separator(Char e = '\\',
Char c = ',',Char q = '\"')
: escape_(1,e), c_(1,c), quote_(1,q), last_(false) { }
escaped_list_separator(string_type e, string_type c, string_type q)
: escape_(e), c_(c), quote_(q), last_(false) { }
void reset() {last_=false;}
template <typename InputIterator, typename Token>
bool operator()(InputIterator& next,InputIterator end,Token& tok) {
bool bInQuote = false;
tok = Token();
if (next == end) {
if (last_) {
last_ = false;
@ -193,8 +200,44 @@ namespace boost{
//===========================================================================
// The classes here are used by offset_separator and char_separator to implement
// faster assigning of tokens using assign instead of +=
namespace tokenizer_detail {
//===========================================================================
// Tokenizer was broken for wide character separators, at least on Windows, since
// CRT functions isspace etc only expect values in [0, 0xFF]. Debug build asserts
// if higher values are passed in. The traits extension class should take care of this.
// Assuming that the conditional will always get optimized out in the function
// implementations, argument types are not a problem since both forms of character classifiers
// expect an int.
// In case there is no cwctype header, we implement the checks manually.
// We make use of the fact that the tested categories should fit in ASCII.
template<typename traits>
struct traits_extension : public traits {
typedef typename traits::char_type char_type;
static bool isspace(char_type c)
{
#if !defined(BOOST_NO_CWCTYPE)
if (sizeof(char_type) == 1)
return std::isspace(c) != 0;
else
return std::iswspace(c) != 0;
#else
return static_cast< unsigned >(c) <= 255 && std::isspace(c) != 0;
#endif
}
static bool ispunct(char_type c)
{
#if !defined(BOOST_NO_CWCTYPE)
if (sizeof(char_type) == 1)
return std::ispunct(c) != 0;
else
return std::iswpunct(c) != 0;
#else
return static_cast< unsigned >(c) <= 255 && std::ispunct(c) != 0;
#endif
}
};
// The assign_or_plus_equal struct contains functions that implement
// assign, +=, and clearing based on the iterator type. The
@ -229,26 +272,20 @@ namespace boost{
}
template<class Token, class Value>
static void plus_equal(Token &, const Value &) {
}
template<class Token, class Value>
static void plus_equal(Token &, const Value &) { }
// If we are doing an assign, there is no need for the
// the clear.
// the clear.
//
template<class Token>
static void clear(Token &) {
}
static void clear(Token &) { }
};
template <>
struct assign_or_plus_equal<std::input_iterator_tag> {
template<class Iterator, class Token>
static void assign(Iterator b, Iterator e, Token &t) {
}
static void assign(Iterator b, Iterator e, Token &t) { }
template<class Token, class Value>
static void plus_equal(Token &t, const Value &v) {
t += v;
@ -284,10 +321,10 @@ namespace boost{
typedef typename cat::type iterator_category;
};
}
} // namespace tokenizer_detail
//===========================================================================
// The offset_separator class, which is a model of TokenizerFunction.
// Offset breaks a string into tokens based on a range of offsets
@ -299,7 +336,7 @@ namespace boost{
unsigned int current_offset_;
bool wrap_offsets_;
bool return_partial_last_;
public:
template <typename Iter>
offset_separator(Iter begin, Iter end, bool wrap_offsets = true,
@ -307,7 +344,7 @@ namespace boost{
: offsets_(begin,end), current_offset_(0),
wrap_offsets_(wrap_offsets),
return_partial_last_(return_partial_last) { }
offset_separator()
: offsets_(1,1), current_offset_(),
wrap_offsets_(true), return_partial_last_(true) { }
@ -320,18 +357,16 @@ namespace boost{
bool operator()(InputIterator& next, InputIterator end, Token& tok)
{
typedef tokenizer_detail::assign_or_plus_equal<
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
typename
#endif
tokenizer_detail::get_iterator_category<
InputIterator>::iterator_category> assigner;
BOOST_DEDUCED_TYPENAME tokenizer_detail::get_iterator_category<
InputIterator
>::iterator_category
> assigner;
BOOST_ASSERT(!offsets_.empty());
assigner::clear(tok);
InputIterator start(next);
if (next == end)
return false;
@ -342,7 +377,7 @@ namespace boost{
else
return false;
}
int c = offsets_[current_offset_];
int i = 0;
for (; i < c; ++i) {
@ -350,11 +385,11 @@ namespace boost{
assigner::plus_equal(tok,*next++);
}
assigner::assign(start,next,tok);
if (!return_partial_last_)
if (i < (c-1) )
return false;
++current_offset_;
return true;
}
@ -378,15 +413,11 @@ namespace boost{
enum empty_token_policy { drop_empty_tokens, keep_empty_tokens };
// The out of the box GCC 2.95 on cygwin does not have a char_traits class.
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
template <typename Char,
typename Traits = typename std::basic_string<Char>::traits_type >
#else
template <typename Char,
typename Traits = std::basic_string<Char>::traits_type >
#endif
template <typename Char,
typename Tr = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type >
class char_separator
{
typedef tokenizer_detail::traits_extension<Tr> Traits;
typedef std::basic_string<Char,Traits> string_type;
public:
explicit
@ -407,8 +438,8 @@ namespace boost{
// use ispunct() for kept delimiters and isspace for dropped.
explicit
char_separator()
: m_use_ispunct(true),
m_use_isspace(true),
: m_use_ispunct(true),
m_use_isspace(true),
m_empty_tokens(drop_empty_tokens) { }
void reset() { }
@ -417,11 +448,10 @@ namespace boost{
bool operator()(InputIterator& next, InputIterator end, Token& tok)
{
typedef tokenizer_detail::assign_or_plus_equal<
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
typename
#endif
tokenizer_detail::get_iterator_category<
InputIterator>::iterator_category> assigner;
BOOST_DEDUCED_TYPENAME tokenizer_detail::get_iterator_category<
InputIterator
>::iterator_category
> assigner;
assigner::clear(tok);
@ -429,7 +459,7 @@ namespace boost{
if (m_empty_tokens == drop_empty_tokens)
for (; next != end && is_dropped(*next); ++next)
{ }
InputIterator start(next);
if (m_empty_tokens == drop_empty_tokens) {
@ -446,13 +476,13 @@ namespace boost{
// append all the non delim characters
for (; next != end && !is_dropped(*next) && !is_kept(*next); ++next)
assigner::plus_equal(tok,*next);
}
}
else { // m_empty_tokens == keep_empty_tokens
// Handle empty token at the end
if (next == end)
{
if (m_output_done == false)
if (m_output_done == false)
{
m_output_done = true;
assigner::assign(start,next,tok);
@ -461,7 +491,7 @@ namespace boost{
else
return false;
}
if (is_kept(*next)) {
if (m_output_done == false)
m_output_done = true;
@ -493,13 +523,13 @@ namespace boost{
bool m_use_isspace;
empty_token_policy m_empty_tokens;
bool m_output_done;
bool is_kept(Char E) const
{
{
if (m_kept_delims.length())
return m_kept_delims.find(E) != string_type::npos;
else if (m_use_ispunct) {
return std::ispunct(E) != 0;
return Traits::ispunct(E) != 0;
} else
return false;
}
@ -508,7 +538,7 @@ namespace boost{
if (m_dropped_delims.length())
return m_dropped_delims.find(E) != string_type::npos;
else if (m_use_isspace) {
return std::isspace(E) != 0;
return Traits::isspace(E) != 0;
} else
return false;
}
@ -525,31 +555,27 @@ namespace boost{
// cannot be returned as tokens. These are often whitespace
// The out of the box GCC 2.95 on cygwin does not have a char_traits class.
#if !defined(BOOST_MSVC) || BOOST_MSVC > 1300
template <class Char,
class Traits = typename std::basic_string<Char>::traits_type >
#else
template <class Char,
class Traits = std::basic_string<Char>::traits_type >
#endif
template <class Char,
class Tr = BOOST_DEDUCED_TYPENAME std::basic_string<Char>::traits_type >
class char_delimiters_separator {
private:
private:
typedef tokenizer_detail::traits_extension<Tr> Traits;
typedef std::basic_string<Char,Traits> string_type;
string_type returnable_;
string_type nonreturnable_;
bool return_delims_;
bool no_ispunct_;
bool no_isspace_;
bool is_ret(Char E)const
{
{
if (returnable_.length())
return returnable_.find(E) != string_type::npos;
else{
if (no_ispunct_) {return false;}
else{
int r = std::ispunct(E);
int r = Traits::ispunct(E);
return r != 0;
}
}
@ -561,12 +587,12 @@ namespace boost{
else{
if (no_isspace_) {return false;}
else{
int r = std::isspace(E);
int r = Traits::isspace(E);
return r != 0;
}
}
}
public:
explicit char_delimiters_separator(bool return_delims = false,
const Char* returnable = 0,
@ -575,7 +601,7 @@ namespace boost{
nonreturnable_(nonreturnable ? nonreturnable:string_type().c_str()),
return_delims_(return_delims), no_ispunct_(returnable!=0),
no_isspace_(nonreturnable!=0) { }
void reset() { }
public:
@ -583,16 +609,16 @@ namespace boost{
template <typename InputIterator, typename Token>
bool operator()(InputIterator& next, InputIterator end,Token& tok) {
tok = Token();
// skip past all nonreturnable delims
// skip past the returnable only if we are not returning delims
for (;next!=end && ( is_nonret(*next) || (is_ret(*next)
&& !return_delims_ ) );++next) { }
if (next == end) {
return false;
}
// if we are to return delims and we are one a returnable one
// move past it and stop
if (is_ret(*next) && return_delims_) {
@ -603,8 +629,8 @@ namespace boost{
// append all the non delim characters
for (;next!=end && !is_nonret(*next) && !is_ret(*next);++next)
tok+=*next;
return true;
}
};
@ -612,10 +638,4 @@ namespace boost{
} //namespace boost
#endif
#endif

View File

@ -16,6 +16,9 @@
#include "boost/type_traits/add_reference.hpp"
#include "boost/type_traits/add_volatile.hpp"
#include "boost/type_traits/alignment_of.hpp"
#if !defined(__BORLANDC__) && !defined(__CUDACC__)
#include "boost/type_traits/has_new_operator.hpp"
#endif
#include "boost/type_traits/has_nothrow_assign.hpp"
#include "boost/type_traits/has_nothrow_constructor.hpp"
#include "boost/type_traits/has_nothrow_copy.hpp"
@ -51,11 +54,14 @@
#include "boost/type_traits/is_polymorphic.hpp"
#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_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_void.hpp"
#include "boost/type_traits/is_virtual_base_of.hpp"
#include "boost/type_traits/is_volatile.hpp"
#include "boost/type_traits/rank.hpp"
#include "boost/type_traits/extent.hpp"

View File

@ -51,11 +51,29 @@ struct add_reference_impl
};
#else
//
// We can't filter out rvalue_references at the same level as
// references or we get ambiguities from msvc:
//
template <typename T>
struct add_reference_rvalue_layer
{
typedef T& type;
};
#ifndef BOOST_NO_RVALUE_REFERENCES
template <typename T>
struct add_reference_rvalue_layer<T&&>
{
typedef T&& type;
};
#endif
template <typename T>
struct add_reference_impl
{
typedef T& type;
typedef typename add_reference_rvalue_layer<T>::type type;
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

View File

@ -166,7 +166,7 @@ struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
template<typename Function>
struct function_traits :
public detail::function_traits_helper<typename boost::add_pointer<Function>::type>
public boost::detail::function_traits_helper<typename boost::add_pointer<Function>::type>
{
};
@ -227,7 +227,7 @@ type_of_size<11> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8,
template<typename Function>
struct function_traits
{
BOOST_STATIC_CONSTANT(unsigned, arity = (sizeof(detail::function_arity_helper((Function*)0))-1));
BOOST_STATIC_CONSTANT(unsigned, arity = (sizeof(boost::detail::function_arity_helper((Function*)0))-1));
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION

View File

@ -25,7 +25,7 @@ struct is_convertible_from_tester
}
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible<T, detail::is_convertible_from_tester>::value))
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_complex,T,(::boost::is_convertible<T, boost::detail::is_convertible_from_tester>::value))
} // namespace boost

View File

@ -50,12 +50,31 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//* is a type T declared const - is_const<T>
namespace detail{
//
// We can't filter out rvalue_references at the same level as
// references or we get ambiguities from msvc:
//
template <class T>
struct is_const_rvalue_filter
{
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::cv_traits_imp<typename remove_bounds<T>::type*>::is_const)
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_const);
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::cv_traits_imp<T*>::is_const)
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_const);
#endif
};
#ifndef BOOST_NO_RVALUE_REFERENCES
template <class T>
struct is_const_rvalue_filter<T&&>
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
#endif
}
//* is a type T declared const - is_const<T>
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,::boost::detail::is_const_rvalue_filter<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
@ -98,7 +117,7 @@ struct is_const_helper<false,false>
{
static T* t;
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_const_tester(t))
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_const_tester(t))
));
};
};
@ -110,7 +129,7 @@ struct is_const_helper<false,true>
{
static T t;
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_const_tester(&t))
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_const_tester(&t))
));
};
};

View File

@ -132,7 +132,7 @@ template <typename From, typename To>
struct is_convertible_basic_impl
{
static From _m_from;
static bool const value = sizeof( detail::checker<To>::_m_check(_m_from, 0) )
static bool const value = sizeof( boost::detail::checker<To>::_m_check(_m_from, 0) )
== sizeof(::boost::type_traits::yes_type);
};

View File

@ -36,6 +36,12 @@ namespace boost {
namespace detail {
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
#ifdef BOOST_MSVC
#pragma warning(push)
#pragma warning(disable:4624) // destructor could not be generated
#endif
template <typename T>
struct empty_helper_t1 : public T
{
@ -47,6 +53,10 @@ private:
empty_helper_t1& operator=(const empty_helper_t1&);
};
#ifdef BOOST_MSVC
#pragma warning(pop)
#endif
struct empty_helper_t2 { int i[256]; };
#if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)

View File

@ -95,6 +95,9 @@ struct is_function_impl<T&> : public false_type
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T))
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value)
#ifndef BOOST_NO_RVALUE_REFERENCES
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_function,T&&,false)
#endif
#endif
} // namespace boost

View File

@ -0,0 +1,118 @@
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Howard Hinnant and John Maddock 2000.
// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// 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.
// Fixed is_pointer, is_lvalue_reference, is_const, is_volatile, is_same,
// is_member_pointer based on the Simulated Partial Specialization work
// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
// http://groups.yahoo.com/group/boost/message/5441
// Some workarounds in here use ideas suggested from "Generic<Programming>:
// Mappings between Types and Values"
// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
#ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/type_traits/detail/yes_no_type.hpp>
# include <boost/type_traits/detail/wrap.hpp>
#endif
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true)
#endif
#if defined(__GNUC__) && (__GNUC__ < 3)
// these allow us to work around illegally cv-qualified reference
// types.
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const ,::boost::is_lvalue_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T volatile ,::boost::is_lvalue_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const volatile ,::boost::is_lvalue_reference<T>::value)
// However, the above specializations confuse gcc 2.96 unless we also
// supply these specializations for array types
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,volatile T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const volatile T[N],false)
#endif
#else
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4181 4097)
#endif
namespace detail {
using ::boost::type_traits::yes_type;
using ::boost::type_traits::no_type;
using ::boost::type_traits::wrap;
template <class T> T&(* is_lvalue_reference_helper1(wrap<T>) )(wrap<T>);
char is_lvalue_reference_helper1(...);
template <class T> no_type is_lvalue_reference_helper2(T&(*)(wrap<T>));
yes_type is_lvalue_reference_helper2(...);
template <typename T>
struct is_lvalue_reference_impl
{
BOOST_STATIC_CONSTANT(
bool, value = sizeof(
::boost::detail::is_lvalue_reference_helper2(
::boost::detail::is_lvalue_reference_helper1(::boost::type_traits::wrap<T>()))) == 1
);
};
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const volatile,false)
#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,::boost::detail::is_lvalue_reference_impl<T>::value)
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED

Some files were not shown because too many files have changed in this diff Show More