Full merge from trunk at revision 41356 of entire boost-root tree.

[SVN r41369]
This commit is contained in:
Beman Dawes
2007-11-25 18:07:19 +00:00
parent d71c289879
commit 7ec3e698d6
16 changed files with 136 additions and 52 deletions

View File

@@ -29,21 +29,25 @@
// has to be checked in a separate condition, otherwise GCC complains
// about 'and' being an alternative token
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(and)
# pragma push_macro("and")
# undef and
# define and(x)
#endif
#endif
#endif
# define BOOST_MPL_PREPROCESSED_HEADER and.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(and)
# pragma pop_macro("and")
#endif
#endif
#endif
#else

View File

@@ -26,6 +26,7 @@
#include <boost/mpl/aux_/config/gcc.hpp>
#include <boost/mpl/aux_/config/msvc.hpp>
#include <boost/mpl/aux_/config/static_constant.hpp>
#include <boost/mpl/aux_/config/pp_counter.hpp>
#include <boost/mpl/aux_/config/workaround.hpp>
#include <boost/preprocessor/cat.hpp>
@@ -216,7 +217,7 @@ BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
#define BOOST_MPL_ASSERT(pred) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<false>( \
boost::mpl::assert_arg( (void (*) pred)0, 1 ) \
) \
@@ -229,7 +230,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
#if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
# define BOOST_MPL_ASSERT_NOT(pred) \
enum { \
BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion<false>::failed( \
boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
) \
@@ -240,7 +241,7 @@ enum { \
# define BOOST_MPL_ASSERT_NOT(pred) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<false>( \
boost::mpl::assert_not_arg( (void (*) pred)0, 1 ) \
) \
@@ -255,12 +256,12 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
# if !defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
// agurt, 9/nov/06: 'enum' below is a workaround for gcc 4.0.4/4.1.1 bugs #29522 and #29518
# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
enum { BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) }; \
# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \
enum { BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) }; \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,__LINE__)>( \
, BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,counter)>( \
(boost::mpl::failed ************ ( boost::mpl::assert_relation< \
boost::mpl::assert_::relations( sizeof( \
boost::mpl::assert_::arg rel boost::mpl::assert_::arg \
@@ -272,20 +273,20 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
) \
/**/
# else
# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
# define BOOST_MPL_ASSERT_RELATION_IMPL(counter, x, rel, y) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assert_rel,__LINE__) = sizeof( \
, BOOST_PP_CAT(mpl_assert_rel,counter) = sizeof( \
boost::mpl::assert_::arg rel boost::mpl::assert_::arg \
) \
); \
BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,__LINE__) = (x rel y) ); \
BOOST_MPL_AUX_ASSERT_CONSTANT( bool, BOOST_PP_CAT(mpl_assert_rel_value,counter) = (x rel y) ); \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,__LINE__)>( \
, BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
boost::mpl::assertion_failed<BOOST_PP_CAT(mpl_assert_rel_value,counter)>( \
boost::mpl::assert_rel_arg( boost::mpl::assert_relation< \
boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,__LINE__)) \
boost::mpl::assert_::relations(BOOST_PP_CAT(mpl_assert_rel,counter)) \
, x \
, y \
>() ) \
@@ -295,13 +296,17 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
/**/
# endif
# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
BOOST_MPL_ASSERT_RELATION_IMPL(BOOST_MPL_AUX_PP_COUNTER(), x, rel, y) \
/**/
#else // !BOOST_MPL_CFG_ASSERT_USE_RELATION_NAMES
# if defined(BOOST_MPL_CFG_ASSERT_BROKEN_POINTER_TO_POINTER_TO_MEMBER)
# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<(x rel y)>( boost::mpl::assert_rel_arg( \
boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))() \
) ) \
@@ -312,7 +317,7 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
# define BOOST_MPL_ASSERT_RELATION(x, rel, y) \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
, BOOST_PP_CAT(mpl_assertion_in_line_,BOOST_MPL_AUX_PP_COUNTER()) = sizeof( \
boost::mpl::assertion_failed<(x rel y)>( (boost::mpl::failed ************ ( \
boost::mpl::BOOST_MPL_AUX_ASSERT_RELATION(x,y,(&boost::mpl::operator rel))::************))0 ) \
) \
@@ -326,36 +331,40 @@ BOOST_MPL_AUX_ASSERT_CONSTANT( \
// BOOST_MPL_ASSERT_MSG( (pred<x,...>::value), USER_PROVIDED_MESSAGE, (types<x,...>) )
#if BOOST_WORKAROUND(__MWERKS__, BOOST_TESTED_AT(0x3202))
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \
struct msg; \
typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \
typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \
{ \
using boost::mpl::assert_::types; \
static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
{ return 0; } \
} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \
} BOOST_PP_CAT(mpl_assert_arg,counter); \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \
, BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
boost::mpl::assertion<(c)>::failed( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
) \
) \
/**/
#else
# define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
# define BOOST_MPL_ASSERT_MSG_IMPL( counter, c, msg, types_ ) \
struct msg; \
typedef struct BOOST_PP_CAT(msg,__LINE__) : boost::mpl::assert_ \
typedef struct BOOST_PP_CAT(msg,counter) : boost::mpl::assert_ \
{ \
static boost::mpl::failed ************ (msg::************ assert_arg()) types_ \
{ return 0; } \
} BOOST_PP_CAT(mpl_assert_arg,__LINE__); \
} BOOST_PP_CAT(mpl_assert_arg,counter); \
BOOST_MPL_AUX_ASSERT_CONSTANT( \
std::size_t \
, BOOST_PP_CAT(mpl_assertion_in_line_,__LINE__) = sizeof( \
boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,__LINE__)::assert_arg() ) \
, BOOST_PP_CAT(mpl_assertion_in_line_,counter) = sizeof( \
boost::mpl::assertion_failed<(c)>( BOOST_PP_CAT(mpl_assert_arg,counter)::assert_arg() ) \
) \
) \
/**/
#endif
#define BOOST_MPL_ASSERT_MSG( c, msg, types_ ) \
BOOST_MPL_ASSERT_MSG_IMPL( BOOST_MPL_AUX_PP_COUNTER(), c, msg, types_ ) \
/**/
#endif // BOOST_MPL_ASSERT_HPP_INCLUDED

