Commit 8ec67570 authored by jean-pierre charras's avatar jean-pierre charras

Pcbnew: hot key move in board editor: minor fixes and enhancements

Updated boost library version to stable 1_44_0 (mainly for boost::polygon)
parents 6f009e8f 16c404ac
boost version: 1_43_0 boost version: 1_44_0
// Copyright David Abrahams 2009. Distributed under the Boost
// Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#ifndef BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
# define BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
namespace boost
{
namespace concepts {}
# if !defined(BOOST_NO_CONCEPTS) && !defined(BOOST_CONCEPT_NO_BACKWARD_KEYWORD)
namespace concept = concepts;
# endif
} // namespace boost::concept
#endif // BOOST_CONCEPT_BACKWARD_COMPATIBILITY_DWA200968_HPP
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
# define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP # define BOOST_CONCEPT_DETAIL_BORLAND_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class ModelFnPtr> template <class ModelFnPtr>
struct require; struct require;
...@@ -21,7 +22,7 @@ struct require<void(*)(Model)> ...@@ -21,7 +22,7 @@ struct require<void(*)(Model)>
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
boost::concept::require<ModelFnPtr>::instantiate \ boost::concepts::require<ModelFnPtr>::instantiate \
} }
}} // namespace boost::concept }} // namespace boost::concept
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP # define BOOST_CONCEPT_DETAIL_GENERAL_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp> # include <boost/concept/detail/has_constraints.hpp>
...@@ -13,7 +14,7 @@ ...@@ -13,7 +14,7 @@
// This implementation works on Comeau and GCC, all the way back to // This implementation works on Comeau and GCC, all the way back to
// 2.95 // 2.95
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class ModelFn> template <class ModelFn>
struct requirement_; struct requirement_;
...@@ -29,6 +30,14 @@ struct requirement ...@@ -29,6 +30,14 @@ struct requirement
static void failed() { ((Model*)0)->~Model(); } 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 # ifdef BOOST_OLD_CONCEPT_SUPPORT
template <class Model> template <class Model>
...@@ -40,9 +49,9 @@ struct constraint ...@@ -40,9 +49,9 @@ struct constraint
template <class Model> template <class Model>
struct requirement_<void(*)(Model)> struct requirement_<void(*)(Model)>
: mpl::if_< : mpl::if_<
concept::not_satisfied<Model> concepts::not_satisfied<Model>
, constraint<Model> , constraint<Model>
, requirement<Model> , requirement<failed ************ Model::************>
>::type >::type
{}; {};
...@@ -51,14 +60,14 @@ struct requirement_<void(*)(Model)> ...@@ -51,14 +60,14 @@ struct requirement_<void(*)(Model)>
// For GCC-2.x, these can't have exactly the same name // For GCC-2.x, these can't have exactly the same name
template <class Model> template <class Model>
struct requirement_<void(*)(Model)> struct requirement_<void(*)(Model)>
: requirement<Model> : requirement<failed ************ Model::************>
{}; {};
# endif # endif
# define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \ # define BOOST_CONCEPT_ASSERT_FN( ModelFnPtr ) \
typedef ::boost::concept::detail::instantiate< \ typedef ::boost::concepts::detail::instantiate< \
&::boost::concept::requirement_<ModelFnPtr>::failed> \ &::boost::concepts::requirement_<ModelFnPtr>::failed> \
BOOST_PP_CAT(boost_concept_check,__LINE__) BOOST_PP_CAT(boost_concept_check,__LINE__)
}} }}
......
...@@ -6,7 +6,9 @@ ...@@ -6,7 +6,9 @@
# include <boost/mpl/bool.hpp> # include <boost/mpl/bool.hpp>
# include <boost/detail/workaround.hpp> # include <boost/detail/workaround.hpp>
namespace boost { namespace concept { # include <boost/concept/detail/backward_compatibility.hpp>
namespace boost { namespace concepts {
namespace detail namespace detail
{ {
...@@ -43,6 +45,6 @@ struct not_satisfied ...@@ -43,6 +45,6 @@ struct not_satisfied
typedef mpl::bool_<value> type; typedef mpl::bool_<value> type;
}; };
}} // namespace boost::concept::detail }} // namespace boost::concepts::detail
#endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP #endif // BOOST_CONCEPT_DETAIL_HAS_CONSTRAINTS_DWA2006429_HPP
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP # define BOOST_CONCEPT_CHECK_MSVC_DWA2006429_HPP
# include <boost/preprocessor/cat.hpp> # include <boost/preprocessor/cat.hpp>
# include <boost/concept/detail/backward_compatibility.hpp>
# ifdef BOOST_OLD_CONCEPT_SUPPORT # ifdef BOOST_OLD_CONCEPT_SUPPORT
# include <boost/concept/detail/has_constraints.hpp> # include <boost/concept/detail/has_constraints.hpp>
...@@ -12,7 +13,8 @@ ...@@ -12,7 +13,8 @@
# endif # endif
namespace boost { namespace concept { namespace boost { namespace concepts {
template <class Model> template <class Model>
struct check struct check
...@@ -23,6 +25,18 @@ struct check ...@@ -23,6 +25,18 @@ struct check
} }
}; };
# 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 # ifdef BOOST_OLD_CONCEPT_SUPPORT
namespace detail namespace detail
...@@ -38,7 +52,11 @@ struct require ...@@ -38,7 +52,11 @@ struct require
: mpl::if_c< : mpl::if_c<
not_satisfied<Model>::value not_satisfied<Model>::value
, detail::constraint , detail::constraint
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
, check<Model> , check<Model>
# else
, check<failed ************ Model::************>
# endif
>::type >::type
{}; {};
...@@ -46,7 +64,11 @@ struct require ...@@ -46,7 +64,11 @@ struct require
template <class Model> template <class Model>
struct require struct require
# ifndef BOOST_NO_PARTIAL_SPECIALIZATION
: check<Model> : check<Model>
# else
: check<failed ************ Model::************>
# endif
{}; {};
# endif # endif
...@@ -70,7 +92,7 @@ struct require<void(*)(Model)> ...@@ -70,7 +92,7 @@ struct require<void(*)(Model)>
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require<ModelFnPtr>) \ sizeof(::boost::concepts::require<ModelFnPtr>) \
} }
# else // Not vc-7.1 # else // Not vc-7.1
...@@ -83,7 +105,7 @@ require_(void(*)(Model)); ...@@ -83,7 +105,7 @@ require_(void(*)(Model));
enum \ enum \
{ \ { \
BOOST_PP_CAT(boost_concept_check,__LINE__) = \ BOOST_PP_CAT(boost_concept_check,__LINE__) = \
sizeof(::boost::concept::require_((ModelFnPtr)0)) \ sizeof(::boost::concepts::require_((ModelFnPtr)0)) \
} }
# endif # endif
......
...@@ -6,8 +6,9 @@ ...@@ -6,8 +6,9 @@
# include <boost/concept/assert.hpp> # include <boost/concept/assert.hpp>
# include <boost/detail/workaround.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) # if BOOST_WORKAROUND(__GNUC__, == 2)
...@@ -25,19 +26,19 @@ struct usage_requirements ...@@ -25,19 +26,19 @@ struct usage_requirements
# define BOOST_CONCEPT_USAGE(model) \ # define BOOST_CONCEPT_USAGE(model) \
model(); /* at least 2.96 and 3.4.3 both need this :( */ \ 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() ~model()
# else # else
# define BOOST_CONCEPT_USAGE(model) \ # define BOOST_CONCEPT_USAGE(model) \
BOOST_CONCEPT_ASSERT((boost::concept::usage_requirements<model>)); \ BOOST_CONCEPT_ASSERT((boost::concepts::usage_requirements<model>)); \
~model() ~model()
# endif # endif
# endif # endif
}} // namespace boost::concept }} // namespace boost::concepts
#endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP #endif // BOOST_CONCEPT_USAGE_DWA2006919_HPP
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
// 8026 - functions taking class by value arguments are not expanded inline // 8026 - functions taking class by value arguments are not expanded inline
#pragma nopushoptwarn #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 ...@@ -25,6 +25,9 @@ BOOST_LIB_DIAGNOSTIC: Optional: when set the header will print out the name
of the library selected (useful for debugging). of the library selected (useful for debugging).
BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib, BOOST_AUTO_LINK_NOMANGLE: Specifies that we should link to BOOST_LIB_NAME.lib,
rather than a mangled-name version. 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 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! 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, ...@@ -60,6 +63,8 @@ BOOST_LIB_RT_OPT: A suffix that indicates the runtime library used,
a hiphen: a hiphen:
s static runtime (dynamic if not present). 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). d debug build (release if not present).
g debug/diagnostic runtime (release if not present). g debug/diagnostic runtime (release if not present).
p STLPort Build. p STLPort Build.
...@@ -183,8 +188,16 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. ...@@ -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(__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" # 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) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdp" # define BOOST_LIB_RT_OPT "-gdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # 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. ...@@ -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) # 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" # 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) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-gdpn" # define BOOST_LIB_RT_OPT "-gdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # 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. ...@@ -207,7 +228,9 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else # 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" # define BOOST_LIB_RT_OPT "-gd"
# else # else
# define BOOST_LIB_RT_OPT # 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. ...@@ -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(__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" # 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) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdp" # define BOOST_LIB_RT_OPT "-sgdp"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # 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. ...@@ -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) # 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" # 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) # elif defined(_DEBUG)
# define BOOST_LIB_RT_OPT "-sgdpn" # define BOOST_LIB_RT_OPT "-sgdpn"
# pragma message("warning: STLPort debug versions are built with /D_STLP_DEBUG=1") # 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. ...@@ -243,7 +282,10 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# else # 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" # define BOOST_LIB_RT_OPT "-sgd"
# else # else
# define BOOST_LIB_RT_OPT "-s" # 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. ...@@ -270,16 +312,26 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y.
# ifdef _RTLDLL # 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" # define BOOST_LIB_RT_OPT "-d"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT -y
# else # else
# define BOOST_LIB_RT_OPT # define BOOST_LIB_RT_OPT
# endif # endif
# else # 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" # define BOOST_LIB_RT_OPT "-sd"
# elif defined(BOOST_DEBUG_PYTHON) && defined(BOOST_LINKING_PYTHON)
# define BOOST_LIB_RT_OPT "-sy"
# else # else
# define BOOST_LIB_RT_OPT "-s" # define BOOST_LIB_RT_OPT "-s"
# endif # endif
...@@ -309,16 +361,21 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. ...@@ -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_RT_OPT) \
&& defined(BOOST_LIB_VERSION) && defined(BOOST_LIB_VERSION)
#ifndef BOOST_AUTO_LINK_NOMANGLE #ifdef BOOST_AUTO_LINK_TAGGED
# 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") # pragma commentcomment(lib, BOOST_LIB_PREFIX BOOST_STRINGIZE(BOOST_LIB_NAME) BOOST_LIB_THREAD_OPT BOOST_LIB_RT_OPT ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC # 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") # 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 #elif defined(BOOST_AUTO_LINK_NOMANGLE)
# pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # pragma comment(lib, BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# ifdef BOOST_LIB_DIAGNOSTIC # ifdef BOOST_LIB_DIAGNOSTIC
# pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib") # pragma message ("Linking to lib file: " BOOST_STRINGIZE(BOOST_LIB_NAME) ".lib")
# endif # 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 #endif
#else #else
...@@ -361,13 +418,3 @@ BOOST_LIB_VERSION: The Boost version, in the form x_y, for Boost version x.y. ...@@ -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 # undef BOOST_AUTO_LINK_NOMANGLE
#endif #endif
...@@ -218,7 +218,7 @@ ...@@ -218,7 +218,7 @@
// //
// check for exception handling support: // 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 # define BOOST_NO_EXCEPTIONS
#endif #endif
// //
...@@ -230,8 +230,9 @@ ...@@ -230,8 +230,9 @@
// //
// all versions support __declspec: // all versions support __declspec:
// //
#ifndef __STRICT_ANSI__ #if defined(__STRICT_ANSI__)
# define BOOST_HAS_DECLSPEC // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif #endif
// //
// ABI fixing headers: // ABI fixing headers:
...@@ -261,6 +262,13 @@ ...@@ -261,6 +262,13 @@
# define BOOST_NO_VOID_RETURNS # define BOOST_NO_VOID_RETURNS
#endif #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__) #define BOOST_COMPILER "Borland C++ version " BOOST_STRINGIZE(__BORLANDC__)
......
// (C) Copyright Douglas Gregor 2010
//
// Use, modification and distribution are subject to the
// Boost Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org for most recent version.
// Clang compiler setup.
#if __has_feature(cxx_exceptions) && !defined(BOOST_NO_EXCEPTIONS)
#else
# define BOOST_NO_EXCEPTIONS
#endif
#if __has_feature(cxx_rtti)
#else
# define BOOST_NO_RTTI
#endif
#if defined(__int64)
# define BOOST_HAS_MS_INT64
#endif
#define BOOST_HAS_NRVO
// NOTE: Clang's C++0x support is not worth detecting. However, it
// supports both extern templates and "long long" even in C++98/03
// mode.
#define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS
#define BOOST_NO_CHAR16_T
#define BOOST_NO_CHAR32_T
#define BOOST_NO_CONCEPTS
#define BOOST_NO_CONSTEXPR
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES
// HACK: Clang does support extern templates, but Boost's test for
// them is wrong.
#define BOOST_NO_EXTERN_TEMPLATE
#ifndef BOOST_COMPILER
# define BOOST_COMPILER "Clang version " __clang_version__
#endif
// Macro used to identify the Clang compiler.
#define BOOST_CLANG 1
...@@ -19,8 +19,8 @@ ...@@ -19,8 +19,8 @@
#endif #endif
// //
// versions check: // versions check:
// last known and checked version is 0x620 // last known and checked version is 0x621
#if (__CODEGEARC__ > 0x620) #if (__CODEGEARC__ > 0x621)
# if defined(BOOST_ASSERT_CONFIG) # if defined(BOOST_ASSERT_CONFIG)
# error "Unknown compiler version - please run the configure tests and report the results" # error "Unknown compiler version - please run the configure tests and report the results"
# else # else
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
#endif #endif
// CodeGear C++ Builder 2010 // 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_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_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_MEMBER_TEMPLATE_FRIENDS # define BOOST_NO_MEMBER_TEMPLATE_FRIENDS
...@@ -51,6 +51,15 @@ ...@@ -51,6 +51,15 @@
// Temporary hack, until specific MPL preprocessed headers are generated // Temporary hack, until specific MPL preprocessed headers are generated
# define BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS # 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 # ifdef NDEBUG
// fix broken <cstring> so that Boost.test works: // fix broken <cstring> so that Boost.test works:
# include <cstring> # include <cstring>
...@@ -66,6 +75,11 @@ ...@@ -66,6 +75,11 @@
// //
// C++0x macros: // 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_CHAR16_T
#define BOOST_HAS_CHAR32_T #define BOOST_HAS_CHAR32_T
#define BOOST_HAS_LONG_LONG #define BOOST_HAS_LONG_LONG
...@@ -91,7 +105,6 @@ ...@@ -91,7 +105,6 @@
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_RAW_LITERALS
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_VARIADIC_TEMPLATES
...@@ -122,7 +135,7 @@ ...@@ -122,7 +135,7 @@
// //
// check for exception handling support: // 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 # define BOOST_NO_EXCEPTIONS
#endif #endif
// //
...@@ -134,8 +147,9 @@ ...@@ -134,8 +147,9 @@
// //
// all versions support __declspec: // all versions support __declspec:
// //
#if !defined(__STRICT_ANSI__) #if defined(__STRICT_ANSI__)
# define BOOST_HAS_DECLSPEC // config/platform/win32.hpp will define BOOST_SYMBOL_EXPORT, etc., unless already defined
# define BOOST_SYMBOL_EXPORT
#endif #endif
// //
// ABI fixing headers: // ABI fixing headers:
......
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
#endif #endif
// See also kai.hpp which checks a Kai-specific symbol for EH // 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 # define BOOST_NO_EXCEPTIONS
# endif # endif
...@@ -59,6 +59,9 @@ ...@@ -59,6 +59,9 @@
// //
// See above for BOOST_NO_LONG_LONG // 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) #if (__EDG_VERSION__ <= 310) || !defined(BOOST_STRICT_CONFIG)
// No support for initializer lists // No support for initializer lists
# define BOOST_NO_INITIALIZER_LISTS # define BOOST_NO_INITIALIZER_LISTS
...@@ -74,7 +77,6 @@ ...@@ -74,7 +77,6 @@
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_LAMBDAS #define BOOST_NO_LAMBDAS
#define BOOST_NO_NULLPTR #define BOOST_NO_NULLPTR
......
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
// check for exception handling support: // check for exception handling support:
#ifndef _CPPUNWIND #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
......
...@@ -42,6 +42,7 @@ ...@@ -42,6 +42,7 @@
# define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE # define BOOST_NO_USING_DECLARATION_OVERLOADS_FROM_TYPENAME_BASE
# define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL # define BOOST_FUNCTION_SCOPE_USING_DECLARATION_BREAKS_ADL
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# define BOOST_NO_EXTERN_TEMPLATE
#elif __GNUC__ == 3 #elif __GNUC__ == 3
# if defined (__PATHSCALE__) # if defined (__PATHSCALE__)
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
...@@ -58,6 +59,7 @@ ...@@ -58,6 +59,7 @@
# if __GNUC_MINOR__ < 4 # if __GNUC_MINOR__ < 4
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# endif # endif
# define BOOST_NO_EXTERN_TEMPLATE
#endif #endif
#if __GNUC__ < 4 #if __GNUC__ < 4
// //
...@@ -69,7 +71,19 @@ ...@@ -69,7 +71,19 @@
# endif # endif
#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 # define BOOST_NO_EXCEPTIONS
#endif #endif
...@@ -94,20 +108,45 @@ ...@@ -94,20 +108,45 @@
#if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 ) #if __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 1 )
#define BOOST_HAS_NRVO #define BOOST_HAS_NRVO
#endif #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: // RTTI and typeinfo detection is possible post gcc-4.3:
// //
#if __GNUC__ * 100 + __GNUC_MINOR__ >= 403 #if __GNUC__ * 100 + __GNUC_MINOR__ >= 403
# ifndef __GXX_RTTI # ifndef __GXX_RTTI
# ifndef BOOST_NO_TYPEID
# define BOOST_NO_TYPEID # define BOOST_NO_TYPEID
# endif
# ifndef BOOST_NO_RTTI
# define BOOST_NO_RTTI # define BOOST_NO_RTTI
# endif # endif
# endif
#endif #endif
// C++0x features not implemented in any GCC version // C++0x features not implemented in any GCC version
// //
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CONSTEXPR
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_NULLPTR #define BOOST_NO_NULLPTR
#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_TEMPLATE_ALIASES
......
...@@ -25,6 +25,31 @@ ...@@ -25,6 +25,31 @@
// //
#define BOOST_HAS_LONG_LONG #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__ #define BOOST_COMPILER "GCC-XML C++ version " __GCCXML__
...@@ -157,6 +157,29 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {}; ...@@ -157,6 +157,29 @@ template<> struct assert_intrinsic_wchar_t<unsigned short> {};
# define BOOST_NO_TWO_PHASE_NAME_LOOKUP # define BOOST_NO_TWO_PHASE_NAME_LOOKUP
#endif #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: // last known and checked version:
#if (BOOST_INTEL_CXX_VERSION > 1110) #if (BOOST_INTEL_CXX_VERSION > 1110)
......
...@@ -17,7 +17,7 @@ ...@@ -17,7 +17,7 @@
# endif # endif
// see also common_edg.hpp which needs a special check for __KCC // 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 # define BOOST_NO_EXCEPTIONS
# endif # endif
......
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
# define BOOST_NO_INTRINSIC_WCHAR_T # define BOOST_NO_INTRINSIC_WCHAR_T
#endif #endif
#if !__option(exceptions) #if !__option(exceptions) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
......
...@@ -66,6 +66,7 @@ ...@@ -66,6 +66,7 @@
#define BOOST_NO_0X_HDR_TYPE_TRAITS #define BOOST_NO_0X_HDR_TYPE_TRAITS
#define BOOST_NO_0X_HDR_TUPLE #define BOOST_NO_0X_HDR_TUPLE
#define BOOST_NO_0X_HDR_THREAD #define BOOST_NO_0X_HDR_THREAD
#define BOOST_NO_0X_HDR_TYPEINDEX
#define BOOST_NO_0X_HDR_SYSTEM_ERROR #define BOOST_NO_0X_HDR_SYSTEM_ERROR
#define BOOST_NO_0X_HDR_REGEX #define BOOST_NO_0X_HDR_REGEX
#define BOOST_NO_0X_HDR_RATIO #define BOOST_NO_0X_HDR_RATIO
......
...@@ -69,6 +69,25 @@ ...@@ -69,6 +69,25 @@
# define BOOST_NO_IS_ABSTRACT # define BOOST_NO_IS_ABSTRACT
# endif # 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: // Issues that effect all known versions:
// //
...@@ -78,12 +97,7 @@ ...@@ -78,12 +97,7 @@
// //
// C++0x features // C++0x features
// //
#if(__SUNPRO_CC >= 0x590)
# define BOOST_HAS_LONG_LONG # define BOOST_HAS_LONG_LONG
#else
# define BOOST_NO_LONG_LONG
#endif
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS
......
...@@ -30,6 +30,14 @@ ...@@ -30,6 +30,14 @@
# define BOOST_NO_INITIALIZER_LISTS # define BOOST_NO_INITIALIZER_LISTS
#endif #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: // On AIX thread support seems to be indicated by _THREAD_SAFE:
// //
......
...@@ -79,6 +79,8 @@ ...@@ -79,6 +79,8 @@
// although a conforming signature for swprint exists in VC7.1 // although a conforming signature for swprint exists in VC7.1
// it appears not to actually work: // it appears not to actually work:
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
// Our extern template tests also fail for this compiler:
# define BOOST_NO_EXTERN_TEMPLATE
#endif #endif
#if defined(UNDER_CE) #if defined(UNDER_CE)
...@@ -99,6 +101,24 @@ ...@@ -99,6 +101,24 @@
# define BOOST_NO_ADL_BARRIER # define BOOST_NO_ADL_BARRIER
#endif #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 #if _MSC_VER <= 1500 || !defined(BOOST_STRICT_CONFIG) // 1500 == VC++ 9.0
# define BOOST_NO_INITIALIZER_LISTS # define BOOST_NO_INITIALIZER_LISTS
#endif #endif
...@@ -115,7 +135,7 @@ ...@@ -115,7 +135,7 @@
// //
// check for exception handling support: // check for exception handling support:
#ifndef _CPPUNWIND #if !defined(_CPPUNWIND) && !defined(BOOST_NO_EXCEPTIONS)
# define BOOST_NO_EXCEPTIONS # define BOOST_NO_EXCEPTIONS
#endif #endif
...@@ -144,11 +164,6 @@ ...@@ -144,11 +164,6 @@
# define BOOST_NO_RTTI # define BOOST_NO_RTTI
#endif #endif
//
// all versions support __declspec:
//
#define BOOST_HAS_DECLSPEC
// //
// C++0x features // C++0x features
// //
...@@ -159,11 +174,14 @@ ...@@ -159,11 +174,14 @@
#if _MSC_VER < 1600 #if _MSC_VER < 1600
#define BOOST_NO_AUTO_DECLARATIONS #define BOOST_NO_AUTO_DECLARATIONS
#define BOOST_NO_AUTO_MULTIDECLARATIONS #define BOOST_NO_AUTO_MULTIDECLARATIONS
#define BOOST_NO_DECLTYPE
#define BOOST_NO_LAMBDAS #define BOOST_NO_LAMBDAS
#define BOOST_NO_RVALUE_REFERENCES #define BOOST_NO_RVALUE_REFERENCES
#define BOOST_NO_STATIC_ASSERT #define BOOST_NO_STATIC_ASSERT
#define BOOST_NO_NULLPTR
#endif // _MSC_VER < 1600 #endif // _MSC_VER < 1600
#if _MSC_VER >= 1600
#define BOOST_HAS_STDINT_H
#endif
// C++0x features not supported by any versions // C++0x features not supported by any versions
#define BOOST_NO_CHAR16_T #define BOOST_NO_CHAR16_T
...@@ -171,19 +189,17 @@ ...@@ -171,19 +189,17 @@
#define BOOST_NO_CONCEPTS #define BOOST_NO_CONCEPTS
#define BOOST_NO_CONSTEXPR #define BOOST_NO_CONSTEXPR
#define BOOST_NO_DEFAULTED_FUNCTIONS #define BOOST_NO_DEFAULTED_FUNCTIONS
#define BOOST_NO_DECLTYPE
#define BOOST_NO_DELETED_FUNCTIONS #define BOOST_NO_DELETED_FUNCTIONS
#define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS #define BOOST_NO_EXPLICIT_CONVERSION_OPERATORS
#define BOOST_NO_EXTERN_TEMPLATE
#define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS #define BOOST_NO_FUNCTION_TEMPLATE_DEFAULT_ARGS
#define BOOST_NO_INITIALIZER_LISTS #define BOOST_NO_INITIALIZER_LISTS
#define BOOST_NO_NULLPTR
#define BOOST_NO_RAW_LITERALS #define BOOST_NO_RAW_LITERALS
#define BOOST_NO_SCOPED_ENUMS #define BOOST_NO_SCOPED_ENUMS
#define BOOST_NO_SFINAE_EXPR #define BOOST_NO_SFINAE_EXPR
#define BOOST_NO_TEMPLATE_ALIASES #define BOOST_NO_TEMPLATE_ALIASES
#define BOOST_NO_UNICODE_LITERALS #define BOOST_NO_UNICODE_LITERALS
#define BOOST_NO_VARIADIC_TEMPLATES #define BOOST_NO_VARIADIC_TEMPLATES
// //
// prefix and suffix headers: // prefix and suffix headers:
// //
......
...@@ -8,9 +8,6 @@ ...@@ -8,9 +8,6 @@
// cygwin specific config options: // cygwin specific config options:
#define BOOST_PLATFORM "Cygwin" #define BOOST_PLATFORM "Cygwin"
#define BOOST_NO_CWCTYPE
#define BOOST_NO_CWCHAR
#define BOOST_NO_SWPRINTF
#define BOOST_HAS_DIRENT_H #define BOOST_HAS_DIRENT_H
#define BOOST_HAS_LOG1P #define BOOST_HAS_LOG1P
#define BOOST_HAS_EXPM1 #define BOOST_HAS_EXPM1
......
...@@ -21,10 +21,17 @@ ...@@ -21,10 +21,17 @@
# define BOOST_NO_SWPRINTF # define BOOST_NO_SWPRINTF
#endif #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_HAS_DECLSPEC
# define BOOST_SYMBOL_EXPORT __declspec(dllexport)
# define BOOST_SYMBOL_IMPORT __declspec(dllimport)
#endif #endif
#if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0))) #if defined(__MINGW32__) && ((__MINGW32_MAJOR_VERSION > 2) || ((__MINGW32_MAJOR_VERSION == 2) && (__MINGW32_MINOR_VERSION >= 0)))
# define BOOST_HAS_STDINT_H # define BOOST_HAS_STDINT_H
# define __STDC_LIMIT_MACROS # define __STDC_LIMIT_MACROS
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
// compilers we support: // compilers we support:
# define BOOST_CXX_GCCXML 0 # define BOOST_CXX_GCCXML 0
# define BOOST_CXX_CLANG 0
# define BOOST_CXX_COMO 0 # define BOOST_CXX_COMO 0
# define BOOST_CXX_DMC 0 # define BOOST_CXX_DMC 0
# define BOOST_CXX_INTEL 0 # define BOOST_CXX_INTEL 0
...@@ -49,6 +50,10 @@ ...@@ -49,6 +50,10 @@
// Comeau C++ // Comeau C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/comeau.hpp" # 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__ #elif defined __DMC__
// Digital Mars C++ // Digital Mars C++
# define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp" # define BOOST_COMPILER_CONFIG "boost/config/compiler/digitalmars.hpp"
......
...@@ -86,6 +86,11 @@ ...@@ -86,6 +86,11 @@
# define BOOST_NO_STD_LOCALE # define BOOST_NO_STD_LOCALE
#endif #endif
#include <typeinfo>
#if !_HAS_EXCEPTIONS
# define BOOST_NO_STD_TYPEINFO
#endif
// C++0x headers implemented in 520 (as shipped by Microsoft) // C++0x headers implemented in 520 (as shipped by Microsoft)
// //
#if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520 #if !defined(_CPPLIB_VER) || _CPPLIB_VER < 520
...@@ -100,6 +105,12 @@ ...@@ -100,6 +105,12 @@
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # 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 #endif
// C++0x headers not yet implemented // C++0x headers not yet implemented
...@@ -114,7 +125,6 @@ ...@@ -114,7 +125,6 @@
# define BOOST_NO_0X_HDR_MUTEX # define BOOST_NO_0X_HDR_MUTEX
# define BOOST_NO_0X_HDR_RATIO # define BOOST_NO_0X_HDR_RATIO
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE
#ifdef _CPPLIB_VER #ifdef _CPPLIB_VER
# define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER # define BOOST_DINKUMWARE_STDLIB _CPPLIB_VER
......
...@@ -54,6 +54,7 @@ ...@@ -54,6 +54,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -123,5 +123,6 @@ ...@@ -123,5 +123,6 @@
# define BOOST_NO_0X_HDR_FUTURE # define BOOST_NO_0X_HDR_FUTURE
# define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS # define BOOST_NO_0X_HDR_ITERATOR_CONCEPTS
# define BOOST_NO_0X_HDR_MEMORY_CONCEPTS # define BOOST_NO_0X_HDR_MEMORY_CONCEPTS
# define BOOST_NO_0X_HDR_TYPEINDEX
// --- end --- // --- end ---
...@@ -43,6 +43,7 @@ ...@@ -43,6 +43,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -67,6 +67,7 @@ ...@@ -67,6 +67,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -173,6 +173,7 @@ ...@@ -173,6 +173,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -126,6 +126,7 @@ ...@@ -126,6 +126,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -221,6 +221,7 @@ namespace boost { using std::min; using std::max; } ...@@ -221,6 +221,7 @@ namespace boost { using std::min; using std::max; }
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -33,6 +33,7 @@ ...@@ -33,6 +33,7 @@
# define BOOST_NO_0X_HDR_THREAD # define BOOST_NO_0X_HDR_THREAD
# define BOOST_NO_0X_HDR_TUPLE # define BOOST_NO_0X_HDR_TUPLE
# define BOOST_NO_0X_HDR_TYPE_TRAITS # define BOOST_NO_0X_HDR_TYPE_TRAITS
# define BOOST_NO_0X_HDR_TYPEINDEX
# define BOOST_NO_STD_UNORDERED // deprecated; see following # define BOOST_NO_STD_UNORDERED // deprecated; see following
# define BOOST_NO_0X_HDR_UNORDERED_MAP # define BOOST_NO_0X_HDR_UNORDERED_MAP
# define BOOST_NO_0X_HDR_UNORDERED_SET # define BOOST_NO_0X_HDR_UNORDERED_SET
......
...@@ -25,6 +25,19 @@ ...@@ -25,6 +25,19 @@
#ifndef BOOST_CONFIG_SUFFIX_HPP #ifndef BOOST_CONFIG_SUFFIX_HPP
#define 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>. // 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, // Note that we use limits.h rather than climits for maximal portability,
...@@ -82,6 +95,13 @@ ...@@ -82,6 +95,13 @@
# define BOOST_NO_LONG_LONG_NUMERIC_LIMITS # define BOOST_NO_LONG_LONG_NUMERIC_LIMITS
#endif #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 // if there is no __int64 then there is no specialisation
// for numeric_limits<__int64> either: // for numeric_limits<__int64> either:
...@@ -314,6 +334,13 @@ ...@@ -314,6 +334,13 @@
# define BOOST_NO_INITIALIZER_LISTS # define BOOST_NO_INITIALIZER_LISTS
#endif #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 // BOOST_HAS_ABI_HEADERS
// This macro gets set if we have headers that fix the ABI, // This macro gets set if we have headers that fix the ABI,
// and prevent ODR violations when linking to external libraries: // and prevent ODR violations when linking to external libraries:
...@@ -554,6 +581,12 @@ namespace boost{ ...@@ -554,6 +581,12 @@ namespace boost{
#endif // defined BOOST_NO_EXPLICIT_FUNCTION_TEMPLATE_ARGUMENTS #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 2005 Caleb Epstein
// Copyright 2006 John Maddock // Copyright 2006 John Maddock
// Copyright 2010 Rene Rivera
// Distributed under the Boost Software License, Version 1.0. (See accompany- // 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) // ing file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
...@@ -42,10 +43,12 @@ ...@@ -42,10 +43,12 @@
# error Unknown machine endianness detected. # error Unknown machine endianness detected.
# endif # endif
# define BOOST_BYTE_ORDER __BYTE_ORDER # 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_BIG_ENDIAN
# define BOOST_BYTE_ORDER 4321 # 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_LITTLE_ENDIAN
# define BOOST_BYTE_ORDER 1234 # define BOOST_BYTE_ORDER 1234
#elif defined(__sparc) || defined(__sparc__) \ #elif defined(__sparc) || defined(__sparc__) \
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt) // 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: // You are welcome to contact the author at:
// fernando_cacciola@hotmail.com // fernando_cacciola@hotmail.com
......
...@@ -74,7 +74,7 @@ template<class T> struct sp_typeid_ ...@@ -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 > template<class T> struct sp_typeid_< T & >: sp_typeid_< T >
{ {
......
...@@ -65,6 +65,11 @@ ...@@ -65,6 +65,11 @@
#else #else
#define BOOST_MSVC_WORKAROUND_GUARD 0 #define BOOST_MSVC_WORKAROUND_GUARD 0
#endif #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__ #ifndef __GNUC__
#define __GNUC___WORKAROUND_GUARD 1 #define __GNUC___WORKAROUND_GUARD 1
#else #else
......
...@@ -31,8 +31,9 @@ ...@@ -31,8 +31,9 @@
// Some compilers let us detect even const-qualified rvalues at compile-time // Some compilers let us detect even const-qualified rvalues at compile-time
#if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_) \ #if BOOST_WORKAROUND(BOOST_MSVC, >= 1310) && !defined(_PREFAST_) \
|| (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL)) \ || (BOOST_WORKAROUND(__GNUC__, >= 4) && !defined(BOOST_INTEL) && !defined(BOOST_CLANG)) \
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL)) || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ >= 4) && !defined(BOOST_INTEL) && \
!defined(BOOST_CLANG))
# define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION # define BOOST_FOREACH_COMPILE_TIME_CONST_RVALUE_DETECTION
#else #else
// Some compilers allow temporaries to be bound to non-const references. // Some compilers allow temporaries to be bound to non-const references.
...@@ -41,7 +42,7 @@ ...@@ -41,7 +42,7 @@
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \ # if BOOST_WORKAROUND(BOOST_MSVC, <= 1300) \
|| BOOST_WORKAROUND(__BORLANDC__, < 0x593) \ || BOOST_WORKAROUND(__BORLANDC__, < 0x593) \
|| (BOOST_WORKAROUND(BOOST_INTEL_CXX_VERSION, <= 700) && defined(_MSC_VER)) \ || (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) || BOOST_WORKAROUND(__DECCXX_VER, <= 60590042)
# define BOOST_FOREACH_NO_RVALUE_DETECTION # define BOOST_FOREACH_NO_RVALUE_DETECTION
# endif # endif
...@@ -56,6 +57,7 @@ ...@@ -56,6 +57,7 @@
|| (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \ || (BOOST_WORKAROUND(__GNUC__, == 3) && (__GNUC_MINOR__ <= 3) && defined(__APPLE_CC__)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \ || BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(600)) \
|| BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \ || BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3206)) \
|| BOOST_WORKAROUND(__SUNPRO_CC, >= 0x5100) \
|| BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590)) || BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x590))
# define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION # define BOOST_FOREACH_NO_CONST_RVALUE_DETECTION
# else # else
...@@ -80,6 +82,7 @@ ...@@ -80,6 +82,7 @@
#include <boost/type_traits/is_base_and_derived.hpp> #include <boost/type_traits/is_base_and_derived.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
#include <boost/utility/addressof.hpp> #include <boost/utility/addressof.hpp>
#include <boost/foreach_fwd.hpp>
#ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION #ifdef BOOST_FOREACH_RUN_TIME_CONST_RVALUE_DETECTION
# include <new> # include <new>
...@@ -88,12 +91,6 @@ ...@@ -88,12 +91,6 @@
# include <boost/type_traits/remove_const.hpp> # include <boost/type_traits/remove_const.hpp>
#endif #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 namespace boost
{ {
...@@ -116,11 +113,6 @@ namespace foreach ...@@ -116,11 +113,6 @@ namespace foreach
return std::make_pair(begin, end); return std::make_pair(begin, end);
} }
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::tag
//
typedef boost_foreach_argument_dependent_lookup_hack tag;
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// boost::foreach::is_lightweight_proxy // boost::foreach::is_lightweight_proxy
// Specialize this for user-defined collection types if they are inexpensive to copy. // 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 *) ...@@ -705,7 +697,7 @@ end(auto_any_t col, type2type<T, const_> *, bool *)
#ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING #ifndef BOOST_NO_FUNCTION_TEMPLATE_ORDERING
template<typename T, typename C> template<typename T, typename C>
inline auto_any<int> 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 return 0; // not used
} }
......
///////////////////////////////////////////////////////////////////////////////
// foreach.hpp header file
//
// Copyright 2010 Eric Niebler.
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt)
// See http://www.boost.org/libs/foreach for documentation
//
// Credits:
// Kazutoshi Satoda: for suggesting the need for a _fwd header for foreach's
// customization points.
#ifndef BOOST_FOREACH_FWD_HPP
#define BOOST_FOREACH_FWD_HPP
// 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
{
namespace foreach
{
///////////////////////////////////////////////////////////////////////////////
// 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.
// This tells BOOST_FOREACH it can avoid the rvalue/lvalue detection stuff.
template<typename T>
struct is_lightweight_proxy;
///////////////////////////////////////////////////////////////////////////////
// boost::foreach::is_noncopyable
// Specialize this for user-defined collection types if they cannot be copied.
// This also tells BOOST_FOREACH to avoid the rvalue/lvalue detection stuff.
template<typename T>
struct is_noncopyable;
} // namespace foreach
} // namespace boost
#endif
...@@ -7,7 +7,6 @@ ...@@ -7,7 +7,6 @@
#ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #ifndef BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP #define BOOST_TRANSFORM_ITERATOR_23022003THW_HPP
#include <boost/function.hpp>
#include <boost/iterator.hpp> #include <boost/iterator.hpp>
#include <boost/iterator/detail/enable_if.hpp> #include <boost/iterator/detail/enable_if.hpp>
#include <boost/iterator/iterator_adaptor.hpp> #include <boost/iterator/iterator_adaptor.hpp>
......
...@@ -11,9 +11,9 @@ ...@@ -11,9 +11,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: has_xxx.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Id: has_xxx.hpp 63518 2010-07-02 08:32:03Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ // $Date: 2010-07-02 04:32:03 -0400 (Fri, 02 Jul 2010) $
// $Revision: 49267 $ // $Revision: 63518 $
#include <boost/mpl/aux_/config/overload_resolution.hpp> #include <boost/mpl/aux_/config/overload_resolution.hpp>
#include <boost/mpl/aux_/config/workaround.hpp> #include <boost/mpl/aux_/config/workaround.hpp>
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
) )
# define BOOST_MPL_CFG_NO_HAS_XXX # define BOOST_MPL_CFG_NO_HAS_XXX
# define BOOST_MPL_CFG_NO_HAS_XXX_TEMPLATE
#endif #endif
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_BITAND_HPP_INCLUDED #ifndef BOOST_MPL_BITAND_HPP_INCLUDED
#define 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 // Copyright Jaap Suter 2003
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
...@@ -11,13 +11,35 @@ ...@@ -11,13 +11,35 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: bitand.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Id: bitand.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ // $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
// $Revision: 49267 $ // $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_NAME bitand_
#define AUX778076_OP_PREFIX bitand #define AUX778076_OP_PREFIX bitand
#define AUX778076_OP_TOKEN & #define AUX778076_OP_TOKEN &
#include <boost/mpl/aux_/arithmetic_op.hpp> #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 #endif // BOOST_MPL_BITAND_HPP_INCLUDED
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_BITOR_HPP_INCLUDED #ifndef BOOST_MPL_BITOR_HPP_INCLUDED
#define 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 // Copyright Jaap Suter 2003
// //
// Distributed under the Boost Software License, Version 1.0. // Distributed under the Boost Software License, Version 1.0.
...@@ -11,13 +11,35 @@ ...@@ -11,13 +11,35 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: bitor.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Id: bitor.hpp 63520 2010-07-02 08:59:55Z agurtovoy $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ // $Date: 2010-07-02 04:59:55 -0400 (Fri, 02 Jul 2010) $
// $Revision: 49267 $ // $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_NAME bitor_
#define AUX778076_OP_PREFIX bitor #define AUX778076_OP_PREFIX bitor
#define AUX778076_OP_TOKEN | #define AUX778076_OP_TOKEN |
#include <boost/mpl/aux_/arithmetic_op.hpp> #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 #endif // BOOST_MPL_BITOR_HPP_INCLUDED
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
// //
// See http://www.boost.org/libs/mpl for documentation. // See http://www.boost.org/libs/mpl for documentation.
// $Id: eval_if.hpp 49267 2008-10-11 06:19:02Z agurtovoy $ // $Id: eval_if.hpp 61921 2010-05-11 21:33:24Z neilgroves $
// $Date: 2008-10-11 02:19:02 -0400 (Sat, 11 Oct 2008) $ // $Date: 2010-05-11 17:33:24 -0400 (Tue, 11 May 2010) $
// $Revision: 49267 $ // $Revision: 61921 $
#include <boost/mpl/if.hpp> #include <boost/mpl/if.hpp>
#include <boost/mpl/aux_/na_spec.hpp> #include <boost/mpl/aux_/na_spec.hpp>
......
This diff is collapsed.
...@@ -240,6 +240,18 @@ namespace boost { namespace mpl ...@@ -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> template<typename Tag>
struct pop_back_impl; struct pop_back_impl;
...@@ -267,6 +279,18 @@ namespace boost { namespace mpl ...@@ -267,6 +279,18 @@ namespace boost { namespace mpl
#undef M0 #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> template<typename Tag>
struct push_front_impl; struct push_front_impl;
...@@ -341,6 +365,18 @@ namespace boost { namespace mpl ...@@ -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> template<typename Tag>
struct pop_front_impl; struct pop_front_impl;
...@@ -375,6 +411,18 @@ namespace boost { namespace mpl ...@@ -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> template<typename Tag>
struct insert_range_impl; struct insert_range_impl;
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
namespace boost namespace boost
{ {
namespace range_detail namespace range_detail
{ {
template< class Iter, class Pred, bool default_pass > template< class Iter, class Pred, bool default_pass >
...@@ -140,10 +139,14 @@ namespace boost ...@@ -140,10 +139,14 @@ namespace boost
public: public:
adjacent_filter_range( const P& p, R& r ) adjacent_filter_range( const P& p, R& r )
: base_range( skip_iter( boost::begin(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) ) skip_iter(boost::end(r), boost::end(r), p))
{ {
} }
private:
P m_pred;
R* m_range;
}; };
template< class T > template< class T >
......
...@@ -25,7 +25,7 @@ namespace boost ...@@ -25,7 +25,7 @@ namespace boost
template< class Map > template< class Map >
struct select_first struct select_first
{ {
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type& typedef const BOOST_DEDUCED_TYPENAME pair_t::first_type&
result_type; result_type;
...@@ -38,7 +38,7 @@ namespace boost ...@@ -38,7 +38,7 @@ namespace boost
template< class Map > template< class Map >
struct select_second_mutable struct select_second_mutable
{ {
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type; typedef BOOST_DEDUCED_TYPENAME pair_t::second_type& result_type;
result_type operator()( pair_t& r ) const result_type operator()( pair_t& r ) const
...@@ -50,7 +50,7 @@ namespace boost ...@@ -50,7 +50,7 @@ namespace boost
template< class Map > template< class Map >
struct select_second_const struct select_second_const
{ {
typedef BOOST_DEDUCED_TYPENAME Map::value_type pair_t; typedef BOOST_DEDUCED_TYPENAME range_value<Map>::type pair_t;
typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type& typedef const BOOST_DEDUCED_TYPENAME pair_t::second_type&
result_type; result_type;
......
...@@ -47,7 +47,7 @@ namespace boost ...@@ -47,7 +47,7 @@ namespace boost
}; };
template< class R > template< class R >
class replace_range : class replaced_range :
public boost::iterator_range< public boost::iterator_range<
boost::transform_iterator< boost::transform_iterator<
replace_value< BOOST_DEDUCED_TYPENAME range_value<R>::type >, replace_value< BOOST_DEDUCED_TYPENAME range_value<R>::type >,
...@@ -64,7 +64,7 @@ namespace boost ...@@ -64,7 +64,7 @@ namespace boost
public: public:
typedef BOOST_DEDUCED_TYPENAME range_value<R>::type value_type; 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) ), : base_t( make_transform_iterator( boost::begin(r), Fn(from, to) ),
make_transform_iterator( boost::end(r), Fn(from, to) ) ) make_transform_iterator( boost::end(r), Fn(from, to) ) )
{ } { }
...@@ -83,23 +83,23 @@ namespace boost ...@@ -83,23 +83,23 @@ namespace boost
}; };
template< class InputRng > template< class InputRng >
inline replace_range<InputRng> inline replaced_range<InputRng>
operator|( InputRng& r, operator|( InputRng& r,
const replace_holder<BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f ) 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 > template< class InputRng >
inline replace_range<const InputRng> inline replaced_range<const InputRng>
operator|( const InputRng& r, operator|( const InputRng& r,
const replace_holder<BOOST_DEDUCED_TYPENAME range_value<InputRng>::type>& f ) 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' } // 'range_detail'
using range_detail::replace_range; using range_detail::replaced_range;
namespace adaptors namespace adaptors
{ {
...@@ -111,21 +111,21 @@ namespace boost ...@@ -111,21 +111,21 @@ namespace boost
} }
template<class InputRange> template<class InputRange>
inline replace_range<InputRange> inline replaced_range<InputRange>
replace(InputRange& rng, replace(InputRange& rng,
BOOST_DEDUCED_TYPENAME range_value<InputRange>::type from, BOOST_DEDUCED_TYPENAME range_value<InputRange>::type from,
BOOST_DEDUCED_TYPENAME range_value<InputRange>::type to) 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> template<class InputRange>
inline replace_range<const InputRange> inline replaced_range<const InputRange>
replace(const InputRange& rng, replace(const InputRange& rng,
BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type from, BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type from,
BOOST_DEDUCED_TYPENAME range_value<const InputRange>::type to) 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' } // 'adaptors'
......
...@@ -28,14 +28,26 @@ namespace boost ...@@ -28,14 +28,26 @@ namespace boost
}; };
template< class RandomAccessRange > 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 ) slice( RandomAccessRange& rng, std::size_t t, std::size_t u )
{ {
BOOST_ASSERT( t <= u && "error in slice indices" ); BOOST_ASSERT( t <= u && "error in slice indices" );
BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u && BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u &&
"second slice index out of bounds" ); "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 > template< class RandomAccessRange >
...@@ -46,23 +58,21 @@ namespace boost ...@@ -46,23 +58,21 @@ namespace boost
BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u && BOOST_ASSERT( static_cast<std::size_t>(boost::size(rng)) >= u &&
"second slice index out of bounds" ); "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 > template< class RandomAccessRange >
inline iterator_range< inline sliced_range<RandomAccessRange>
BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type >
operator|( RandomAccessRange& r, const sliced& f ) 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 > template< class RandomAccessRange >
inline iterator_range< inline sliced_range<const RandomAccessRange>
BOOST_DEDUCED_TYPENAME range_iterator<const RandomAccessRange>::type >
operator|( const RandomAccessRange& r, const sliced& f ) 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 } // namespace adaptors
......
...@@ -30,7 +30,7 @@ namespace boost ...@@ -30,7 +30,7 @@ namespace boost
template< class SinglePassRange, class OutputIterator > template< class SinglePassRange, class OutputIterator >
inline OutputIterator copy(const SinglePassRange& rng, OutputIterator out) 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); return std::copy(boost::begin(rng),boost::end(rng),out);
} }
......
...@@ -32,7 +32,7 @@ inline BidirectionalTraversalWriteableIterator ...@@ -32,7 +32,7 @@ inline BidirectionalTraversalWriteableIterator
copy_backward(const BidirectionalRange& rng, copy_backward(const BidirectionalRange& rng,
BidirectionalTraversalWriteableIterator out) 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); return std::copy_backward(boost::begin(rng), boost::end(rng), out);
} }
......
...@@ -159,8 +159,8 @@ namespace boost ...@@ -159,8 +159,8 @@ namespace boost
template< class SinglePassRange1, class SinglePassRange2 > template< class SinglePassRange1, class SinglePassRange2 >
inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 ) inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2 )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
return ::boost::range_detail::equal( return ::boost::range_detail::equal(
::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng1), ::boost::end(rng1),
...@@ -172,8 +172,8 @@ namespace boost ...@@ -172,8 +172,8 @@ namespace boost
inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2, inline bool equal( const SinglePassRange1& rng1, const SinglePassRange2& rng2,
BinaryPredicate pred ) BinaryPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
return ::boost::range_detail::equal( return ::boost::range_detail::equal(
::boost::begin(rng1), ::boost::end(rng1), ::boost::begin(rng1), ::boost::end(rng1),
......
...@@ -33,6 +33,15 @@ inline ForwardRange& fill(ForwardRange& rng, const Value& val) ...@@ -33,6 +33,15 @@ inline ForwardRange& fill(ForwardRange& rng, const Value& val)
return rng; 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 } // namespace range
using range::fill; using range::fill;
} }
......
...@@ -36,6 +36,16 @@ inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val) ...@@ -36,6 +36,16 @@ inline ForwardRange& fill_n(ForwardRange& rng, Size n, const Value& val)
return rng; 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 } // namespace range
using range::fill_n; using range::fill_n;
} // namespace boost } // namespace boost
......
...@@ -27,18 +27,33 @@ namespace boost ...@@ -27,18 +27,33 @@ namespace boost
/// ///
/// \pre SinglePassRange is a model of the SinglePassRangeConcept /// \pre SinglePassRange is a model of the SinglePassRangeConcept
template< class SinglePassRange, class Value > 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 ) find( SinglePassRange& rng, const Value& val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::find(boost::begin(rng), boost::end(rng), val); 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 // range_return overloads
/// \overload /// \overload
template< range_return_value re, class SinglePassRange, class Value > 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 ) find( SinglePassRange& rng, const Value& val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
...@@ -47,6 +62,17 @@ find( SinglePassRange& rng, const Value& val ) ...@@ -47,6 +62,17 @@ find( SinglePassRange& rng, const Value& val )
rng); 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 } // namespace range
using range::find; using range::find;
} }
......
...@@ -29,7 +29,10 @@ namespace boost ...@@ -29,7 +29,10 @@ namespace boost
/// \pre ForwardRange2 is a model of the ForwardRangeConcept /// \pre ForwardRange2 is a model of the ForwardRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template< class ForwardRange1, class ForwardRange2 > 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) find_end(ForwardRange1 & rng1, const ForwardRange2& rng2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
...@@ -39,9 +42,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2) ...@@ -39,9 +42,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2)
boost::begin(rng2),boost::end(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 /// \overload
template< class ForwardRange1, class ForwardRange2, class BinaryPredicate > 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) find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
...@@ -51,9 +69,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred) ...@@ -51,9 +69,24 @@ find_end(ForwardRange1 & rng1, const ForwardRange2& rng2, BinaryPredicate pred)
boost::begin(rng2),boost::end(rng2),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 /// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2 > 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) find_end(ForwardRange1& rng1, const ForwardRange2& rng2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
...@@ -65,10 +98,27 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2) ...@@ -65,10 +98,27 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2)
rng1); 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 /// \overload
template< range_return_value re, class ForwardRange1, class ForwardRange2, template< range_return_value re, class ForwardRange1, class ForwardRange2,
class BinaryPredicate > 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) find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange1> ));
...@@ -80,6 +130,21 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred) ...@@ -80,6 +130,21 @@ find_end(ForwardRange1& rng1, const ForwardRange2& rng2, BinaryPredicate pred)
rng1); 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 } // namespace range
using range::find_end; using range::find_end;
} // namespace boost } // namespace boost
......
...@@ -29,7 +29,10 @@ namespace boost ...@@ -29,7 +29,10 @@ namespace boost
/// \pre ForwardRange2 is a model of the ForwardRangeConcept /// \pre ForwardRange2 is a model of the ForwardRangeConcept
/// \pre BinaryPredicate is a model of the BinaryPredicateConcept /// \pre BinaryPredicate is a model of the BinaryPredicateConcept
template< class SinglePassRange1, class ForwardRange2 > 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) find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
...@@ -39,9 +42,24 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2) ...@@ -39,9 +42,24 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2)
boost::begin(rng2),boost::end(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 /// \overload
template< class SinglePassRange1, class ForwardRange2, class BinaryPredicate > 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) find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredicate pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
...@@ -51,10 +69,25 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredica ...@@ -51,10 +69,25 @@ find_first_of(SinglePassRange1 & rng1, ForwardRange2 const & rng2, BinaryPredica
boost::begin(rng2),boost::end(rng2),pred); 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 // range return overloads
/// \overload /// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2 > 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) find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
...@@ -66,10 +99,27 @@ find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2) ...@@ -66,10 +99,27 @@ find_first_of(SinglePassRange1& rng1, const ForwardRange2& rng2)
rng1); 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 /// \overload
template< range_return_value re, class SinglePassRange1, class ForwardRange2, template< range_return_value re, class SinglePassRange1, class ForwardRange2,
class BinaryPredicate > 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, find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2,
BinaryPredicate pred) BinaryPredicate pred)
{ {
...@@ -82,6 +132,22 @@ find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2, ...@@ -82,6 +132,22 @@ find_first_of(SinglePassRange1 & rng1, const ForwardRange2& rng2,
rng1); 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 } // namespace range
using range::find_first_of; using range::find_first_of;
} // namespace boost } // namespace boost
......
...@@ -28,18 +28,33 @@ namespace boost ...@@ -28,18 +28,33 @@ namespace boost
/// \pre SinglePassRange is a model of the SinglePassRangeConcept /// \pre SinglePassRange is a model of the SinglePassRangeConcept
/// \pre UnaryPredicate is a model of the UnaryPredicateConcept /// \pre UnaryPredicate is a model of the UnaryPredicateConcept
template< class SinglePassRange, class UnaryPredicate > 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 ) find_if( SinglePassRange& rng, UnaryPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::find_if(boost::begin(rng), boost::end(rng), pred); 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 // range_return overloads
/// \overload /// \overload
template< range_return_value re, class SinglePassRange, class UnaryPredicate > 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 ) find_if( SinglePassRange& rng, UnaryPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
...@@ -48,6 +63,17 @@ find_if( SinglePassRange& rng, UnaryPredicate pred ) ...@@ -48,6 +63,17 @@ find_if( SinglePassRange& rng, UnaryPredicate pred )
rng); 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 } // namespace range
using range::find_if; using range::find_if;
} // namespace boost } // namespace boost
......
...@@ -33,6 +33,15 @@ inline ForwardRange& generate( ForwardRange& rng, Generator gen ) ...@@ -33,6 +33,15 @@ inline ForwardRange& generate( ForwardRange& rng, Generator gen )
return rng; 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 } // namespace range
using range::generate; using range::generate;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng) ...@@ -34,6 +34,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class Compare> template<class RandomAccessRange, class Compare>
inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred)
...@@ -43,6 +52,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred) ...@@ -43,6 +52,15 @@ inline RandomAccessRange& push_heap(RandomAccessRange& rng, Compare comp_pred)
return rng; 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 /// \brief template function pop_heap
/// ///
/// range-based version of the pop_heap std algorithm /// range-based version of the pop_heap std algorithm
...@@ -57,6 +75,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng) ...@@ -57,6 +75,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class Compare> template<class RandomAccessRange, class Compare>
inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred)
...@@ -66,6 +93,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred) ...@@ -66,6 +93,15 @@ inline RandomAccessRange& pop_heap(RandomAccessRange& rng, Compare comp_pred)
return rng; 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 /// \brief template function make_heap
/// ///
/// range-based version of the make_heap std algorithm /// range-based version of the make_heap std algorithm
...@@ -80,6 +116,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng) ...@@ -80,6 +116,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class Compare> template<class RandomAccessRange, class Compare>
inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred)
...@@ -89,6 +134,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred) ...@@ -89,6 +134,15 @@ inline RandomAccessRange& make_heap(RandomAccessRange& rng, Compare comp_pred)
return rng; 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 /// \brief template function sort_heap
/// ///
/// range-based version of the sort_heap std algorithm /// range-based version of the sort_heap std algorithm
...@@ -103,6 +157,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng) ...@@ -103,6 +157,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class Compare> template<class RandomAccessRange, class Compare>
inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred)
...@@ -112,6 +175,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred) ...@@ -112,6 +175,15 @@ inline RandomAccessRange& sort_heap(RandomAccessRange& rng, Compare comp_pred)
return rng; 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 } // namespace range
using range::push_heap; using range::push_heap;
using range::pop_heap; using range::pop_heap;
......
...@@ -27,23 +27,52 @@ namespace boost ...@@ -27,23 +27,52 @@ namespace boost
/// ///
/// \pre ForwardRange is a model of the ForwardRangeConcept /// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class Value > 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 ) lower_bound( ForwardRange& rng, Value val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val); 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 /// \overload
template< class ForwardRange, class Value, class SortPredicate > 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 ) lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::lower_bound(boost::begin(rng), boost::end(rng), val, pred); 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 /// \overload
template< range_return_value re, class ForwardRange, class Value > 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 ) lower_bound( ForwardRange& rng, Value val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
...@@ -51,9 +80,24 @@ lower_bound( ForwardRange& rng, Value val ) ...@@ -51,9 +80,24 @@ lower_bound( ForwardRange& rng, Value val )
pack(std::lower_bound(boost::begin(rng), boost::end(rng), val), pack(std::lower_bound(boost::begin(rng), boost::end(rng), val),
rng); 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 /// \overload
template< range_return_value re, class ForwardRange, class Value, class SortPredicate > 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 ) lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
...@@ -62,6 +106,17 @@ lower_bound( ForwardRange& rng, Value val, SortPredicate pred ) ...@@ -62,6 +106,17 @@ lower_bound( ForwardRange& rng, Value val, SortPredicate pred )
rng); 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 } // namespace range
using range::lower_bound; using range::lower_bound;
} // namespace boost } // namespace boost
......
...@@ -35,6 +35,16 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng, ...@@ -35,6 +35,16 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
return 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 /// \overload
template<class RandomAccessRange, class BinaryPredicate> template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& partial_sort(RandomAccessRange& rng, inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
...@@ -47,6 +57,18 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng, ...@@ -47,6 +57,18 @@ inline RandomAccessRange& partial_sort(RandomAccessRange& rng,
return 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 } // namespace range
using range::partial_sort; using range::partial_sort;
} // namespace boost } // namespace boost
......
...@@ -32,7 +32,18 @@ template<class SinglePassRange, class RandomAccessRange> ...@@ -32,7 +32,18 @@ template<class SinglePassRange, class RandomAccessRange>
inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2) 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), return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2)); boost::begin(rng2), boost::end(rng2));
...@@ -45,7 +56,20 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type ...@@ -45,7 +56,20 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<RandomAccessRange>::type
partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2, partial_sort_copy(const SinglePassRange& rng1, RandomAccessRange& rng2,
BinaryPredicate pred) 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), return std::partial_sort_copy(boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), boost::end(rng2), pred); boost::begin(rng2), boost::end(rng2), pred);
......
...@@ -34,6 +34,15 @@ partition(ForwardRange& rng, UnaryPredicate pred) ...@@ -34,6 +34,15 @@ partition(ForwardRange& rng, UnaryPredicate pred)
return std::partition(boost::begin(rng),boost::end(rng),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 // range_return overloads
/// \overload /// \overload
...@@ -47,6 +56,17 @@ partition(ForwardRange& rng, UnaryPredicate pred) ...@@ -47,6 +56,17 @@ partition(ForwardRange& rng, UnaryPredicate pred)
pack(std::partition(boost::begin(rng), boost::end(rng), pred), rng); 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 } // namespace range
using range::partition; using range::partition;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng) ...@@ -34,6 +34,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class Generator> template<class RandomAccessRange, class Generator>
inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen) inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen)
...@@ -43,6 +52,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen) ...@@ -43,6 +52,15 @@ inline RandomAccessRange& random_shuffle(RandomAccessRange& rng, Generator& gen)
return rng; 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 } // namespace range
using range::random_shuffle; using range::random_shuffle;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,15 @@ remove(ForwardRange& rng, const Value& val) ...@@ -34,6 +34,15 @@ remove(ForwardRange& rng, const Value& val)
return std::remove(boost::begin(rng),boost::end(rng),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 // range_return overloads
/// \overload /// \overload
...@@ -47,6 +56,17 @@ remove(ForwardRange& rng, const Value& val) ...@@ -47,6 +56,17 @@ remove(ForwardRange& rng, const Value& val)
rng); 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 } // namespace range
using range::remove; using range::remove;
} // namespace boost } // namespace boost
......
...@@ -31,9 +31,9 @@ namespace boost ...@@ -31,9 +31,9 @@ namespace boost
/// InputIterator's value type. /// InputIterator's value type.
template< class SinglePassRange, class OutputIterator, class Value > template< class SinglePassRange, class OutputIterator, class Value >
inline OutputIterator 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); return std::remove_copy(boost::begin(rng), boost::end(rng), out_it, val);
} }
......
...@@ -28,9 +28,9 @@ namespace boost ...@@ -28,9 +28,9 @@ namespace boost
/// \pre out_it is not an iterator in the range rng /// \pre out_it is not an iterator in the range rng
template< class SinglePassRange, class OutputIterator, class Predicate > template< class SinglePassRange, class OutputIterator, class Predicate >
inline OutputIterator 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> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred); return std::remove_copy_if(boost::begin(rng), boost::end(rng), out_it, pred);
} }
} }
......
...@@ -35,6 +35,15 @@ remove_if(ForwardRange& rng, UnaryPredicate pred) ...@@ -35,6 +35,15 @@ remove_if(ForwardRange& rng, UnaryPredicate pred)
return std::remove_if(boost::begin(rng), boost::end(rng), 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 // range_return overloads
/// \overload /// \overload
...@@ -48,6 +57,17 @@ remove_if(ForwardRange& rng, UnaryPredicate pred) ...@@ -48,6 +57,17 @@ remove_if(ForwardRange& rng, UnaryPredicate pred)
rng); 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 } // namespace range
using range::remove_if; using range::remove_if;
} // namespace boost } // namespace boost
......
...@@ -35,6 +35,17 @@ replace(ForwardRange& rng, const Value& what, ...@@ -35,6 +35,17 @@ replace(ForwardRange& rng, const Value& what,
return rng; 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 } // namespace range
using range::replace; using range::replace;
} // namespace boost; } // namespace boost;
......
...@@ -27,10 +27,10 @@ namespace boost ...@@ -27,10 +27,10 @@ namespace boost
/// \pre ForwardRange is a model of the ForwardRangeConcept /// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class OutputIterator, class Value > template< class ForwardRange, class OutputIterator, class Value >
inline OutputIterator 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) 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, return std::replace_copy(boost::begin(rng), boost::end(rng), out_it,
what, with_what); what, with_what);
} }
......
...@@ -31,10 +31,10 @@ namespace boost ...@@ -31,10 +31,10 @@ namespace boost
/// \pre Value is convertible to a type in OutputIterator's set of value types. /// \pre Value is convertible to a type in OutputIterator's set of value types.
template< class ForwardRange, class OutputIterator, class Predicate, class Value > template< class ForwardRange, class OutputIterator, class Predicate, class Value >
inline OutputIterator 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) 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, return std::replace_copy_if(boost::begin(rng), boost::end(rng), out_it,
pred, with_what); pred, with_what);
} }
......
...@@ -36,6 +36,17 @@ inline ForwardRange& ...@@ -36,6 +36,17 @@ inline ForwardRange&
return rng; 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 } // namespace range
using range::replace_if; using range::replace_if;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,15 @@ inline BidirectionalRange& reverse(BidirectionalRange& rng) ...@@ -34,6 +34,15 @@ inline BidirectionalRange& reverse(BidirectionalRange& rng)
return 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 } // namespace range
using range::reverse; using range::reverse;
} // namespace boost } // namespace boost
......
...@@ -29,7 +29,7 @@ namespace boost ...@@ -29,7 +29,7 @@ namespace boost
template<class BidirectionalRange, class OutputIterator> template<class BidirectionalRange, class OutputIterator>
inline OutputIterator reverse_copy(const BidirectionalRange& rng, OutputIterator out) 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); return std::reverse_copy(boost::begin(rng), boost::end(rng), out);
} }
......
...@@ -34,6 +34,16 @@ inline ForwardRange& rotate(ForwardRange& rng, ...@@ -34,6 +34,16 @@ inline ForwardRange& rotate(ForwardRange& rng,
return 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 } // namespace range
using range::rotate; using range::rotate;
} // namespace boost } // namespace boost
......
...@@ -44,7 +44,7 @@ template< class ForwardRange, class Integer, class Value > ...@@ -44,7 +44,7 @@ template< class ForwardRange, class Integer, class Value >
inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
search_n(const ForwardRange& rng, Integer count, const Value& value) 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); 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 ...@@ -69,7 +69,7 @@ inline BOOST_DEDUCED_TYPENAME range_iterator<const ForwardRange>::type
search_n(const ForwardRange& rng, Integer count, const Value& value, search_n(const ForwardRange& rng, Integer count, const Value& value,
BinaryPredicate binary_pred) BinaryPredicate binary_pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>)); BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate, BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type, const Value&>)); BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type, const Value&>));
return std::search_n(boost::begin(rng), boost::end(rng), return std::search_n(boost::begin(rng), boost::end(rng),
...@@ -97,7 +97,7 @@ template< range_return_value re, class ForwardRange, class Integer, ...@@ -97,7 +97,7 @@ template< range_return_value re, class ForwardRange, class Integer,
inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
search_n(const ForwardRange& rng, Integer count, const Value& value) 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>:: return range_return<const ForwardRange,re>::
pack(std::search_n(boost::begin(rng), boost::end(rng), pack(std::search_n(boost::begin(rng), boost::end(rng),
count, value), count, value),
...@@ -128,7 +128,7 @@ inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type ...@@ -128,7 +128,7 @@ inline BOOST_DEDUCED_TYPENAME range_return<const ForwardRange,re>::type
search_n(const ForwardRange& rng, Integer count, const Value& value, search_n(const ForwardRange& rng, Integer count, const Value& value,
BinaryPredicate pred) BinaryPredicate pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<ForwardRange>)); BOOST_RANGE_CONCEPT_ASSERT((ForwardRangeConcept<const ForwardRange>));
BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate, BOOST_RANGE_CONCEPT_ASSERT((BinaryPredicateConcept<BinaryPredicate,
BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type, BOOST_DEDUCED_TYPENAME range_value<const ForwardRange>::type,
const Value&>)); const Value&>));
......
...@@ -34,6 +34,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng) ...@@ -34,6 +34,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class BinaryPredicate> template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred) inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred)
...@@ -43,6 +52,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred) ...@@ -43,6 +52,15 @@ inline RandomAccessRange& sort(RandomAccessRange& rng, BinaryPredicate pred)
return rng; 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 } // namespace range
using range::sort; using range::sort;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng) ...@@ -34,6 +34,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng)
return 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 /// \overload
template<class RandomAccessRange, class BinaryPredicate> template<class RandomAccessRange, class BinaryPredicate>
inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate sort_pred) inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate sort_pred)
...@@ -43,6 +52,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate so ...@@ -43,6 +52,15 @@ inline RandomAccessRange& stable_sort(RandomAccessRange& rng, BinaryPredicate so
return rng; 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 } // namespace range
using range::stable_sort; using range::stable_sort;
} // namespace boost } // namespace boost
......
...@@ -80,6 +80,51 @@ swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2) ...@@ -80,6 +80,51 @@ swap_ranges(SinglePassRange1& range1, SinglePassRange2& range2)
return 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 } // namespace range
using range::swap_ranges; using range::swap_ranges;
} // namespace boost } // namespace boost
......
...@@ -27,24 +27,53 @@ namespace boost ...@@ -27,24 +27,53 @@ namespace boost
/// ///
/// \pre ForwardRange is a model of the ForwardRangeConcept /// \pre ForwardRange is a model of the ForwardRangeConcept
template< class ForwardRange, class Value > 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 ) upper_bound( ForwardRange& rng, Value val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val); return std::upper_bound(boost::begin(rng), boost::end(rng), val);
} }
/// \overload /// \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 /// \overload
template< class ForwardRange, class Value, class SortPredicate > 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 ) upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
return std::upper_bound(boost::begin(rng), boost::end(rng), val, pred); 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 /// \overload
template< range_return_value re, class ForwardRange, class Value > 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 ) upper_bound( ForwardRange& rng, Value val )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
...@@ -52,10 +81,25 @@ upper_bound( ForwardRange& rng, Value val ) ...@@ -52,10 +81,25 @@ upper_bound( ForwardRange& rng, Value val )
pack(std::upper_bound(boost::begin(rng), boost::end(rng), val), pack(std::upper_bound(boost::begin(rng), boost::end(rng), val),
rng); 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 /// \overload
template< range_return_value re, class ForwardRange, class Value, template< range_return_value re, class ForwardRange, class Value,
class SortPredicate > 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 ) upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
{ {
BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> )); BOOST_RANGE_CONCEPT_ASSERT(( ForwardRangeConcept<ForwardRange> ));
...@@ -64,6 +108,18 @@ upper_bound( ForwardRange& rng, Value val, SortPredicate pred ) ...@@ -64,6 +108,18 @@ upper_bound( ForwardRange& rng, Value val, SortPredicate pred )
rng); 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 } // namespace range
using range::upper_bound; using range::upper_bound;
} // namespace boost } // namespace boost
......
...@@ -34,6 +34,19 @@ inline ForwardRange& iota( ForwardRange& rng, Value x ) ...@@ -34,6 +34,19 @@ inline ForwardRange& iota( ForwardRange& rng, Value x )
return rng; 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 } // namespace range
using range::iota; using range::iota;
} // namespace boost } // namespace boost
......
...@@ -51,7 +51,7 @@ template<class SinglePassRange> ...@@ -51,7 +51,7 @@ template<class SinglePassRange>
inline bool is_sorted(const SinglePassRange& rng) inline bool is_sorted(const SinglePassRange& rng)
{ {
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const SinglePassRange>)); 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)); return range_detail::is_sorted(boost::begin(rng), boost::end(rng));
} }
...@@ -59,8 +59,8 @@ inline bool is_sorted(const SinglePassRange& rng) ...@@ -59,8 +59,8 @@ inline bool is_sorted(const SinglePassRange& rng)
template<class SinglePassRange, class BinaryPredicate> template<class SinglePassRange, class BinaryPredicate>
inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred) inline bool is_sorted(const SinglePassRange& rng, BinaryPredicate pred)
{ {
BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<SinglePassRange>)); BOOST_RANGE_CONCEPT_ASSERT((SinglePassRangeConcept<const 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((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); return range_detail::is_sorted(boost::begin(rng), boost::end(rng), pred);
} }
......
...@@ -50,6 +50,33 @@ inline void overwrite( const SinglePassRange1& from, SinglePassRange2& to ) ...@@ -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 } // namespace range
using range::overwrite; using range::overwrite;
} // namespace boost } // namespace boost
......
...@@ -12,9 +12,9 @@ ...@@ -12,9 +12,9 @@
#define BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED #define BOOST_RANGE_DETAIL_JOIN_ITERATOR_HPP_INCLUDED
#include <iterator> #include <iterator>
#include <boost/assert.hpp>
#include <boost/iterator/iterator_traits.hpp> #include <boost/iterator/iterator_traits.hpp>
#include <boost/iterator/iterator_facade.hpp> #include <boost/iterator/iterator_facade.hpp>
#include <boost/intrusive_ptr.hpp>
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
#include <boost/range/empty.hpp> #include <boost/range/empty.hpp>
...@@ -30,21 +30,6 @@ namespace boost ...@@ -30,21 +30,6 @@ namespace boost
template<typename Iterator1, typename Iterator2> template<typename Iterator1, typename Iterator2>
struct join_iterator_link 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: public:
join_iterator_link(Iterator1 last1, Iterator2 first2) join_iterator_link(Iterator1 last1, Iterator2 first2)
: last1(last1) : last1(last1)
...@@ -52,43 +37,13 @@ public: ...@@ -52,43 +37,13 @@ public:
{ {
} }
void add_reference() const
{
count.increment();
}
bool release_reference() const
{
return count.decrement();
}
Iterator1 last1; Iterator1 last1;
Iterator2 first2; Iterator2 first2;
private: private:
join_iterator_link() /* = delete */ ; 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_begin_tag {};
class join_iterator_end_tag {}; class join_iterator_end_tag {};
...@@ -179,12 +134,16 @@ public: ...@@ -179,12 +134,16 @@ public:
typedef Iterator1 iterator1_t; typedef Iterator1 iterator1_t;
typedef Iterator2 iterator2_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) join_iterator(unsigned int section, Iterator1 current1, Iterator1 last1, Iterator2 first2, Iterator2 current2)
: m_section(section) : m_section(section)
, m_it(section, current1, current2) , m_it(section, current1, current2)
, m_link(new link_t(last1, first2)) , m_link(link_t(last1, first2))
{ {
} }
...@@ -192,7 +151,7 @@ public: ...@@ -192,7 +151,7 @@ public:
join_iterator(Range1& r1, Range2& r2, join_iterator_begin_tag) join_iterator(Range1& r1, Range2& r2, join_iterator_begin_tag)
: m_section(boost::empty(r1) ? 1u : 0u) : m_section(boost::empty(r1) ? 1u : 0u)
, m_it(boost::empty(r1) ? 1u : 0u, boost::begin(r1), boost::begin(r2)) , 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: ...@@ -200,7 +159,7 @@ public:
join_iterator(const Range1& r1, const Range2& r2, join_iterator_begin_tag) join_iterator(const Range1& r1, const Range2& r2, join_iterator_begin_tag)
: m_section(boost::empty(r1) ? 1u : 0u) : m_section(boost::empty(r1) ? 1u : 0u)
, m_it(boost::empty(r1) ? 1u : 0u, boost::const_begin(r1), boost::const_begin(r2)) , 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: ...@@ -208,7 +167,7 @@ public:
join_iterator(Range1& r1, Range2& r2, join_iterator_end_tag) join_iterator(Range1& r1, Range2& r2, join_iterator_end_tag)
: m_section(1u) : m_section(1u)
, m_it(1u, boost::end(r1), boost::end(r2)) , 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: ...@@ -216,7 +175,7 @@ public:
join_iterator(const Range1& r1, const Range2& r2, join_iterator_end_tag) join_iterator(const Range1& r1, const Range2& r2, join_iterator_end_tag)
: m_section(1u) : m_section(1u)
, m_it(1u, boost::const_end(r1), boost::const_end(r2)) , 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: ...@@ -228,9 +187,9 @@ private:
else else
{ {
++m_it.it1(); ++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; m_section = 1u;
} }
} }
...@@ -240,9 +199,9 @@ private: ...@@ -240,9 +199,9 @@ private:
{ {
if (m_section) 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; m_section = 0u;
} }
else else
...@@ -280,8 +239,8 @@ private: ...@@ -280,8 +239,8 @@ private:
result = other.m_it.it2() - m_it.it2(); result = other.m_it.it2() - m_it.it2();
else else
{ {
result = (m_link->first2 - m_it.it2()) result = (m_link.first2 - m_it.it2())
+ (other.m_it.it1() - m_link->last1); + (other.m_it.it1() - m_link.last1);
BOOST_ASSERT( result <= 0 ); BOOST_ASSERT( result <= 0 );
} }
...@@ -290,8 +249,8 @@ private: ...@@ -290,8 +249,8 @@ private:
{ {
if (other.m_section) if (other.m_section)
{ {
result = (m_link->last1 - m_it.it1()) result = (m_link.last1 - m_it.it1())
+ (other.m_it.it2() - m_link->first2); + (other.m_it.it2() - m_link.first2);
} }
else else
result = other.m_it.it1() - m_it.it1(); result = other.m_it.it1() - m_it.it1();
...@@ -305,7 +264,7 @@ private: ...@@ -305,7 +264,7 @@ private:
BOOST_ASSERT( m_section == 1u ); BOOST_ASSERT( m_section == 1u );
if (offset < 0) 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 ); BOOST_ASSERT( r2_dist <= 0 );
if (offset >= r2_dist) if (offset >= r2_dist)
std::advance(m_it.it2(), offset); std::advance(m_it.it2(), offset);
...@@ -313,7 +272,7 @@ private: ...@@ -313,7 +272,7 @@ private:
{ {
difference_t r1_dist = offset - r2_dist; difference_t r1_dist = offset - r2_dist;
BOOST_ASSERT( r1_dist <= 0 ); BOOST_ASSERT( r1_dist <= 0 );
m_it.it1() = m_link->last1 + r1_dist; m_it.it1() = m_link.last1 + r1_dist;
m_section = 0u; m_section = 0u;
} }
} }
...@@ -327,7 +286,7 @@ private: ...@@ -327,7 +286,7 @@ private:
BOOST_ASSERT( m_section == 0u ); BOOST_ASSERT( m_section == 0u );
if (offset > 0) 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 ); BOOST_ASSERT( r1_dist >= 0 );
if (offset < r1_dist) if (offset < r1_dist)
std::advance(m_it.it1(), offset); std::advance(m_it.it1(), offset);
...@@ -335,7 +294,7 @@ private: ...@@ -335,7 +294,7 @@ private:
{ {
difference_t r2_dist = offset - r1_dist; difference_t r2_dist = offset - r1_dist;
BOOST_ASSERT( r2_dist >= 0 ); BOOST_ASSERT( r2_dist >= 0 );
m_it.it2() = m_link->first2 + r2_dist; m_it.it2() = m_link.first2 + r2_dist;
m_section = 1u; m_section = 1u;
} }
} }
...@@ -345,7 +304,7 @@ private: ...@@ -345,7 +304,7 @@ private:
unsigned int m_section; unsigned int m_section;
iterator_union m_it; iterator_union m_it;
intrusive_ptr<const link_t> m_link; link_t m_link;
friend class ::boost::iterator_core_access; friend class ::boost::iterator_core_access;
}; };
......
...@@ -173,28 +173,54 @@ namespace boost ...@@ -173,28 +173,54 @@ namespace boost
} // namespace range_detail } // namespace range_detail
template<typename Integer> template<typename Integer>
iterator_range< range_detail::integer_iterator<Integer> > 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) irange(Integer first, Integer last)
{ {
BOOST_ASSERT( first <= last ); BOOST_ASSERT( first <= last );
return boost::iterator_range< range_detail::integer_iterator<Integer> >( return integer_range<Integer>(first, last);
range_detail::integer_iterator<Integer>(first),
range_detail::integer_iterator<Integer>(last));
} }
template<typename Integer, typename StepSize> 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) irange(Integer first, Integer last, StepSize step_size)
{ {
BOOST_ASSERT( step_size != 0 ); BOOST_ASSERT( step_size != 0 );
BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) ); BOOST_ASSERT( (step_size > 0) ? (last >= first) : (last <= first) );
typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t; typedef typename range_detail::integer_iterator_with_step<Integer> iterator_t;
const std::ptrdiff_t last_step const std::ptrdiff_t last_step
= (static_cast<std::ptrdiff_t>(last) - static_cast<std::ptrdiff_t>(first)) = (static_cast<std::ptrdiff_t>(last) - static_cast<std::ptrdiff_t>(first))
/ (static_cast<std::ptrdiff_t>(step_size)); / (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, 0, step_size),
iterator_t(first, last_step, step_size)); iterator_t(first, last_step, step_size));
} }
......
...@@ -18,49 +18,64 @@ ...@@ -18,49 +18,64 @@
namespace boost namespace boost
{ {
namespace range_detail
{
template<class SinglePassRange1, class SinglePassRange2> template<class SinglePassRange1, class SinglePassRange2>
iterator_range<range_detail::join_iterator< class joined_type
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange1>::type, {
BOOST_DEDUCED_TYPENAME range_iterator<const SinglePassRange2>::type, public:
BOOST_DEDUCED_TYPENAME add_const< typedef iterator_range<
BOOST_DEDUCED_TYPENAME range_value<const SinglePassRange1>::type>::type> 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) join(const SinglePassRange1& r1, const SinglePassRange2& r2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
typedef range_detail::join_iterator< return joined_range<const SinglePassRange1, const SinglePassRange2>(r1, r2);
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()));
} }
template<class SinglePassRange1, class SinglePassRange2> template<class SinglePassRange1, class SinglePassRange2>
iterator_range<range_detail::join_iterator< joined_range<SinglePassRange1, SinglePassRange2>
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange1>::type,
BOOST_DEDUCED_TYPENAME range_iterator<SinglePassRange2>::type,
BOOST_DEDUCED_TYPENAME range_value<SinglePassRange1>::type>
>
join(SinglePassRange1& r1, SinglePassRange2& r2) join(SinglePassRange1& r1, SinglePassRange2& r2)
{ {
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange1> ));
BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> )); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange2> ));
typedef range_detail::join_iterator< return joined_range<SinglePassRange1, SinglePassRange2>(r1, r2);
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()));
} }
} // namespace boost } // namespace boost
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <boost/range/begin.hpp> #include <boost/range/begin.hpp>
#include <boost/range/end.hpp> #include <boost/range/end.hpp>
#include <boost/range/concepts.hpp> #include <boost/range/concepts.hpp>
#include <boost/range/distance.hpp>
#include <numeric> #include <numeric>
...@@ -39,14 +40,14 @@ namespace boost ...@@ -39,14 +40,14 @@ namespace boost
template< class SinglePassRange, class Value > template< class SinglePassRange, class Value >
inline Value accumulate( const SinglePassRange& rng, Value init ) 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 ); return std::accumulate( boost::begin(rng), boost::end(rng), init );
} }
template< class SinglePassRange, class Value, class BinaryOperation > template< class SinglePassRange, class Value, class BinaryOperation >
inline Value accumulate( const SinglePassRange& rng, Value init, BinaryOperation op ) 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 ); return std::accumulate( boost::begin(rng), boost::end(rng), init, op );
} }
...@@ -54,8 +55,8 @@ namespace boost ...@@ -54,8 +55,8 @@ namespace boost
template< class SinglePassRange1, class SinglePassRange2, class Value > template< class SinglePassRange1, class SinglePassRange2, class Value >
inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init ) inline Value inner_product( const SinglePassRange1& rng1, const SinglePassRange2& rng2, Value init )
{ {
boost::function_requires< SinglePassRangeConcept<SinglePassRange1> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
boost::function_requires< SinglePassRangeConcept<SinglePassRange2> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) );
return std::inner_product( boost::begin(rng1), boost::end(rng1), return std::inner_product( boost::begin(rng1), boost::end(rng1),
boost::begin(rng2), init ); boost::begin(rng2), init );
...@@ -69,8 +70,8 @@ namespace boost ...@@ -69,8 +70,8 @@ namespace boost
Value init, Value init,
BinaryOperation1 op1, BinaryOperation2 op2 ) BinaryOperation1 op1, BinaryOperation2 op2 )
{ {
boost::function_requires< SinglePassRangeConcept<SinglePassRange1> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange1> ));
boost::function_requires< SinglePassRangeConcept<SinglePassRange2> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange2> ));
BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) ); BOOST_ASSERT( boost::distance(rng2) >= boost::distance(rng1) );
return std::inner_product( boost::begin(rng1), boost::end(rng1), return std::inner_product( boost::begin(rng1), boost::end(rng1),
...@@ -81,7 +82,7 @@ namespace boost ...@@ -81,7 +82,7 @@ namespace boost
inline OutputIterator partial_sum ( const SinglePassRange& rng, inline OutputIterator partial_sum ( const SinglePassRange& rng,
OutputIterator result ) 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 ); return std::partial_sum( boost::begin(rng), boost::end(rng), result );
} }
...@@ -89,7 +90,7 @@ namespace boost ...@@ -89,7 +90,7 @@ namespace boost
inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result, inline OutputIterator partial_sum ( const SinglePassRange& rng, OutputIterator result,
BinaryOperation op ) 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 ); return std::partial_sum( boost::begin(rng), boost::end(rng), result, op );
} }
...@@ -97,7 +98,7 @@ namespace boost ...@@ -97,7 +98,7 @@ namespace boost
inline OutputIterator adjacent_difference ( const SinglePassRange& rng, inline OutputIterator adjacent_difference ( const SinglePassRange& rng,
OutputIterator result ) OutputIterator result )
{ {
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<const SinglePassRange> ));
return std::adjacent_difference( boost::begin(rng), boost::end(rng), return std::adjacent_difference( boost::begin(rng), boost::end(rng),
result ); result );
} }
...@@ -107,7 +108,7 @@ namespace boost ...@@ -107,7 +108,7 @@ namespace boost
OutputIterator result, OutputIterator result,
BinaryOperation op ) BinaryOperation op )
{ {
boost::function_requires< SinglePassRangeConcept<SinglePassRange> >(); BOOST_RANGE_CONCEPT_ASSERT(( SinglePassRangeConcept<SinglePassRange> ));
return std::adjacent_difference( boost::begin(rng), boost::end(rng), return std::adjacent_difference( boost::begin(rng), boost::end(rng),
result, op ); result, op );
} }
......
...@@ -51,13 +51,31 @@ struct add_reference_impl ...@@ -51,13 +51,31 @@ struct add_reference_impl
}; };
#else #else
//
// We can't filter out rvalue_references at the same level as
// references or we get ambiguities from msvc:
//
template <typename T> template <typename T>
struct add_reference_impl struct add_reference_rvalue_layer
{ {
typedef T& type; 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 #ifndef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&) BOOST_TT_AUX_TYPE_TRAIT_IMPL_PARTIAL_SPEC1_1(typename T,add_reference,T&,T&)
#endif #endif
......
...@@ -166,7 +166,7 @@ struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)> ...@@ -166,7 +166,7 @@ struct function_traits_helper<R (*)(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10)>
template<typename Function> template<typename Function>
struct function_traits : 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, ...@@ -227,7 +227,7 @@ type_of_size<11> function_arity_helper(R (*f)(T1, T2, T3, T4, T5, T6, T7, T8,
template<typename Function> template<typename Function>
struct function_traits 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 #endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
......
...@@ -25,7 +25,7 @@ struct is_convertible_from_tester ...@@ -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 } // namespace boost
......
...@@ -50,12 +50,31 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T)) ...@@ -50,12 +50,31 @@ BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_const,T,__is_const(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION) #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) #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 #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 #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) BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_const,T&,false)
#if defined(BOOST_ILLEGAL_CV_REFERENCES) #if defined(BOOST_ILLEGAL_CV_REFERENCES)
...@@ -98,7 +117,7 @@ struct is_const_helper<false,false> ...@@ -98,7 +117,7 @@ struct is_const_helper<false,false>
{ {
static T* t; static T* t;
BOOST_STATIC_CONSTANT(bool, value = ( 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> ...@@ -110,7 +129,7 @@ struct is_const_helper<false,true>
{ {
static T t; static T t;
BOOST_STATIC_CONSTANT(bool, value = ( 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> ...@@ -132,7 +132,7 @@ template <typename From, typename To>
struct is_convertible_basic_impl struct is_convertible_basic_impl
{ {
static From _m_from; 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); == sizeof(::boost::type_traits::yes_type);
}; };
......
...@@ -95,6 +95,9 @@ struct is_function_impl<T&> : public false_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)) BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,__is_function(T))
#else #else
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_function,T,::boost::detail::is_function_impl<T>::value) 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 #endif
} // namespace boost } // namespace boost
......
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes,
// Howard Hinnant and John Maddock 2000.
// (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// Use, modification and distribution are subject to the Boost Software License,
// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
// http://www.boost.org/LICENSE_1_0.txt).
//
// See http://www.boost.org/libs/type_traits for most recent version including documentation.
// Fixed is_pointer, is_lvalue_reference, is_const, is_volatile, is_same,
// is_member_pointer based on the Simulated Partial Specialization work
// of Mat Marcus and Jesse Jones. See http://opensource.adobe.com or
// http://groups.yahoo.com/group/boost/message/5441
// Some workarounds in here use ideas suggested from "Generic<Programming>:
// Mappings between Types and Values"
// by Andrei Alexandrescu (see http://www.cuj.com/experts/1810/alexandr.html).
#ifndef BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_LVALUE_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/config.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
# include <boost/type_traits/detail/yes_no_type.hpp>
# include <boost/type_traits/detail/wrap.hpp>
#endif
// should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost {
#if defined( __CODEGEARC__ )
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,__is_reference(T))
#elif !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T&,true)
#if defined(BOOST_ILLEGAL_CV_REFERENCES)
// these are illegal specialisations; cv-qualifies applied to
// references have no effect according to [8.3.2p1],
// C++ Builder requires them though as it treats cv-qualified
// references as distinct types...
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& volatile,true)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T& const volatile,true)
#endif
#if defined(__GNUC__) && (__GNUC__ < 3)
// these allow us to work around illegally cv-qualified reference
// types.
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const ,::boost::is_lvalue_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T volatile ,::boost::is_lvalue_reference<T>::value)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_1(typename T,is_lvalue_reference,T const volatile ,::boost::is_lvalue_reference<T>::value)
// However, the above specializations confuse gcc 2.96 unless we also
// supply these specializations for array types
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,volatile T[N],false)
BOOST_TT_AUX_BOOL_TRAIT_PARTIAL_SPEC1_2(typename T,unsigned long N,is_lvalue_reference,const volatile T[N],false)
#endif
#else
#ifdef BOOST_MSVC
# pragma warning(push)
# pragma warning(disable: 4181 4097)
#endif
namespace detail {
using ::boost::type_traits::yes_type;
using ::boost::type_traits::no_type;
using ::boost::type_traits::wrap;
template <class T> T&(* is_lvalue_reference_helper1(wrap<T>) )(wrap<T>);
char is_lvalue_reference_helper1(...);
template <class T> no_type is_lvalue_reference_helper2(T&(*)(wrap<T>));
yes_type is_lvalue_reference_helper2(...);
template <typename T>
struct is_lvalue_reference_impl
{
BOOST_STATIC_CONSTANT(
bool, value = sizeof(
::boost::detail::is_lvalue_reference_helper2(
::boost::detail::is_lvalue_reference_helper1(::boost::type_traits::wrap<T>()))) == 1
);
};
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void,false)
#ifndef BOOST_NO_CV_VOID_SPECIALIZATIONS
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void volatile,false)
BOOST_TT_AUX_BOOL_TRAIT_IMPL_SPEC1(is_lvalue_reference,void const volatile,false)
#endif
} // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_lvalue_reference,T,::boost::detail::is_lvalue_reference_impl<T>::value)
#ifdef BOOST_MSVC
# pragma warning(pop)
#endif
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
} // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp>
#endif // BOOST_TT_IS_REFERENCE_HPP_INCLUDED
// (C) Copyright Dave Abrahams, Steve Cleary, Beman Dawes, // (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 // (C) Copyright Mat Marcus, Jesse Jones and Adobe Systems Inc 2001
// Use, modification and distribution are subject to the Boost Software License, // Use, modification and distribution are subject to the Boost Software License,
...@@ -9,107 +9,34 @@ ...@@ -9,107 +9,34 @@
// //
// See http://www.boost.org/libs/type_traits for most recent version including documentation. // 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 #ifndef BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#define BOOST_TT_IS_REFERENCE_HPP_INCLUDED #define BOOST_TT_IS_REFERENCE_HPP_INCLUDED
#include <boost/type_traits/config.hpp> #include <boost/type_traits/config.hpp>
#include <boost/type_traits/is_lvalue_reference.hpp>
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION #include <boost/type_traits/is_rvalue_reference.hpp>
# include <boost/type_traits/detail/yes_no_type.hpp> #include <boost/type_traits/ice.hpp>
# include <boost/type_traits/detail/wrap.hpp>
#endif
// should be the last #include // should be the last #include
#include <boost/type_traits/detail/bool_trait_def.hpp> #include <boost/type_traits/detail/bool_trait_def.hpp>
namespace boost { 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 { 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> template <typename T>
struct is_reference_impl struct is_reference_impl
{ {
BOOST_STATIC_CONSTANT( BOOST_STATIC_CONSTANT(bool, value =
bool, value = sizeof( (::boost::type_traits::ice_or<
::boost::detail::is_reference_helper2( ::boost::is_lvalue_reference<T>::value, ::boost::is_rvalue_reference<T>::value
::boost::detail::is_reference_helper1(::boost::type_traits::wrap<T>()))) == 1 >::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 } // namespace detail
BOOST_TT_AUX_BOOL_TRAIT_DEF1(is_reference,T,::boost::detail::is_reference_impl<T>::value) 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 } // namespace boost
#include <boost/type_traits/detail/bool_trait_undef.hpp> #include <boost/type_traits/detail/bool_trait_undef.hpp>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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