Commit 5eaa391d authored by jean-pierre charras's avatar jean-pierre charras

updated boost library, to 1_44_0

parent 6f009e8f
boost version: 1_43_0
boost version: 1_44_0
......@@ -5,8 +5,9 @@
# define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concept {
namespace boost { namespace concepts {
template <class ModelFnPtr>
struct require;
......@@ -21,7 +22,7 @@ struct require<void(*)(Model)>
enum \
{ \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \
boost::concept::require<ModelFnPtr>::instantiate \
boost::concepts::require<ModelFnPtr>::instantiate \
}
}} // namespace boost::concept
......
......@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp>
......@@ -13,7 +14,7 @@
// This implementation works on Comeau and GCC, all the way back to
// 2.95
namespace boost { namespace concept {
namespace boost { namespace concepts {
template <class ModelFn>
struct requirement_;
......@@ -29,6 +30,14 @@ struct requirement
static void failed() { ((Model*)0)->~Model(); }
};
struct failed {};
template <class Model>
struct requirement<failed ************ Model::************>
{
static void failed() { ((Model*)0)->~Model(); }
};
# ifdef BOOST_OLD_CONCEPT_SUPPORT
template <class Model>
......@@ -40,9 +49,9 @@ struct constraint
template <class Model>
struct requirement_<void(*)(Model)>
: mpl::if_<
concept::not_satisfied<Model>
concepts::not_satisfied<Model>
, constraint<Model>
, requirement<Model>
, requirement<failed ************ Model::************>
>::type
{};
......@@ -51,14 +60,14 @@ struct requirement_<void(*)(Model)>
// For GCC-2.x, these can't have exactly the same name
template <class Model>
struct requirement_<void(*)(Model)>
: requirement<Model>
: requirement<failed ************ Model::************>
{};
# endif
# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
typedef ::boost::concept::detail::instantiate< \
&::boost::concept::requirement_<ModelFnPtr>::failed> \
typedef ::boost::concepts::detail::instantiate< \
&::boost::concepts::requirement_<ModelFnPtr>::failed> \
BOOST_PP_CAT(boost_concept_check,__LINE__)
}}
......
......@@ -6,7 +6,9 @@
# include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp>
namespace boost { namespace concept {
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concepts {
namespace detail
{
......@@ -43,6 +45,6 @@ struct not_satisfied
typedef mpl::bool_<value> type;
};
}} // namespace boost::concept::detail
}} // namespace boost::concepts::detail
#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
......@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp>
......@@ -12,7 +13,8 @@
# endif
namespace boost { namespace concept {
namespace boost { namespace concepts {
template <class Model>
struct check
......@@ -22,7 +24,19 @@ struct check
x->~Model();
}
};
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
struct failed {};
template <class Model>
struct check<failed ************ Model::************>
{
virtual void failed(Model* x)
{
x->~Model();
}
};
# endif
# ifdef BOOST_OLD_CONCEPT_SUPPORT
namespace detail
......@@ -38,7 +52,11 @@ struct require
: mpl::if_c<
not_satisfied<Model>::value
, detail::constraint
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
, check<Model>
# else
, check<failed ************ Model::************>
# endif
>::type
{};
......@@ -46,7 +64,11 @@ struct require
template <class Model>
struct require
: check<Model>
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
: check<Model>
# else
: check<failed ************ Model::************>
# endif
{};
# endif
......@@ -70,7 +92,7 @@ struct require<void(*)(Model)>
enum \
{ \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require<ModelFnPtr>) \
sizeof(::boost::concepts::require<ModelFnPtr>) \
}
# else // Not vc-7.1
......@@ -83,7 +105,7 @@ require_(void(*)(Model));
enum \
{ \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require_((ModelFnPtr)0)) \
sizeof(::boost::concepts::require_((ModelFnPtr)0)) \
}
# endif
......
......@@ -6,8 +6,9 @@
# include <boost/concept/assert.hpp>
# include <boost/detail/workaround.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concept {
namespace boost { namespace concepts {
# if BOOST_WORKAROUND(__GNUC__, == 2)
......@@ -25,19 +26,19 @@ struct usage_requirements
# define BOOST_CONCEPT_USAGE(model) \
model(); /* at least 2.96 and 3.4.3 both need this :( */ \
BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements<model>)); \
BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
~model()
# else
# define BOOST_CONCEPT_USAGE(model) \
BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements<model>)); \
BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
~model()
# endif
# endif
}} // namespace boost::concept
}} // namespace boost::concepts
#endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP
......@@ -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
......@@ -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
......@@ -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__)
......
......@@ -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:
......
......@@ -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
......
......@@ -51,7 +51,7 @@
// check for exception handling support:
#ifndef _CPPUNWIND
#if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS
#endif
......
......@@ -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,20 +108,45 @@
#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_NULLPTR
#define BOOST_NO_TEMPLATE_ALIASES
......
......@@ -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__
......@@ -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)
......
......@@ -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
......
......@@ -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
......
......@@ -66,6 +66,7 @@
#define BOOST_NO_0X_HDR_TYPE_TRAITS
#define BOOST_NO_0X_HDR_TUPLE
#define BOOST_NO_0X_HDR_THREAD
#define BOOST_NO_0X_HDR_TYPEINDEX
#define BOOST_NO_0X_HDR_SYSTEM_ERROR
#define BOOST_NO_0X_HDR_REGEX
#define BOOST_NO_0X_HDR_RATIO
......
......@@ -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
......
......@@ -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:
//
......
......@@ -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
......@@ -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:
//
......
......@@ -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
......
......@@ -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
......
......@@ -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
......@@ -49,6 +50,10 @@
// 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"
......
......@@ -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
......
......@@ -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
......
......@@ -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 ---
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
// ---------------------------------------------------------------------------//
......
// 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__) \
......
......@@ -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
......
......@@ -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 >
{
......
......@@ -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
......
......@@ -31,8 +31,9 @@
// Some compilers let us detect even const-qualified rvalues at compile-time
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_) \
|| (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL)) \
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL))
|| (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL) && !defined(BOOST_CLANG)) \
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \
!defined(BOOST_CLANG))
# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION
#else
// Some compilers allow temporaries to be bound to non-const references.
......@@ -41,7 +42,7 @@
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__, < 0x593) \
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, BOOST_TESTED_AT(0x570)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, < 0x5100) \
|| BOOST_WORKAROUND(__DECCXX_VER, <= 60590042)
# define BOOST_FOREACH_NO_RVALUE_DETECTION
# endif
......@@ -56,6 +57,7 @@
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, >= 0x5100) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590))
# define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION
# else
......@@ -80,6 +82,7 @@
#include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/utility/addressof.hpp>
#include <boost/foreach_fwd.hpp>
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
# include <new>
......@@ -88,12 +91,6 @@
# include <boost/type_traits/remove_const.hpp>
#endif
// This must be at global scope, hence the uglified name
enum boost_foreach_argument_dependent_lookup_hack
{
boost_foreach_argument_dependent_lookup_hack_value
};
namespace boost
{
......@@ -116,11 +113,6 @@ namespace foreach
return std::make_pair(begin, end);
}
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::tag
//
typedef boost_foreach_argument_dependent_lookup_hack tag;
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::is_lightweight_proxy
// Specialize this for user-defined collection types if they are inexpensive to copy.
......@@ -705,7 +697,7 @@ end(auto_any_t col, type2type<T, const_> *, bool *)
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template<typename T, typename C>
inline auto_any<int>
end(auto_any_t col, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings
end(auto_any_t, type2type<T *, C> *, boost::mpl::true_ *) // null-terminated C-style strings
{
return 0; // not used
}
......
......@@ -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>
......
......@@ -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
......
......@@ -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
......@@ -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
......@@ -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>
......
This diff is collapsed.
......@@ -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;
......
......@@ -27,7 +27,6 @@
namespace boost
{
namespace range_detail
{
template< class Iter, class Pred, bool default_pass >
......@@ -140,10 +139,14 @@ namespace boost
public:
adjacent_filter_range( const P& p, R& r )
: base_range( skip_iter( boost::begin(r), boost::end(r), p),
skip_iter( boost::end(r), boost::end(r), p) )
: base_range(skip_iter(boost::begin(r), boost::end(r), p),
skip_iter(boost::end(r), boost::end(r), p))
{
}
private:
P m_pred;
R* m_range;
};
template< class T >
......
......@@ -25,9 +25,9 @@ namespace boost
template< class Map >
struct select_first
{
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type&
result_type;
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type&
result_type;
result_type operator()( const pair_t& r ) const
{
......@@ -38,8 +38,8 @@ namespace boost
template< class Map >
struct select_second_mutable
{
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type;
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type;
result_type operator()( pair_t& r ) const
{
......@@ -50,16 +50,16 @@ namespace boost
template< class Map >
struct select_second_const
{
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type&
result_type;
typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type&
result_type;
result_type operator()( const pair_t& r ) const
{
return r.second;
}
};
template<class StdPairRng>
class select_first_range
: public transform_range<
......@@ -78,7 +78,7 @@ namespace boost
select_first_range(const base& other) : base(other) {}
};
template<class StdPairRng>
class select_second_mutable_range
: public transform_range<
......@@ -97,7 +97,7 @@ namespace boost
select_second_mutable_range(const base& other) : base(other) {}
};
template<class StdPairRng>
class select_second_const_range
: public transform_range<
......@@ -116,20 +116,20 @@ namespace boost
select_second_const_range(const base& other) : base(other) {}
};
template< class StdPairRng >
inline select_first_range<StdPairRng>
inline select_first_range<StdPairRng>
operator|( const StdPairRng& r, map_keys_forwarder )
{
return operator|( r,
return operator|( r,
boost::adaptors::transformed( select_first<StdPairRng>() ) );
}
template< class StdPairRng >
inline select_second_mutable_range<StdPairRng>
inline select_second_mutable_range<StdPairRng>
operator|( StdPairRng& r, map_values_forwarder )
{
return operator|( r,
return operator|( r,
boost::adaptors::transformed( select_second_mutable<StdPairRng>() ) );
}
......@@ -137,27 +137,27 @@ namespace boost
inline select_second_const_range<StdPairRng>
operator|( const StdPairRng& r, map_values_forwarder )
{
return operator|( r,
boost::adaptors::transformed( select_second_const<StdPairRng>() ) );
return operator|( r,
boost::adaptors::transformed( select_second_const<StdPairRng>() ) );
}
} // 'range_detail'
using range_detail::select_first_range;
using range_detail::select_second_mutable_range;
using range_detail::select_second_const_range;
namespace adaptors
{
{
namespace
{
const range_detail::map_keys_forwarder map_keys =
const range_detail::map_keys_forwarder map_keys =
range_detail::map_keys_forwarder();
const range_detail::map_values_forwarder map_values =
const range_detail::map_values_forwarder map_values =
range_detail::map_values_forwarder();
}
template<class StdPairRange>
inline select_first_range<StdPairRange>
keys(const StdPairRange& rng)
......@@ -165,7 +165,7 @@ namespace boost
return select_first_range<StdPairRange>(
range_detail::select_first<StdPairRange>(), rng );
}
template<class StdPairRange>
inline select_second_const_range<StdPairRange>
values(const StdPairRange& rng)
......@@ -173,7 +173,7 @@ namespace boost
return select_second_const_range<StdPairRange>(
range_detail::select_second_const<StdPairRange>(), rng );
}
template<class StdPairRange>
inline select_second_mutable_range<StdPairRange>
values(StdPairRange& rng)
......@@ -182,7 +182,7 @@ namespace boost
range_detail::select_second_mutable<StdPairRange>(), rng );
}
} // 'adaptors'
}
#endif
......@@ -47,7 +47,7 @@ namespace boost
};
template< class R >
class replace_range :
class replaced_range :
public boost::iterator_range<
boost::transform_iterator<
replace_value< BOOST_DEDUCED_TYPENAME range_value<R>::type >,
......@@ -64,7 +64,7 @@ namespace boost
public:
typedef BOOST_DEDUCED_TYPENAME range_value<R>::type value_type;
replace_range( R& r, value_type from, value_type to )
replaced_range( R& r, value_type from, value_type to )
: base_t( make_transform_iterator( boost::begin(r), Fn(from, to) ),
make_transform_iterator( boost::end(r), Fn(from, to) ) )
{ }
......@@ -83,23 +83,23 @@ namespace boost
};
template< class InputRng >
inline replace_range<InputRng>
inline replaced_range<InputRng>
operator|( InputRng& r,
const replace_holder<BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f )
{
return replace_range<InputRng>(r, f.val1, f.val2);
return replaced_range<InputRng>(r, f.val1, f.val2);
}
template< class InputRng >
inline replace_range<const InputRng>
inline replaced_range<const InputRng>
operator|( const InputRng& r,
const replace_holder<BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f )
{
return replace_range<const InputRng>(r, f.val1, f.val2);
return replaced_range<const InputRng>(r, f.val1, f.val2);
}
} // 'range_detail'
using range_detail::replace_range;
using range_detail::replaced_range;
namespace adaptors
{
......@@ -111,21 +111,21 @@ namespace boost
}
template<class InputRange>
inline replace_range<InputRange>
inline replaced_range<InputRange>
replace(InputRange& rng,
BOOST_DEDUCED_TYPENAME range_value<InputRange>::type from,
BOOST_DEDUCED_TYPENAME range_value<InputRange>::type to)
{
return replace_range<InputRange>(rng, from, to);
return replaced_range<InputRange>(rng, from, to);
}
template<class InputRange>
inline replace_range<const InputRange>
inline replaced_range<const InputRange>
replace(const InputRange& rng,
BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type from,
BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type to)
{
return replace_range<const InputRange>(rng, from ,to);
return replaced_range<const InputRange>(rng, from ,to);
}
} // 'adaptors'
......
......@@ -28,14 +28,26 @@ namespace boost
};
template< class RandomAccessRange >
inline iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type >
class sliced_range : public boost::iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type >
{
typedef boost::iterator_range< BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type > base_t;
public:
template<typename Rng, typename T, typename U>
sliced_range(Rng& rng, T t, U u)
: base_t(boost::make_iterator_range(rng, t, u - boost::size(rng)))
{
}
};
template< class RandomAccessRange >
inline sliced_range<RandomAccessRange>
slice( RandomAccessRange& rng, std::size_t t, std::size_t u )
{
BOOST_ASSERT( t <= u && "error in slice indices" );
BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u &&
"second slice index out of bounds" );
return boost::make_iterator_range( rng, t, u - boost::size(rng) );
return sliced_range<RandomAccessRange>(rng, t, u);
}
template< class RandomAccessRange >
......@@ -46,23 +58,21 @@ namespace boost
BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u &&
"second slice index out of bounds" );
return boost::make_iterator_range( rng, t, u - boost::size(rng) );
return sliced_range<const RandomAccessRange>(rng, t, u);
}
template< class RandomAccessRange >
inline iterator_range<
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type >
inline sliced_range<RandomAccessRange>
operator|( RandomAccessRange& r, const sliced& f )
{
return adaptors::slice( r, f.t, f.u );
return sliced_range<RandomAccessRange>( r, f.t, f.u );
}
template< class RandomAccessRange >
inline iterator_range<
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type >
inline sliced_range<const RandomAccessRange>
operator|( const RandomAccessRange& r, const sliced& f )
{
return adaptors::slice( r, f.t, f.u );
return sliced_range<const RandomAccessRange>( r, f.t, f.u );
}
} // namespace adaptors
......
......@@ -30,7 +30,7 @@ namespace boost
template< class SinglePassRange, class OutputIterator >
inline OutputIterator copy(const SinglePassRange& rng, OutputIterator out)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::copy(boost::begin(rng),boost::end(rng),out);
}
......
......@@ -32,7 +32,7 @@ inline BidirectionalTraversalWriteableIterator
copy_backward(const BidirectionalRange& rng,
BidirectionalTraversalWriteableIterator out)
{
BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
return std::copy_backward(boost::begin(rng), boost::end(rng), out);
}
......
......@@ -159,8 +159,8 @@ namespace boost
template< class SinglePassRange1, class SinglePassRange2 >
inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
return ::boost::range_detail::equal(
::boost::begin(rng1), ::boost::end(rng1),
......@@ -172,8 +172,8 @@ namespace boost
inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2,
BinaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
return ::boost::range_detail::equal(
::boost::begin(rng1), ::boost::end(rng1),
......
......@@ -33,6 +33,15 @@ inline ForwardRange& fill(ForwardRange& rng, const Value& val)
return rng;
}
/// \overload
template< class ForwardRange, class Value >
inline const ForwardRange& fill(const ForwardRange& rng, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
std::fill(boost::begin(rng), boost::end(rng), val);
return rng;
}
} // namespace range
using range::fill;
}
......
......@@ -36,6 +36,16 @@ inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
return rng;
}
/// \overload
template< class ForwardRange, class Size, class Value >
inline const ForwardRange& fill_n(const ForwardRange& rng, Size n, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
BOOST_ASSERT( static_cast<Size>(std::distance(boost::begin(rng), boost::end(rng))) >= n );
std::fill_n(boost::begin(rng), n, val);
return rng;
}
} // namespace range
using range::fill_n;
} // namespace boost
......
......@@ -27,18 +27,33 @@ namespace boost
///
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
template< class SinglePassRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange>,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type
>::type
find( SinglePassRange& rng, const Value& val )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::find(boost::begin(rng), boost::end(rng), val);
}
/// \overload
template< class SinglePassRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type
find( const SinglePassRange& rng, const Value& val )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::find(boost::begin(rng), boost::end(rng), val);
}
// range_return overloads
/// \overload
template< range_return_value re, class SinglePassRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<SinglePassRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange>,
BOOST_DEDUCED_TYPENAME range_return<SinglePassRange,re>::type
>::type
find( SinglePassRange& rng, const Value& val )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
......@@ -47,6 +62,17 @@ find( SinglePassRange& rng, const Value& val )
rng);
}
/// \overload
template< range_return_value re, class SinglePassRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<const SinglePassRange,re>::type
find( const SinglePassRange& rng, const Value& val )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return range_return<const SinglePassRange,re>::
pack(std::find(boost::begin(rng), boost::end(rng), val),
rng);
}
} // namespace range
using range::find;
}
......
......@@ -29,7 +29,10 @@ namespace boost
/// \pre ForwardRange2 is a model of the ForwardRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template< class ForwardRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_iterator< ForwardRange1 >::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange1>,
BOOST_DEDUCED_TYPENAME range_iterator< ForwardRange1 >::type
>::type
find_end(ForwardRange1 & rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
......@@ -39,9 +42,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2)
boost::begin(rng2),boost::end(rng2));
}
/// \overload
template< class ForwardRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_iterator< const ForwardRange1 >::type
find_end(const ForwardRange1 & rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return std::find_end(boost::begin(rng1),boost::end(rng1),
boost::begin(rng2),boost::end(rng2));
}
/// \overload
template< class ForwardRange1, class ForwardRange2, class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange1>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange1>,
BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange1>::type
>::type
find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
......@@ -51,9 +69,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred)
boost::begin(rng2),boost::end(rng2),pred);
}
/// \overload
template< class ForwardRange1, class ForwardRange2, class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange1>::type
find_end(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return std::find_end(boost::begin(rng1),boost::end(rng1),
boost::begin(rng2),boost::end(rng2),pred);
}
/// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange1>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
>::type
find_end(ForwardRange1& rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
......@@ -65,10 +98,27 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2)
rng1);
}
/// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange1,re>::type
find_end(const ForwardRange1& rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return range_return<const ForwardRange1,re>::
pack(std::find_end(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2)),
rng1);
}
/// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2,
class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange1>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange1,re>::type
>::type
find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
......@@ -80,6 +130,21 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
rng1);
}
/// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2,
class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange1,re>::type
find_end(const ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return range_return<const ForwardRange1,re>::
pack(std::find_end(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2), pred),
rng1);
}
} // namespace range
using range::find_end;
} // namespace boost
......
......@@ -29,7 +29,10 @@ namespace boost
/// \pre ForwardRange2 is a model of the ForwardRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template< class SinglePassRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange1>,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type
>::type
find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
......@@ -39,9 +42,24 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2)
boost::begin(rng2),boost::end(rng2));
}
/// \overload
template< class SinglePassRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type
find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return std::find_first_of(boost::begin(rng1),boost::end(rng1),
boost::begin(rng2),boost::end(rng2));
}
/// \overload
template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange1>,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type
>::type
find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
......@@ -51,10 +69,25 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredica
boost::begin(rng2),boost::end(rng2),pred);
}
/// \overload
template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type
find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return std::find_first_of(boost::begin(rng1),boost::end(rng1),
boost::begin(rng2),boost::end(rng2),pred);
}
// range return overloads
/// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_return<SinglePassRange1,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange1>,
BOOST_DEDUCED_TYPENAME range_return<SinglePassRange1,re>::type
>::type
find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
......@@ -66,10 +99,27 @@ find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2)
rng1);
}
/// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2 >
inline BOOST_DEDUCED_TYPENAME range_return<const SinglePassRange1,re>::type
find_first_of(const SinglePassRange1& rng1, const ForwardRange2& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return range_return<const SinglePassRange1,re>::
pack(std::find_first_of(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2)),
rng1);
}
/// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2,
class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<SinglePassRange1,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange1>,
BOOST_DEDUCED_TYPENAME range_return<SinglePassRange1,re>::type
>::type
find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2,
BinaryPredicate pred)
{
......@@ -82,6 +132,22 @@ find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2,
rng1);
}
/// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2,
class BinaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const SinglePassRange1,re>::type
find_first_of(const SinglePassRange1 & rng1, const ForwardRange2& rng2,
BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange2> ));
return range_return<const SinglePassRange1,re>::
pack(std::find_first_of(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2), pred),
rng1);
}
} // namespace range
using range::find_first_of;
} // namespace boost
......
......@@ -28,18 +28,33 @@ namespace boost
/// \pre SinglePassRange is a model of the SinglePassRangeConcept
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept
template< class SinglePassRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange>,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange>::type
>::type
find_if( SinglePassRange& rng, UnaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::find_if(boost::begin(rng), boost::end(rng), pred);
}
/// \overload
template< class SinglePassRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange>::type
find_if( const SinglePassRange& rng, UnaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::find_if(boost::begin(rng), boost::end(rng), pred);
}
// range_return overloads
/// \overload
template< range_return_value re, class SinglePassRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<SinglePassRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<SinglePassRange>,
BOOST_DEDUCED_TYPENAME range_return<SinglePassRange,re>::type
>::type
find_if( SinglePassRange& rng, UnaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
......@@ -48,6 +63,17 @@ find_if( SinglePassRange& rng, UnaryPredicate pred )
rng);
}
/// \overload
template< range_return_value re, class SinglePassRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const SinglePassRange,re>::type
find_if( const SinglePassRange& rng, UnaryPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return range_return<const SinglePassRange,re>::
pack(std::find_if(boost::begin(rng), boost::end(rng), pred),
rng);
}
} // namespace range
using range::find_if;
} // namespace boost
......
......@@ -33,6 +33,15 @@ inline ForwardRange& generate( ForwardRange& rng, Generator gen )
return rng;
}
/// \overload
template< class ForwardRange, class Generator >
inline const ForwardRange& generate( const ForwardRange& rng, Generator gen )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
std::generate(boost::begin(rng), boost::end(rng), gen);
return rng;
}
} // namespace range
using range::generate;
} // namespace boost
......
......@@ -34,6 +34,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& push_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred)
......@@ -43,6 +52,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred)
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline const RandomAccessRange& push_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::push_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function pop_heap
///
/// range-based version of the pop_heap std algorithm
......@@ -57,6 +75,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& pop_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred)
......@@ -66,6 +93,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred)
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline const RandomAccessRange& pop_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::pop_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function make_heap
///
/// range-based version of the make_heap std algorithm
......@@ -80,6 +116,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& make_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred)
......@@ -89,6 +134,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred)
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline const RandomAccessRange& make_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::make_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
/// \brief template function sort_heap
///
/// range-based version of the sort_heap std algorithm
......@@ -103,6 +157,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& sort_heap(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred)
......@@ -112,6 +175,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred)
return rng;
}
/// \overload
template<class RandomAccessRange, class Compare>
inline const RandomAccessRange& sort_heap(const RandomAccessRange& rng, Compare comp_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort_heap(boost::begin(rng), boost::end(rng), comp_pred);
return rng;
}
} // namespace range
using range::push_heap;
using range::pop_heap;
......
......@@ -27,23 +27,52 @@ namespace boost
///
/// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
>::type
lower_bound( ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val);
}
/// \overload
template< class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
lower_bound( const ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val);
}
/// \overload
template< class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
>::type
lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred);
}
/// \overload
template< class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
lower_bound( const ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
>::type
lower_bound( ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
......@@ -51,9 +80,24 @@ lower_bound( ForwardRange& rng, Value val )
pack(std::lower_bound(boost::begin(rng), boost::end(rng), val),
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
lower_bound( const ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::
pack(std::lower_bound(boost::begin(rng), boost::end(rng), val),
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
>::type
lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
......@@ -62,6 +106,17 @@ lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
lower_bound( const ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::
pack(std::lower_bound(boost::begin(rng), boost::end(rng), val, pred),
rng);
}
} // namespace range
using range::lower_bound;
} // namespace boost
......
......@@ -35,6 +35,16 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& partial_sort(const RandomAccessRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type middle)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::partial_sort(boost::begin(rng), middle, boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
......@@ -47,6 +57,18 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline const RandomAccessRange& partial_sort(const RandomAccessRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type middle,
BinaryPredicate sort_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::partial_sort(boost::begin(rng), middle, boost::end(rng),
sort_pred);
return rng;
}
} // namespace range
using range::partial_sort;
} // namespace boost
......
......@@ -32,7 +32,18 @@ template<class SinglePassRange, class RandomAccessRange>
inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2));
}
/// \overload
template<class SinglePassRange, class RandomAccessRange>
inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2));
......@@ -45,7 +56,20 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2,
BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2), pred);
}
/// \overload
template<class SinglePassRange, class RandomAccessRange,
class BinaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, const RandomAccessRange& rng2,
BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2), pred);
......
......@@ -34,6 +34,15 @@ partition(ForwardRange& rng, UnaryPredicate pred)
return std::partition(boost::begin(rng),boost::end(rng),pred);
}
/// \overload
template<class ForwardRange, class UnaryPredicate>
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
partition(const ForwardRange& rng, UnaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::partition(boost::begin(rng),boost::end(rng),pred);
}
// range_return overloads
/// \overload
......@@ -47,6 +56,17 @@ partition(ForwardRange& rng, UnaryPredicate pred)
pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng);
}
/// \overload
template< range_return_value re, class ForwardRange,
class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
partition(const ForwardRange& rng, UnaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return boost::range_return<const ForwardRange,re>::
pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng);
}
} // namespace range
using range::partition;
} // namespace boost
......
......@@ -34,6 +34,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class Generator>
inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen)
......@@ -43,6 +52,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen)
return rng;
}
/// \overload
template<class RandomAccessRange, class Generator>
inline const RandomAccessRange& random_shuffle(const RandomAccessRange& rng, Generator& gen)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::random_shuffle(boost::begin(rng), boost::end(rng), gen);
return rng;
}
} // namespace range
using range::random_shuffle;
} // namespace boost
......
......@@ -34,6 +34,15 @@ remove(ForwardRange& rng, const Value& val)
return std::remove(boost::begin(rng),boost::end(rng),val);
}
/// \overload
template< class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
remove(const ForwardRange& rng, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::remove(boost::begin(rng),boost::end(rng),val);
}
// range_return overloads
/// \overload
......@@ -47,6 +56,17 @@ remove(ForwardRange& rng, const Value& val)
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
remove(const ForwardRange& rng, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::pack(
std::remove(boost::begin(rng), boost::end(rng), val),
rng);
}
} // namespace range
using range::remove;
} // namespace boost
......
......@@ -31,9 +31,9 @@ namespace boost
/// InputIterator's value type.
template< class SinglePassRange, class OutputIterator, class Value >
inline OutputIterator
remove_copy(SinglePassRange& rng, OutputIterator out_it, const Value& val)
remove_copy(const SinglePassRange& rng, OutputIterator out_it, const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::remove_copy(boost::begin(rng), boost::end(rng), out_it, val);
}
......
......@@ -28,10 +28,10 @@ namespace boost
/// \pre out_it is not an iterator in the range rng
template< class SinglePassRange, class OutputIterator, class Predicate >
inline OutputIterator
remove_copy_if(SinglePassRange& rng, OutputIterator out_it, Predicate pred)
remove_copy_if(const SinglePassRange& rng, OutputIterator out_it, Predicate pred)
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred);
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred);
}
}
......
......@@ -35,6 +35,15 @@ remove_if(ForwardRange& rng, UnaryPredicate pred)
return std::remove_if(boost::begin(rng), boost::end(rng), pred);
}
/// \overload
template< class ForwardRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME boost::range_iterator<const ForwardRange>::type
remove_if(const ForwardRange& rng, UnaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::remove_if(boost::begin(rng), boost::end(rng), pred);
}
// range_return overloads
/// \overload
......@@ -48,6 +57,17 @@ remove_if(ForwardRange& rng, UnaryPredicate pred)
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class UnaryPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
remove_if(const ForwardRange& rng, UnaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::pack(
std::remove_if(boost::begin(rng), boost::end(rng), pred),
rng);
}
} // namespace range
using range::remove_if;
} // namespace boost
......
......@@ -35,6 +35,17 @@ replace(ForwardRange& rng, const Value& what,
return rng;
}
/// \overload
template< class ForwardRange, class Value >
inline const ForwardRange&
replace(const ForwardRange& rng, const Value& what,
const Value& with_what)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
std::replace(boost::begin(rng), boost::end(rng), what, with_what);
return rng;
}
} // namespace range
using range::replace;
} // namespace boost;
......
......@@ -27,10 +27,10 @@ namespace boost
/// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class OutputIterator, class Value >
inline OutputIterator
replace_copy(ForwardRange& rng, OutputIterator out_it, const Value& what,
replace_copy(const ForwardRange& rng, OutputIterator out_it, const Value& what,
const Value& with_what)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::replace_copy(boost::begin(rng), boost::end(rng), out_it,
what, with_what);
}
......
......@@ -31,10 +31,10 @@ namespace boost
/// \pre Value is convertible to a type in OutputIterator's set of value types.
template< class ForwardRange, class OutputIterator, class Predicate, class Value >
inline OutputIterator
replace_copy_if(ForwardRange& rng, OutputIterator out_it, Predicate pred,
replace_copy_if(const ForwardRange& rng, OutputIterator out_it, Predicate pred,
const Value& with_what)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::replace_copy_if(boost::begin(rng), boost::end(rng), out_it,
pred, with_what);
}
......
......@@ -36,6 +36,17 @@ inline ForwardRange&
return rng;
}
/// \overload
template< class ForwardRange, class UnaryPredicate, class Value >
inline const ForwardRange&
replace_if(const ForwardRange& rng, UnaryPredicate pred,
const Value& val)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
std::replace_if(boost::begin(rng), boost::end(rng), pred, val);
return rng;
}
} // namespace range
using range::replace_if;
} // namespace boost
......
......@@ -34,6 +34,15 @@ inline BidirectionalRange& reverse(BidirectionalRange& rng)
return rng;
}
/// \overload
template<class BidirectionalRange>
inline const BidirectionalRange& reverse(const BidirectionalRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
std::reverse(boost::begin(rng), boost::end(rng));
return rng;
}
} // namespace range
using range::reverse;
} // namespace boost
......
......@@ -29,7 +29,7 @@ namespace boost
template<class BidirectionalRange, class OutputIterator>
inline OutputIterator reverse_copy(const BidirectionalRange& rng, OutputIterator out)
{
BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<BidirectionalRange> ));
BOOST_RANGE_CONCEPT_ASSERT(( BidirectionalRangeConcept<const BidirectionalRange> ));
return std::reverse_copy(boost::begin(rng), boost::end(rng), out);
}
......
......@@ -34,6 +34,16 @@ inline ForwardRange& rotate(ForwardRange& rng,
return rng;
}
/// \overload
template<class ForwardRange>
inline const ForwardRange& rotate(const ForwardRange& rng,
BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type middle)
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
std::rotate(boost::begin(rng), middle, boost::end(rng));
return rng;
}
} // namespace range
using range::rotate;
} // namespace boost
......
......@@ -44,7 +44,7 @@ template< class ForwardRange, class Integer, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
search_n(const ForwardRange& rng, Integer count, const Value& value)
{
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
return std::search_n(boost::begin(rng), boost::end(rng), count, value);
}
......@@ -69,7 +69,7 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
search_n(const ForwardRange& rng, Integer count, const Value& value,
BinaryPredicate binary_pred)
{
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type, const Value&>));
return std::search_n(boost::begin(rng), boost::end(rng),
......@@ -97,7 +97,7 @@ template< range_return_value re, class ForwardRange, class Integer,
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
search_n(const ForwardRange& rng, Integer count, const Value& value)
{
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
return range_return<const ForwardRange,re>::
pack(std::search_n(boost::begin(rng), boost::end(rng),
count, value),
......@@ -128,7 +128,7 @@ inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
search_n(const ForwardRange& rng, Integer count, const Value& value,
BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type,
const Value&>));
......
......@@ -34,6 +34,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& sort(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred)
......@@ -43,6 +52,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred)
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline const RandomAccessRange& sort(const RandomAccessRange& rng, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::sort(boost::begin(rng), boost::end(rng), pred);
return rng;
}
} // namespace range
using range::sort;
} // namespace boost
......
......@@ -34,6 +34,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng)
return rng;
}
/// \overload
template<class RandomAccessRange>
inline const RandomAccessRange& stable_sort(const RandomAccessRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::stable_sort(boost::begin(rng), boost::end(rng));
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate sort_pred)
......@@ -43,6 +52,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate so
return rng;
}
/// \overload
template<class RandomAccessRange, class BinaryPredicate>
inline const RandomAccessRange& stable_sort(const RandomAccessRange& rng, BinaryPredicate sort_pred)
{
BOOST_RANGE_CONCEPT_ASSERT(( RandomAccessRangeConcept<const RandomAccessRange> ));
std::stable_sort(boost::begin(rng), boost::end(rng), sort_pred);
return rng;
}
} // namespace range
using range::stable_sort;
} // namespace boost
......
......@@ -80,6 +80,51 @@ swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2)
return range2;
}
/// \overload
template< class SinglePassRange1, class SinglePassRange2 >
inline SinglePassRange2&
swap_ranges(const SinglePassRange1& range1, SinglePassRange2& range2)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange2>));
boost::range_detail::swap_ranges_impl(
boost::begin(range1), boost::end(range1),
boost::begin(range2), boost::end(range2));
return range2;
}
/// \overload
template< class SinglePassRange1, class SinglePassRange2 >
inline const SinglePassRange2&
swap_ranges(SinglePassRange1& range1, const SinglePassRange2& range2)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange2>));
boost::range_detail::swap_ranges_impl(
boost::begin(range1), boost::end(range1),
boost::begin(range2), boost::end(range2));
return range2;
}
/// \overload
template< class SinglePassRange1, class SinglePassRange2 >
inline const SinglePassRange2&
swap_ranges(const SinglePassRange1& range1, const SinglePassRange2& range2)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange1>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange2>));
boost::range_detail::swap_ranges_impl(
boost::begin(range1), boost::end(range1),
boost::begin(range2), boost::end(range2));
return range2;
}
} // namespace range
using range::swap_ranges;
} // namespace boost
......
......@@ -27,24 +27,53 @@ namespace boost
///
/// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
inline
BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
>::type
upper_bound( ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val);
}
/// \overload
template< class ForwardRange, class Value >
BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
upper_bound( const ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val);
}
/// \overload
template< class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_iterator<ForwardRange>::type
>::type
upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred);
}
/// \overload
template< class ForwardRange, class Value, class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
upper_bound( const ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
>::type
upper_bound( ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
......@@ -52,10 +81,25 @@ upper_bound( ForwardRange& rng, Value val )
pack(std::upper_bound(boost::begin(rng), boost::end(rng), val),
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
upper_bound( const ForwardRange& rng, Value val )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::
pack(std::upper_bound(boost::begin(rng), boost::end(rng), val),
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value,
class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
inline BOOST_DEDUCED_TYPENAME disable_if<
is_const<ForwardRange>,
BOOST_DEDUCED_TYPENAME range_return<ForwardRange,re>::type
>::type
upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
......@@ -64,6 +108,18 @@ upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
rng);
}
/// \overload
template< range_return_value re, class ForwardRange, class Value,
class SortPredicate >
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
upper_bound( const ForwardRange& rng, Value val, SortPredicate pred )
{
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
return range_return<const ForwardRange,re>::
pack(std::upper_bound(boost::begin(rng), boost::end(rng), val, pred),
rng);
}
} // namespace range
using range::upper_bound;
} // namespace boost
......
......@@ -34,6 +34,19 @@ inline ForwardRange& iota( ForwardRange& rng, Value x )
return rng;
}
template< class ForwardRange, class Value >
inline const ForwardRange& iota( const ForwardRange& rng, Value x )
{
BOOST_CONCEPT_ASSERT(( ForwardRangeConcept<const ForwardRange> ));
typedef BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type iterator_t;
iterator_t last_target = ::boost::end(rng);
for (iterator_t target = ::boost::begin(rng); target != last_target; ++target, ++x)
*target = x;
return rng;
}
} // namespace range
using range::iota;
} // namespace boost
......
......@@ -51,7 +51,7 @@ template<class SinglePassRange>
inline bool is_sorted(const SinglePassRange& rng)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept<BOOST_DEDUCED_TYPENAME range_value<SinglePassRange>::type>));
BOOST_RANGE_CONCEPT_ASSERT((LessThanComparableConcept<BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type>));
return range_detail::is_sorted(boost::begin(rng), boost::end(rng));
}
......@@ -59,8 +59,8 @@ inline bool is_sorted(const SinglePassRange& rng)
template<class SinglePassRange, class BinaryPredicate>
inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred)
{
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate, BOOST_DEDUCED_TYPENAME range_value<SinglePassRange>::type, BOOST_DEDUCED_TYPENAME range_value<SinglePassRange>::type>));
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate, BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type, BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange>::type>));
return range_detail::is_sorted(boost::begin(rng), boost::end(rng), pred);
}
......
......@@ -50,6 +50,33 @@ inline void overwrite( const SinglePassRange1& from, SinglePassRange2& to )
}
}
template< class SinglePassRange1, class SinglePassRange2 >
inline void overwrite( const SinglePassRange1& from, const SinglePassRange2& to )
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type
i = boost::begin(from), e = boost::end(from);
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type
out = boost::begin(to);
#ifndef NDEBUG
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type
last_out = boost::end(to);
#endif
for( ; i != e; ++out, ++i )
{
#ifndef NDEBUG
BOOST_ASSERT( out != last_out
&& "out of bounds in boost::overwrite()" );
#endif
*out = *i;
}
}
} // namespace range
using range::overwrite;
} // namespace boost
......
......@@ -12,9 +12,9 @@
#define BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED
#include <iterator>
#include <boost/assert.hpp>
#include <boost/iterator/iterator_traits.hpp>
#include <boost/iterator/iterator_facade.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/empty.hpp>
......@@ -30,21 +30,6 @@ namespace boost
template<typename Iterator1, typename Iterator2>
struct join_iterator_link
{
private:
class reference_count_t
{
public:
reference_count_t() : m_count(0u) {}
reference_count_t(const reference_count_t&) : m_count(0u) {}
reference_count_t& operator=(const reference_count_t&) { return *this; }
void increment() { ++m_count; }
bool decrement() { return --m_count ? false : true; }
private:
unsigned int m_count;
};
public:
join_iterator_link(Iterator1 last1, Iterator2 first2)
: last1(last1)
......@@ -52,43 +37,13 @@ public:
{
}
void add_reference() const
{
count.increment();
}
bool release_reference() const
{
return count.decrement();
}
Iterator1 last1;
Iterator2 first2;
private:
join_iterator_link() /* = delete */ ;
mutable reference_count_t count;
};
} // range_detail
template<typename Iterator1, typename Iterator2>
inline void intrusive_ptr_add_ref(const range_detail::join_iterator_link<Iterator1,Iterator2>* p)
{
p->add_reference();
}
template<typename Iterator1, typename Iterator2>
inline void intrusive_ptr_release(const range_detail::join_iterator_link<Iterator1,Iterator2>* p)
{
if (p->release_reference())
delete p;
}
namespace range_detail
{
class join_iterator_begin_tag {};
class join_iterator_end_tag {};
......@@ -179,12 +134,16 @@ public:
typedef Iterator1 iterator1_t;
typedef Iterator2 iterator2_t;
join_iterator() : m_section(0u) {}
join_iterator()
: m_section(0u)
, m_it(0u, iterator1_t(), iterator2_t())
, m_link(link_t(iterator1_t(), iterator2_t()))
{}
join_iterator(unsigned int section, Iterator1 current1, Iterator1 last1, Iterator2 first2, Iterator2 current2)
: m_section(section)
, m_it(section, current1, current2)
, m_link(new link_t(last1, first2))
, m_link(link_t(last1, first2))
{
}
......@@ -192,7 +151,7 @@ public:
join_iterator(Range1& r1, Range2& r2, join_iterator_begin_tag)
: m_section(boost::empty(r1) ? 1u : 0u)
, m_it(boost::empty(r1) ? 1u : 0u, boost::begin(r1), boost::begin(r2))
, m_link(new link_t(boost::end(r1), boost::begin(r2)))
, m_link(link_t(boost::end(r1), boost::begin(r2)))
{
}
......@@ -200,7 +159,7 @@ public:
join_iterator(const Range1& r1, const Range2& r2, join_iterator_begin_tag)
: m_section(boost::empty(r1) ? 1u : 0u)
, m_it(boost::empty(r1) ? 1u : 0u, boost::const_begin(r1), boost::const_begin(r2))
, m_link(new link_t(boost::const_end(r1), boost::const_begin(r2)))
, m_link(link_t(boost::const_end(r1), boost::const_begin(r2)))
{
}
......@@ -208,7 +167,7 @@ public:
join_iterator(Range1& r1, Range2& r2, join_iterator_end_tag)
: m_section(1u)
, m_it(1u, boost::end(r1), boost::end(r2))
, m_link(new link_t(boost::end(r1), boost::begin(r2)))
, m_link(link_t(boost::end(r1), boost::begin(r2)))
{
}
......@@ -216,7 +175,7 @@ public:
join_iterator(const Range1& r1, const Range2& r2, join_iterator_end_tag)
: m_section(1u)
, m_it(1u, boost::const_end(r1), boost::const_end(r2))
, m_link(new link_t(boost::const_end(r1), boost::const_begin(r2)))
, m_link(link_t(boost::const_end(r1), boost::const_begin(r2)))
{
}
......@@ -228,9 +187,9 @@ private:
else
{
++m_it.it1();
if (m_it.it1() == m_link->last1)
if (m_it.it1() == m_link.last1)
{
m_it.it2() = m_link->first2;
m_it.it2() = m_link.first2;
m_section = 1u;
}
}
......@@ -240,9 +199,9 @@ private:
{
if (m_section)
{
if (m_it.it2() == m_link->first2)
if (m_it.it2() == m_link.first2)
{
m_it.it1() = boost::prior(m_link->last1);
m_it.it1() = boost::prior(m_link.last1);
m_section = 0u;
}
else
......@@ -280,8 +239,8 @@ private:
result = other.m_it.it2() - m_it.it2();
else
{
result = (m_link->first2 - m_it.it2())
+ (other.m_it.it1() - m_link->last1);
result = (m_link.first2 - m_it.it2())
+ (other.m_it.it1() - m_link.last1);
BOOST_ASSERT( result <= 0 );
}
......@@ -290,8 +249,8 @@ private:
{
if (other.m_section)
{
result = (m_link->last1 - m_it.it1())
+ (other.m_it.it2() - m_link->first2);
result = (m_link.last1 - m_it.it1())
+ (other.m_it.it2() - m_link.first2);
}
else
result = other.m_it.it1() - m_it.it1();
......@@ -305,7 +264,7 @@ private:
BOOST_ASSERT( m_section == 1u );
if (offset < 0)
{
difference_t r2_dist = m_link->first2 - m_it.it2();
difference_t r2_dist = m_link.first2 - m_it.it2();
BOOST_ASSERT( r2_dist <= 0 );
if (offset >= r2_dist)
std::advance(m_it.it2(), offset);
......@@ -313,7 +272,7 @@ private:
{
difference_t r1_dist = offset - r2_dist;
BOOST_ASSERT( r1_dist <= 0 );
m_it.it1() = m_link->last1 + r1_dist;
m_it.it1() = m_link.last1 + r1_dist;
m_section = 0u;
}
}
......@@ -327,7 +286,7 @@ private:
BOOST_ASSERT( m_section == 0u );
if (offset > 0)
{
difference_t r1_dist = m_link->last1 - m_it.it1();
difference_t r1_dist = m_link.last1 - m_it.it1();
BOOST_ASSERT( r1_dist >= 0 );
if (offset < r1_dist)
std::advance(m_it.it1(), offset);
......@@ -335,7 +294,7 @@ private:
{
difference_t r2_dist = offset - r1_dist;
BOOST_ASSERT( r2_dist >= 0 );
m_it.it2() = m_link->first2 + r2_dist;
m_it.it2() = m_link.first2 + r2_dist;
m_section = 1u;
}
}
......@@ -345,7 +304,7 @@ private:
unsigned int m_section;
iterator_union m_it;
intrusive_ptr<const link_t> m_link;
link_t m_link;
friend class ::boost::iterator_core_access;
};
......
......@@ -173,28 +173,54 @@ namespace boost
} // namespace range_detail
template<typename Integer>
iterator_range< range_detail::integer_iterator<Integer> >
irange(Integer first, Integer last)
class integer_range
: public iterator_range< range_detail::integer_iterator<Integer> >
{
typedef range_detail::integer_iterator<Integer> iterator_t;
typedef iterator_range<iterator_t> base_t;
public:
integer_range(Integer first, Integer last)
: base_t(iterator_t(first), iterator_t(last))
{
}
};
template<typename Integer>
class strided_integer_range
: public iterator_range< range_detail::integer_iterator_with_step<Integer> >
{
typedef range_detail::integer_iterator_with_step<Integer> iterator_t;
typedef iterator_range<iterator_t> base_t;
public:
template<typename Iterator>
strided_integer_range(Iterator first, Iterator last)
: base_t(first, last)
{
}
};
template<typename Integer>
integer_range<Integer>
irange(Integer first, Integer last)
{
BOOST_ASSERT( first <= last );
return boost::iterator_range< range_detail::integer_iterator<Integer> >(
range_detail::integer_iterator<Integer>(first),
range_detail::integer_iterator<Integer>(last));
return integer_range<Integer>(first, last);
}
template<typename Integer, typename StepSize>
iterator_range< range_detail::integer_iterator_with_step<Integer> >
strided_integer_range<Integer>
irange(Integer first, Integer last, StepSize step_size)
{
BOOST_ASSERT( step_size != 0 );
BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) );
typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t;
const std::ptrdiff_t last_step
= (static_cast<std::ptrdiff_t>(last) - static_cast<std::ptrdiff_t>(first))
/ (static_cast<std::ptrdiff_t>(step_size));
return boost::iterator_range< iterator_t >(
return strided_integer_range<Integer>(
iterator_t(first, 0, step_size),
iterator_t(first, last_step, step_size));
}
......
......@@ -18,49 +18,64 @@
namespace boost
{
namespace range_detail
{
template<class SinglePassRange1, class SinglePassRange2>
iterator_range<range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME add_const<
BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange1>::type>::type>
>
class joined_type
{
public:
typedef iterator_range<
range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME range_value<SinglePassRange1>::type
>
> type;
};
} // namespace range_detail
template<class SinglePassRange1, class SinglePassRange2>
class joined_range
: public range_detail::joined_type<SinglePassRange1, SinglePassRange2>::type
{
typedef range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME range_value<SinglePassRange1>::type
> iterator_t;
typedef BOOST_DEDUCED_TYPENAME range_detail::joined_type<
SinglePassRange1, SinglePassRange2>::type base_t;
public:
joined_range(SinglePassRange1& rng1, SinglePassRange2& rng2)
: base_t(
iterator_t(rng1, rng2, range_detail::join_iterator_begin_tag()),
iterator_t(rng1, rng2, range_detail::join_iterator_end_tag())
)
{
}
};
template<class SinglePassRange1, class SinglePassRange2>
joined_range<const SinglePassRange1, const SinglePassRange2>
join(const SinglePassRange1& r1, const SinglePassRange2& r2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
typedef range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME add_const<
BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange1>::type>::type> iterator_t;
return iterator_range<iterator_t>(
iterator_t(r1, r2, range_detail::join_iterator_begin_tag()),
iterator_t(r1, r2, range_detail::join_iterator_end_tag()));
return joined_range<const SinglePassRange1, const SinglePassRange2>(r1, r2);
}
template<class SinglePassRange1, class SinglePassRange2>
iterator_range<range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME range_value<SinglePassRange1>::type>
>
joined_range<SinglePassRange1, SinglePassRange2>
join(SinglePassRange1& r1, SinglePassRange2& r2)
{
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
typedef range_detail::join_iterator<
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME range_value<SinglePassRange1>::type> iterator_t;
return iterator_range<iterator_t>(
iterator_t(r1, r2, range_detail::join_iterator_begin_tag()),
iterator_t(r1, r2, range_detail::join_iterator_end_tag()));
return joined_range<SinglePassRange1, SinglePassRange2>(r1, r2);
}
} // namespace boost
......
......@@ -7,13 +7,13 @@
// 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)
//
//
// Copyright 2006 Thorsten Ottosen.
// 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)
//
//
// Copyright 2004 Eric Niebler.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
......@@ -31,6 +31,7 @@
#include <boost/range/begin.hpp>
#include <boost/range/end.hpp>
#include <boost/range/concepts.hpp>
#include <boost/range/distance.hpp>
#include <numeric>
......@@ -39,14 +40,14 @@ namespace boost
template< class SinglePassRange, class Value >
inline Value accumulate( const SinglePassRange& rng, Value init )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::accumulate( boost::begin(rng), boost::end(rng), init );
}
template< class SinglePassRange, class Value, class BinaryOperation >
inline Value accumulate( const SinglePassRange& rng, Value init, BinaryOperation op )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::accumulate( boost::begin(rng), boost::end(rng), init, op );
}
......@@ -54,42 +55,42 @@ namespace boost
template< class SinglePassRange1, class SinglePassRange2, class Value >
inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange1> >();
boost::function_requires< SinglePassRangeConcept<SinglePassRange2> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) );
return std::inner_product( boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), init );
return std::inner_product( boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), init );
}
template< class SinglePassRange1,
class SinglePassRange2,
class Value,
class Value,
class BinaryOperation1, class BinaryOperation2 >
inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2,
Value init,
Value init,
BinaryOperation1 op1, BinaryOperation2 op2 )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange1> >();
boost::function_requires< SinglePassRangeConcept<SinglePassRange2> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) );
return std::inner_product( boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), init, op1, op2 );
return std::inner_product( boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), init, op1, op2 );
}
template< class SinglePassRange, class OutputIterator >
inline OutputIterator partial_sum ( const SinglePassRange& rng,
inline OutputIterator partial_sum ( const SinglePassRange& rng,
OutputIterator result )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::partial_sum( boost::begin(rng), boost::end(rng), result );
}
template< class SinglePassRange, class OutputIterator, class BinaryOperation >
inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result,
inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result,
BinaryOperation op )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::partial_sum( boost::begin(rng), boost::end(rng), result, op );
}
......@@ -97,8 +98,8 @@ namespace boost
inline OutputIterator adjacent_difference ( const SinglePassRange& rng,
OutputIterator result )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
return std::adjacent_difference( boost::begin(rng), boost::end(rng),
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::adjacent_difference( boost::begin(rng), boost::end(rng),
result );
}
......@@ -107,11 +108,11 @@ namespace boost
OutputIterator result,
BinaryOperation op )
{
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >();
return std::adjacent_difference( boost::begin(rng), boost::end(rng),
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::adjacent_difference( boost::begin(rng), boost::end(rng),
result, op );
}
}
#endif
......@@ -51,13 +51,31 @@ 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_impl
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 typename add_reference_rvalue_layer<T>::type type;
};
#ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
#endif
......
......@@ -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
......
......@@ -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
......
......@@ -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))
));
};
};
......
......@@ -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);
};
......
......@@ -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
......
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Howard Hinnant and John Maddock 2000.
// Howard Hinnant and John Maddock 2000, 2010.
// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// Use, modification and distribution are subject to the Boost Software License,
......@@ -9,107 +9,34 @@
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
// Fixed is_pointer, is_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_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_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
#include <boost/type_traits/is_lvalue_reference.hpp>
#include <boost/type_traits/is_rvalue_reference.hpp>
#include <boost/type_traits/ice.hpp>
// 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_reference,T,__is_reference(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_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_reference,T& const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T& volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_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_reference,T const ,::boost::is_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T volatile ,::boost::is_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_reference,T const volatile ,::boost::is_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_reference,T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_reference,const T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_reference,volatile T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_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_reference_helper1(wrap<T>) )(wrap<T>);
char is_reference_helper1(...);
template <class T> no_type is_reference_helper2(T&(*)(wrap<T>));
yes_type is_reference_helper2(...);
template <typename T>
struct is_reference_impl
{
BOOST_STATIC_CONSTANT(
bool, value = sizeof(
::boost::detail::is_reference_helper2(
::boost::detail::is_reference_helper1(::boost::type_traits::wrap<T>()))) == 1
);
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_or<
::boost::is_lvalue_reference<T>::value, ::boost::is_rvalue_reference<T>::value
>::value));
};
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_reference,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_reference,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_reference,void volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_reference,void const volatile,false)
#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_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>
......
......@@ -61,7 +61,7 @@ struct is_same_part_1
template< typename T1, typename T2 >
struct is_same_impl
{
enum { value = detail::is_same_part_1<T1>::template part_2<T2>::value };
enum { value = boost::detail::is_same_part_1<T1>::template part_2<T2>::value };
};
#else // generic "no-partial-specialization" version
......@@ -81,7 +81,7 @@ struct is_same_impl
BOOST_STATIC_CONSTANT(bool, value =
(::boost::type_traits::ice_and<
(sizeof(type_traits::yes_type) == sizeof(detail::is_same_tester(&t,&u))),
(sizeof(type_traits::yes_type) == sizeof(boost::detail::is_same_tester(&t,&u))),
(::boost::is_reference<T>::value == ::boost::is_reference<U>::value),
(sizeof(T) == sizeof(U))
>::value));
......
......@@ -41,16 +41,35 @@
namespace boost {
namespace detail{
template <class T>
struct is_volatile_rval_filter
{
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile);
#else
BOOST_STATIC_CONSTANT(bool, value = ::boost::detail::cv_traits_imp<T*>::is_volatile);
#endif
};
#ifndef BOOST_NO_RVALUE_REFERENCES
//
// We can't filter out rvalue_references at the same level as
// references or we get ambiguities from msvc:
//
template <class T>
struct is_volatile_rval_filter<T&&>
{
BOOST_STATIC_CONSTANT(bool, value = false);
};
#endif
}
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,__is_volatile(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
//* is a type T declared volatile - is_volatile<T>
#if BOOST_WORKAROUND(BOOST_MSVC, < 1400)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp<typename boost::remove_bounds<T>::type*>::is_volatile)
#else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::cv_traits_imp<T*>::is_volatile)
#endif
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_volatile,T,::boost::detail::is_volatile_rval_filter<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_volatile,T&,false)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
......@@ -86,7 +105,7 @@ struct is_volatile_helper<false,false>
{
static T* t;
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(t))
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_volatile_tester(t))
));
};
};
......@@ -98,7 +117,7 @@ struct is_volatile_helper<false,true>
{
static T t;
BOOST_STATIC_CONSTANT(bool, value = (
sizeof(detail::yes_type) == sizeof(detail::is_volatile_tester(&t))
sizeof(boost::detail::yes_type) == sizeof(boost::detail::is_volatile_tester(&t))
));
};
};
......
......@@ -36,7 +36,7 @@ namespace boost {
template<typename T>
struct remove_all_extents {
typedef typename detail::remove_all_extents_impl_typeof<
typedef typename boost::detail::remove_all_extents_impl_typeof<
boost::is_array<T>::value
>::template inner<T,remove_all_extents<T> >::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_all_extents,T)
......
......@@ -32,7 +32,7 @@ namespace boost {
template<typename T>
struct remove_bounds {
typedef typename detail::remove_bounds_impl_typeof<
typedef typename boost::detail::remove_bounds_impl_typeof<
boost::is_array<T>::value
>::template inner<T,remove_bounds<T> >::type type;
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,remove_bounds,T)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment