mirror of
https://github.com/boostorg/mpl.git
synced 2025-08-02 22:34:31 +02:00
ETI refactoring
[SVN r17613]
This commit is contained in:
@@ -171,7 +171,7 @@ struct apply0 : F
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, apply0, (F))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
//: workaround for the ETI bug
|
||||
template<>
|
||||
struct apply0<int>
|
||||
@@ -259,7 +259,7 @@ struct BOOST_PP_CAT(apply,i)
|
||||
|
||||
# endif // workarounds
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
//: workaround for ETI bug
|
||||
template<>
|
||||
struct BOOST_PP_CAT(apply,i)<AUX_APPLY_N_SPEC_PARAMS(i, int)>
|
||||
|
@@ -41,7 +41,7 @@ struct divides_c
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
template<>
|
||||
struct divides_c<long,0,0,0,0,0>
|
||||
{
|
||||
|
@@ -41,7 +41,7 @@ struct modulus_c
|
||||
#endif
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
template<>
|
||||
struct modulus_c<long,0,0>
|
||||
{
|
||||
|
@@ -35,7 +35,7 @@ struct as_sequence
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,as_sequence,(T))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct as_sequence<int>
|
||||
{
|
||||
typedef single_view<int> type;
|
||||
|
@@ -103,7 +103,7 @@ struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
|
@@ -102,7 +102,7 @@ struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
|
||||
typedef BOOST_PP_CAT(iter,i) type;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct apply<int>
|
||||
{
|
||||
|
@@ -36,7 +36,7 @@ struct back_traits
|
||||
template< typename Sequence > struct algorithm
|
||||
{
|
||||
typedef typename end<Sequence>::type iter_;
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
typedef typename prior<iter_>::type last_;
|
||||
#else
|
||||
typedef typename iter_::prior last_;
|
||||
|
@@ -71,7 +71,7 @@ AUX_AGLORITM_TRAIT_SPEC(end, nested_begin_end_tag, typename Sequence::end)
|
||||
AUX_AGLORITM_TRAIT_SPEC(begin, non_sequence_tag, void_)
|
||||
AUX_AGLORITM_TRAIT_SPEC(end, non_sequence_tag, void_)
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
AUX_AGLORITM_TRAIT_SPEC(begin, int, int)
|
||||
AUX_AGLORITM_TRAIT_SPEC(end, int, int)
|
||||
#endif
|
||||
|
@@ -22,9 +22,9 @@
|
||||
// flags for MSVC 6.5's so-called "early template instantiation bug"
|
||||
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
|
||||
# if BOOST_MSVC < 1300
|
||||
# define BOOST_MPL_MSVC_ETI_BUG
|
||||
# define BOOST_MPL_MSVC_60_ETI_BUG
|
||||
# endif
|
||||
# define BOOST_MPL_MSVC_70_ETI_BUG
|
||||
# define BOOST_MPL_MSVC_ETI_BUG
|
||||
#endif
|
||||
|
||||
#endif // BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED
|
||||
|
@@ -19,7 +19,7 @@
|
||||
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
|
||||
namespace boost { namespace mpl { namespace aux {
|
||||
|
||||
|
@@ -268,7 +268,7 @@ struct AUX_FOLD_CHUNK_NAME<-1>
|
||||
typedef typename res_::iterator iterator;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct result_<int,int,int,int,int>
|
||||
{
|
||||
@@ -405,7 +405,7 @@ struct AUX_FOLD_CHUNK_NAME<BOOST_PP_FRAME_ITERATION(1)>
|
||||
typedef BOOST_PP_CAT(iter,i) iterator;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct result_<int,int,int,int,int>
|
||||
{
|
||||
|
@@ -254,7 +254,7 @@ struct AUX_FOLD_CHUNK_NAME<-1>
|
||||
typedef typename res_::iterator iterator;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct result_<int,int,int,int>
|
||||
{
|
||||
@@ -363,7 +363,7 @@ struct AUX_FOLD_CHUNK_NAME<BOOST_PP_FRAME_ITERATION(1)>
|
||||
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) iterator;
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
//: ETI workaround
|
||||
template<> struct result_<int,int,int,int>
|
||||
{
|
||||
|
@@ -162,7 +162,7 @@ struct template_arity
|
||||
{
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
template<>
|
||||
struct template_arity<int>
|
||||
{
|
||||
|
@@ -20,7 +20,7 @@
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
|
||||
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \
|
||||
|| defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
|| defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
|
||||
# include "boost/mpl/int_c.hpp"
|
||||
|
||||
@@ -32,7 +32,7 @@ struct value_wknd
|
||||
{
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<>
|
||||
struct value_wknd<int>
|
||||
: int_c<0>
|
||||
@@ -42,7 +42,7 @@ struct value_wknd<int>
|
||||
|
||||
}}} // namespace boost::mpl::aux
|
||||
|
||||
# if !defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
# if !defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
# define BOOST_MPL_AUX_VALUE_WKND(C) ::boost::mpl::aux::value_wknd< C >
|
||||
# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) BOOST_MPL_AUX_VALUE_WKND(C)
|
||||
# else
|
||||
@@ -55,6 +55,6 @@ struct value_wknd<int>
|
||||
# define BOOST_MPL_AUX_VALUE_WKND(C) C
|
||||
# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) C
|
||||
|
||||
#endif // __BORLANDC__ || BOOST_MPL_MSVC_ETI_BUG
|
||||
#endif // __BORLANDC__ || BOOST_MPL_MSVC_60_ETI_BUG
|
||||
|
||||
#endif // BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED
|
||||
|
@@ -33,7 +33,7 @@ struct base
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,base,(T))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct base<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -87,7 +87,7 @@ struct is_sequence
|
||||
|
||||
#endif // BOOST_MSVC
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct is_sequence<int>
|
||||
: bool_c<false>
|
||||
{
|
||||
|
@@ -33,7 +33,7 @@ struct iterator_category
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,iterator_category,(Iterator))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct iterator_category<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -33,7 +33,7 @@ struct next
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,next,(T))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
template<> struct next<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -33,7 +33,7 @@ struct prior
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,prior,(T))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_70_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
template<> struct prior<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -33,7 +33,7 @@ struct select1st
|
||||
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,select1st,(Pair))
|
||||
};
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct select1st<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -21,6 +21,7 @@
|
||||
#include "boost/mpl/aux_/has_tag.hpp"
|
||||
#include "boost/mpl/aux_/has_begin.hpp"
|
||||
#include "boost/mpl/aux_/void_spec.hpp"
|
||||
#include "boost/mpl/aux_/is_msvc_eti_arg.hpp"
|
||||
#include "boost/mpl/aux_/config/eti.hpp"
|
||||
#include "boost/mpl/aux_/yes_no.hpp"
|
||||
#include "boost/mpl/aux_/config/workaround.hpp"
|
||||
@@ -63,30 +64,13 @@ struct sequence_tag_impl<false>
|
||||
};
|
||||
};
|
||||
|
||||
struct int_convertible_
|
||||
{
|
||||
int_convertible_(int);
|
||||
};
|
||||
|
||||
template< typename T >
|
||||
struct is_msvc_70_ETI_arg
|
||||
{
|
||||
static no_tag test(...);
|
||||
static yes_tag test(int_convertible_);
|
||||
static T get();
|
||||
|
||||
BOOST_STATIC_CONSTANT(bool, value =
|
||||
sizeof(test(get())) == sizeof(yes_tag)
|
||||
);
|
||||
};
|
||||
|
||||
} // namespace aux
|
||||
|
||||
template<
|
||||
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence)
|
||||
>
|
||||
struct sequence_tag
|
||||
: aux::sequence_tag_impl< !aux::is_msvc_70_ETI_arg<Sequence>::value >
|
||||
: aux::sequence_tag_impl< !aux::is_msvc_eti_arg<Sequence>::value >
|
||||
::template result_<Sequence>
|
||||
{
|
||||
};
|
||||
@@ -135,7 +119,7 @@ struct sequence_tag
|
||||
|
||||
#endif // BOOST_MSVC
|
||||
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
template<> struct sequence_tag<int>
|
||||
{
|
||||
typedef int type;
|
||||
|
@@ -76,7 +76,7 @@ struct unique
|
||||
>::type fold_result_;
|
||||
|
||||
public:
|
||||
#if defined(BOOST_MPL_MSVC_ETI_BUG)
|
||||
#if defined(BOOST_MPL_MSVC_60_ETI_BUG)
|
||||
// MSVC6.5 forces us to use 'select1st<fold_result_>::type' instead of
|
||||
// simple 'fold_result_::first' here
|
||||
typedef typename select1st<fold_result_>::type type;
|
||||
|
Reference in New Issue
Block a user