mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 22:34:31 +02:00
merge RC_1_32_0 fixes
[SVN r26324]
This commit is contained in:
@@ -60,7 +60,7 @@ struct has_rebind
|
||||
#else // the rest
|
||||
|
||||
template< typename T > struct has_rebind_tag {};
|
||||
yes_tag operator|(has_rebind_tag<int>, void const volatile*);
|
||||
no_tag operator|(has_rebind_tag<int>, void const volatile*);
|
||||
|
||||
# if !BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
template< typename T >
|
||||
@@ -68,7 +68,7 @@ struct has_rebind
|
||||
{
|
||||
static has_rebind_tag<T>* get();
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
sizeof(has_rebind_tag<int>() | get()) == sizeof(char)
|
||||
sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)
|
||||
);
|
||||
};
|
||||
# else // __BORLANDC__
|
||||
@@ -77,7 +77,7 @@ struct has_rebind_impl
|
||||
{
|
||||
static T* get();
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
sizeof(has_rebind_tag<int>() | get()) == sizeof(char)
|
||||
sizeof(has_rebind_tag<int>() | get()) == sizeof(yes_tag)
|
||||
);
|
||||
};
|
||||
|
||||
|
@@ -1,28 +0,0 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_ITERATOR_NAMES_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_ITERATOR_NAMES_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2002-2004
|
||||
//
|
||||
// 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$
|
||||
|
||||
#include <boost/mpl/aux_/config/workaround.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
|
||||
#if !BOOST_WORKAROUND(BOOST_MSVC, <= 1300)
|
||||
# define BOOST_MPL_AUX_ITERATOR_ADVANCE advance
|
||||
# define BOOST_MPL_AUX_ITERATOR_DISTANCE distance_to
|
||||
#else
|
||||
# define BOOST_MPL_AUX_ITERATOR_ADVANCE advance_
|
||||
# define BOOST_MPL_AUX_ITERATOR_DISTANCE distance_to
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_ITERATOR_NAMES_HPP_INCLUDED
|
@@ -24,9 +24,13 @@
|
||||
#else
|
||||
|
||||
# include <boost/mpl/int_fwd.hpp>
|
||||
# include <boost/mpl/aux_/yes_no.hpp>
|
||||
# include <boost/mpl/aux_/na_fwd.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/params.hpp>
|
||||
# include <boost/mpl/aux_/preprocessor/enum.hpp>
|
||||
# include <boost/mpl/aux_/config/msvc.hpp>
|
||||
# include <boost/mpl/aux_/config/workaround.hpp>
|
||||
|
||||
# include <boost/preprocessor/tuple/to_list.hpp>
|
||||
# include <boost/preprocessor/list/for_each_i.hpp>
|
||||
# include <boost/preprocessor/inc.hpp>
|
||||
@@ -109,15 +113,19 @@ template< typename T > struct has_rebind_tag;
|
||||
#if BOOST_WORKAROUND(__BORLANDC__, < 0x600)
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
|
||||
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
char operator|( \
|
||||
::boost::mpl::aux::yes_tag operator|( \
|
||||
::boost::mpl::aux::has_rebind_tag<int> \
|
||||
, name<BOOST_MPL_PP_PARAMS(i,T)>* \
|
||||
); \
|
||||
::boost::mpl::aux::no_tag operator|( \
|
||||
::boost::mpl::aux::has_rebind_tag<int> \
|
||||
, name< BOOST_MPL_PP_ENUM(i,::boost::mpl::na) >* \
|
||||
); \
|
||||
/**/
|
||||
#elif !BOOST_WORKAROUND(BOOST_MSVC, <= 1200)
|
||||
# define BOOST_MPL_AUX_LAMBDA_SUPPORT_HAS_REBIND(i, name, params) \
|
||||
template< BOOST_MPL_PP_PARAMS(i,typename T) > \
|
||||
char operator|( \
|
||||
::boost::mpl::aux::yes_tag operator|( \
|
||||
::boost::mpl::aux::has_rebind_tag<int> \
|
||||
, ::boost::mpl::aux::has_rebind_tag< name<BOOST_MPL_PP_PARAMS(i,T)> >* \
|
||||
); \
|
||||
|
@@ -40,6 +40,7 @@ template<> struct msvc_eti_base_impl<true>
|
||||
typedef result_ first;
|
||||
typedef result_ second;
|
||||
typedef result_ tag;
|
||||
enum { value = 0 };
|
||||
};
|
||||
};
|
||||
|
||||
@@ -68,6 +69,7 @@ template<> struct msvc_eti_base<int>
|
||||
typedef msvc_eti_base first;
|
||||
typedef msvc_eti_base second;
|
||||
typedef msvc_eti_base tag;
|
||||
enum { value = 0 };
|
||||
};
|
||||
|
||||
}}}
|
||||
|
@@ -15,22 +15,10 @@
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/bool.hpp>
|
||||
#include <boost/mpl/aux_/adl_barrier.hpp>
|
||||
#include <boost/mpl/aux_/na_fwd.hpp>
|
||||
#include <boost/mpl/aux_/config/msvc.hpp>
|
||||
#include <boost/mpl/aux_/config/ctps.hpp>
|
||||
|
||||
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
|
||||
|
||||
// n.a. == not available
|
||||
struct na
|
||||
{
|
||||
typedef na type;
|
||||
enum { value = 0 };
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
|
||||
BOOST_MPL_AUX_ADL_BARRIER_DECL(na)
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template< typename T >
|
||||
|
31
include/boost/mpl/aux_/na_fwd.hpp
Normal file
31
include/boost/mpl/aux_/na_fwd.hpp
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2001-2004
|
||||
//
|
||||
// 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$
|
||||
|
||||
#include <boost/mpl/aux_/adl_barrier.hpp>
|
||||
|
||||
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_OPEN
|
||||
|
||||
// n.a. == not available
|
||||
struct na
|
||||
{
|
||||
typedef na type;
|
||||
enum { value = 0 };
|
||||
};
|
||||
|
||||
BOOST_MPL_AUX_ADL_BARRIER_NAMESPACE_CLOSE
|
||||
BOOST_MPL_AUX_ADL_BARRIER_DECL(na)
|
||||
|
||||
#endif // BOOST_MPL_AUX_NA_FWD_HPP_INCLUDED
|
@@ -104,6 +104,7 @@ struct lambda< \
|
||||
> \
|
||||
{ \
|
||||
typedef false_ is_le; \
|
||||
typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > result_; \
|
||||
typedef name< BOOST_MPL_AUX_NA_PARAMS(i) > type; \
|
||||
}; \
|
||||
/**/
|
||||
|
77
include/boost/mpl/aux_/numeric_cast_utils.hpp
Normal file
77
include/boost/mpl/aux_/numeric_cast_utils.hpp
Normal file
@@ -0,0 +1,77 @@
|
||||
|
||||
#ifndef BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED
|
||||
#define BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED
|
||||
|
||||
// Copyright Aleksey Gurtovoy 2003-2004
|
||||
//
|
||||
// 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$
|
||||
|
||||
#include <boost/mpl/numeric_cast.hpp>
|
||||
#include <boost/mpl/apply_wrap.hpp>
|
||||
#include <boost/mpl/aux_/config/forwarding.hpp>
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
template<
|
||||
typename F
|
||||
, typename Tag1
|
||||
, typename Tag2
|
||||
>
|
||||
struct cast1st_impl
|
||||
{
|
||||
template< typename N1, typename N2 > struct apply
|
||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
||||
: apply_wrap2<
|
||||
F
|
||||
, typename apply_wrap1< BOOST_MPL_AUX_NUMERIC_CAST<Tag1,Tag2>,N1 >::type
|
||||
, N2
|
||||
>
|
||||
{
|
||||
#else
|
||||
{
|
||||
typedef typename apply_wrap2<
|
||||
F
|
||||
, typename apply_wrap1< BOOST_MPL_AUX_NUMERIC_CAST<Tag1,Tag2>,N1 >::type
|
||||
, N2
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
template<
|
||||
typename F
|
||||
, typename Tag1
|
||||
, typename Tag2
|
||||
>
|
||||
struct cast2nd_impl
|
||||
{
|
||||
template< typename N1, typename N2 > struct apply
|
||||
#if !defined(BOOST_MPL_CFG_NO_NESTED_FORWARDING)
|
||||
: apply_wrap2<
|
||||
F
|
||||
, N1
|
||||
, typename apply_wrap1< BOOST_MPL_AUX_NUMERIC_CAST<Tag2,Tag1>,N2 >::type
|
||||
>
|
||||
{
|
||||
#else
|
||||
{
|
||||
typedef typename apply_wrap2<
|
||||
F
|
||||
, N1
|
||||
, typename apply_wrap1< BOOST_MPL_AUX_NUMERIC_CAST<Tag2,Tag1>,N2 >::type
|
||||
>::type type;
|
||||
#endif
|
||||
};
|
||||
};
|
||||
|
||||
}}}
|
||||
|
||||
#endif // BOOST_MPL_AUX_NUMERIC_CAST_HPP_INCLUDED
|
@@ -22,6 +22,7 @@
|
||||
# include <boost/mpl/apply_wrap.hpp>
|
||||
# include <boost/mpl/eval_if.hpp>
|
||||
# include <boost/mpl/tag.hpp>
|
||||
# include <boost/mpl/aux_/numeric_cast_utils.hpp>
|
||||
# include <boost/mpl/aux_/na.hpp>
|
||||
# include <boost/mpl/aux_/na_spec.hpp>
|
||||
# include <boost/mpl/aux_/lambda_support.hpp>
|
||||
@@ -92,7 +93,7 @@ struct AUX778076_OP_IMPL_NAME
|
||||
#endif
|
||||
, aux::cast2nd_impl< AUX778076_OP_IMPL_NAME<Tag1,Tag1>,Tag1,Tag2 >
|
||||
, aux::cast1st_impl< AUX778076_OP_IMPL_NAME<Tag2,Tag2>,Tag1,Tag2 >
|
||||
>
|
||||
>::type
|
||||
{
|
||||
};
|
||||
|
||||
|
@@ -15,35 +15,85 @@
|
||||
// $Revision$
|
||||
|
||||
#include <boost/mpl/iterator_tags.hpp>
|
||||
#include <boost/mpl/advance_fwd.hpp>
|
||||
#include <boost/mpl/distance_fwd.hpp>
|
||||
#include <boost/mpl/next_prior.hpp>
|
||||
#include <boost/mpl/deref.hpp>
|
||||
#include <boost/mpl/plus.hpp>
|
||||
#include <boost/mpl/minus.hpp>
|
||||
#include <boost/mpl/aux_/iterator_names.hpp>
|
||||
#include <boost/mpl/aux_/value_wknd.hpp>
|
||||
#include <boost/mpl/aux_/config/ctps.hpp>
|
||||
|
||||
namespace boost { namespace mpl {
|
||||
|
||||
template< typename N >
|
||||
struct rc_iter
|
||||
// theoretically will work on any discrete numeric type
|
||||
template< typename N > struct r_iter
|
||||
{
|
||||
typedef aux::rc_iter_tag tag;
|
||||
typedef aux::r_iter_tag tag;
|
||||
typedef random_access_iterator_tag category;
|
||||
typedef N type;
|
||||
|
||||
typedef rc_iter<typename mpl::next<N>::type> next;
|
||||
typedef rc_iter<typename mpl::prior<N>::type> prior;
|
||||
#if defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
typedef r_iter< typename mpl::next<N>::type > next;
|
||||
typedef r_iter< typename mpl::prior<N>::type > prior;
|
||||
#endif
|
||||
};
|
||||
|
||||
template< typename D >
|
||||
struct BOOST_MPL_AUX_ITERATOR_ADVANCE
|
||||
#if !defined(BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION)
|
||||
|
||||
template<
|
||||
typename N
|
||||
>
|
||||
struct next< r_iter<N> >
|
||||
{
|
||||
typedef r_iter< typename mpl::next<N>::type > type;
|
||||
};
|
||||
|
||||
template<
|
||||
typename N
|
||||
>
|
||||
struct prior< r_iter<N> >
|
||||
{
|
||||
typedef r_iter< typename mpl::prior<N>::type > type;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
template<> struct advance_impl<aux::r_iter_tag>
|
||||
{
|
||||
template< typename Iter, typename Dist > struct apply
|
||||
{
|
||||
typedef rc_iter<
|
||||
typename plus<N,D>::type
|
||||
> type;
|
||||
typedef typename Iter::type n_;
|
||||
typedef typename plus<n_,Dist>::type m_;
|
||||
|
||||
// agurt, 10/nov/04: to be generic, the code have to do something along
|
||||
// the lines below...
|
||||
//
|
||||
// typedef typename apply_wrap1<
|
||||
// numeric_cast< typename m_::tag, typename n_::tag >
|
||||
// , m_
|
||||
// >::type result_;
|
||||
//
|
||||
// ... meanwhile:
|
||||
|
||||
typedef integral_c<
|
||||
typename n_::value_type
|
||||
, BOOST_MPL_AUX_VALUE_WKND(m_)::value
|
||||
> result_;
|
||||
|
||||
typedef r_iter<result_> type;
|
||||
};
|
||||
};
|
||||
|
||||
template< typename U >
|
||||
struct BOOST_MPL_AUX_ITERATOR_DISTANCE
|
||||
template<> struct distance_impl<aux::r_iter_tag>
|
||||
{
|
||||
template< typename Iter1, typename Iter2 > struct apply
|
||||
: minus<
|
||||
typename Iter2::type
|
||||
, typename Iter1::type
|
||||
>
|
||||
{
|
||||
typedef typename minus<typename U::type,N>::type type;
|
||||
};
|
||||
};
|
||||
|
||||
|
@@ -17,7 +17,7 @@
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
struct half_open_range_tag;
|
||||
struct rc_iter_tag;
|
||||
struct r_iter_tag;
|
||||
|
||||
}}}
|
||||
|
||||
|
Reference in New Issue
Block a user