View File

@@ -25,6 +25,7 @@
namespace boost { namespace mpl {
namespace aux {
template< typename Sequence >

View File

@@ -19,7 +19,7 @@
#if !defined(BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
&& BOOST_WORKAROUND(__BORLANDC__, < 0x600)
&& BOOST_WORKAROUND(__BORLANDC__, < 0x582)
# define BOOST_MPL_CFG_NO_NONTYPE_TEMPLATE_PARTIAL_SPEC

View File

@@ -18,7 +18,7 @@
#if !defined(BOOST_MPL_CFG_BROKEN_OVERLOAD_RESOLUTION) \
&& !defined(BOOST_MPL_PREPROCESSING_MODE) \
&& ( BOOST_WORKAROUND(__BORLANDC__, < 0x600) \
&& ( BOOST_WORKAROUND(__BORLANDC__, < 0x590) \
|| BOOST_WORKAROUND(__MWERKS__, < 0x3001) \
)

View File

@@ -0,0 +1,26 @@
#ifndef BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED
#define BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2006
//
// 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/mpl for documentation.
// $Source$
// $Date$
// $Revision$
#if !defined(BOOST_MPL_AUX_PP_COUNTER)
# include <boost/mpl/aux_/config/msvc.hpp>
# if BOOST_WORKAROUND(BOOST_MSVC, >= 1300)
# define BOOST_MPL_AUX_PP_COUNTER() __COUNTER__
# else
# define BOOST_MPL_AUX_PP_COUNTER() __LINE__
# endif
#endif
#endif // BOOST_MPL_AUX_CONFIG_PP_COUNTER_HPP_INCLUDED

View File

@@ -19,7 +19,9 @@
#include <boost/mpl/aux_/config/workaround.hpp>
#if !defined(BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS) \
&& defined(BOOST_NO_TEMPLATE_TEMPLATES)
&& ( defined(BOOST_NO_TEMPLATE_TEMPLATES) \
|| BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT( 0x590) ) \
)
# define BOOST_MPL_CFG_NO_TEMPLATE_TEMPLATE_PARAMETERS

View File

@@ -65,7 +65,7 @@ struct AUX_WRAPPER_NAME
typedef AUX_WRAPPER_INST(prior_value) prior;
#elif BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x561)) \
|| BOOST_WORKAROUND(__IBMCPP__, BOOST_TESTED_AT(502)) \
|| BOOST_WORKAROUND(__HP_aCC, <= 53800)
|| (BOOST_WORKAROUND(__HP_aCC, <= 53800) && (BOOST_WORKAROUND(__hpxstd98, != 1)))
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N + 1)) ) next;
typedef AUX_WRAPPER_INST( BOOST_MPL_AUX_STATIC_CAST(AUX_WRAPPER_VALUE_TYPE, (N - 1)) ) prior;
#else

View File

@@ -26,6 +26,10 @@
#include <boost/preprocessor/cat.hpp>
#if BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) )
# include <boost/type_traits/is_class.hpp>
#endif
#if !defined(BOOST_MPL_CFG_NO_HAS_XXX)
# if BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
@@ -182,6 +186,41 @@ struct trait \
}; \
/**/
# elif BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x590) )
# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_BCB_DEF(trait, trait_tester, name, default_) \
template< typename T, bool IS_CLASS > \
struct trait_tester \
{ \
BOOST_STATIC_CONSTANT( bool, value = false ); \
}; \
template< typename T > \
struct trait_tester< T, true > \
{ \
struct trait_tester_impl \
{ \
template < class U > \
static int resolve( boost::mpl::aux::type_wrapper<U> const volatile * \
, boost::mpl::aux::type_wrapper<typename U::name >* = 0 ); \
static char resolve( ... ); \
}; \
typedef boost::mpl::aux::type_wrapper<T> t_; \
BOOST_STATIC_CONSTANT( bool, value = ( sizeof( trait_tester_impl::resolve( static_cast< t_ * >(0) ) ) == sizeof(int) ) ); \
}; \
template< typename T, typename fallback_ = boost::mpl::bool_<default_> > \
struct trait \
{ \
BOOST_STATIC_CONSTANT( bool, value = (trait_tester< T, boost::is_class< T >::value >::value) ); \
typedef boost::mpl::bool_< trait< T, fallback_ >::value > type; \
};
# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \
BOOST_MPL_HAS_XXX_TRAIT_NAMED_BCB_DEF( trait \
, BOOST_PP_CAT(trait,_tester) \
, name \
, default_ ) \
/**/
# else // other SFINAE-capable compilers
# define BOOST_MPL_HAS_XXX_TRAIT_NAMED_DEF(trait, name, default_) \

View File

@@ -30,21 +30,25 @@
// has to be checked in a separate condition, otherwise GCC complains
// about 'or' being an alternative token
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(or)
# pragma push_macro("or")
# undef or
# define or(x)
#endif
#endif
#endif
# define BOOST_MPL_PREPROCESSED_HEADER or.hpp
# include <boost/mpl/aux_/include_preprocessed.hpp>
#if defined(_MSC_VER)
#ifndef __GCCXML__
#if defined(or)
# pragma pop_macro("or")
#endif
#endif
#endif
#else

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_BEGIN_END_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Aleksey Gurtovoy 2003-2007
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
@@ -24,8 +24,8 @@ template<>
struct begin_impl< aux::set_tag >
{
template< typename Set > struct apply
: s_iter_get<Set,typename Set::item_>
{
typedef s_iter<Set,Set> type;
};
};

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_ERASE_KEY_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Aleksey Gurtovoy 2003-2007
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
@@ -40,7 +40,7 @@ struct erase_key_impl< aux::set_tag >
, eval_if<
is_same< T,typename Set::item_type_ >
, base<Set>
, identity< s_mask<T,Set> >
, identity< s_mask<T,typename Set::item_> >
>
, identity<Set>
>

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_INSERT_IMPL_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Aleksey Gurtovoy 2003-2007
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
@@ -36,7 +36,7 @@ template< typename Set, typename T > struct set_insert_impl
, eval_if<
is_same< T,typename Set::last_masked_ >
, base<Set>
, identity< s_item<T,Set> >
, identity< s_item<T,typename Set::item_> >
>
>
{

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_ITEM_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Aleksey Gurtovoy 2003-2007
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
@@ -31,9 +31,7 @@ struct s_item
{
typedef s_item<T,Base> item_;
typedef void_ last_masked_;
typedef Base next_;
typedef T item_type_;
typedef item_type_ type;
typedef Base base;
typedef typename next< typename Base::size >::type size;

View File

@@ -2,7 +2,7 @@
#ifndef BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
#define BOOST_MPL_SET_AUX_ITERATOR_HPP_INCLUDED
// Copyright Aleksey Gurtovoy 2003-2004
// Copyright Aleksey Gurtovoy 2003-2007
// Copyright David Abrahams 2003-2004
//
// Distributed under the Boost Software License, Version 1.0.
@@ -26,21 +26,26 @@
namespace boost { namespace mpl {
// used by 's_iter_impl'
// used by 's_iter_get'
template< typename Set, typename Tail > struct s_iter;
template< typename Set, typename Tail > struct s_iter_get
: eval_if<
has_key< Set,typename Tail::item_type_ >
, identity< s_iter<Set,Tail> >
, next< s_iter<Set,Tail> >
>
{
};
template< typename Set, typename Tail > struct s_iter_impl
{
typedef Tail tail_;
typedef forward_iterator_tag category;
typedef typename Tail::item_::type type;
typedef typename Tail::item_type_ type;
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
typedef typename eval_if<
has_key< Set,typename Tail::next_::type >
, identity< s_iter<Set,typename Tail::next_> >
, next< s_iter<Set,typename Tail::next_> >
>::type next;
typedef typename s_iter_get< Set,typename Tail::base >::type next;
#endif
};
@@ -48,11 +53,7 @@ template< typename Set, typename Tail > struct s_iter_impl
template< typename Set, typename Tail >
struct next< s_iter<Set,Tail> >
: eval_if<
has_key< Set,typename Tail::next_::type >
, identity< s_iter<Set,typename Tail::next_> >
, next< s_iter<Set,typename Tail::next_> >
>
: s_iter_get< Set,typename Tail::base >
{
};

View File

@@ -53,10 +53,10 @@ namespace boost { namespace mpl {
template< typename Dummy = na > struct set0
{
typedef set0<> item_;
typedef item_ type;
typedef aux::set_tag tag;
typedef void_ last_masked_;
typedef void_ item_type_;
typedef item_type_ type;
typedef long_<0> size;
typedef long_<1> order;