ETI refactoring

[SVN r17613]
This commit is contained in:
Aleksey Gurtovoy
2003-02-24 00:50:54 +00:00
parent 2687c891ef
commit 932aec68f9
22 changed files with 31 additions and 47 deletions

View File

@@ -171,7 +171,7 @@ struct apply0 : F
BOOST_MPL_AUX_LAMBDA_SUPPORT(1, 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 //: workaround for the ETI bug
template<> template<>
struct apply0<int> struct apply0<int>
@@ -259,7 +259,7 @@ struct BOOST_PP_CAT(apply,i)
# endif // workarounds # endif // workarounds
#if defined(BOOST_MPL_MSVC_70_ETI_BUG) #if defined(BOOST_MPL_MSVC_ETI_BUG)
//: workaround for ETI bug //: workaround for ETI bug
template<> template<>
struct BOOST_PP_CAT(apply,i)<AUX_APPLY_N_SPEC_PARAMS(i, int)> struct BOOST_PP_CAT(apply,i)<AUX_APPLY_N_SPEC_PARAMS(i, int)>

View File

@@ -41,7 +41,7 @@ struct divides_c
#endif #endif
}; };
#if defined(BOOST_MPL_MSVC_70_ETI_BUG) #if defined(BOOST_MPL_MSVC_ETI_BUG)
template<> template<>
struct divides_c<long,0,0,0,0,0> struct divides_c<long,0,0,0,0,0>
{ {

View File

@@ -41,7 +41,7 @@ struct modulus_c
#endif #endif
}; };
#if defined(BOOST_MPL_MSVC_70_ETI_BUG) #if defined(BOOST_MPL_MSVC_ETI_BUG)
template<> template<>
struct modulus_c<long,0,0> struct modulus_c<long,0,0>
{ {

View File

@@ -35,7 +35,7 @@ struct as_sequence
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,as_sequence,(T)) 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> template<> struct as_sequence<int>
{ {
typedef single_view<int> type; typedef single_view<int> type;

View File

@@ -103,7 +103,7 @@ struct advance_backward< BOOST_PP_FRAME_ITERATION(1) >
typedef BOOST_PP_CAT(iter,BOOST_PP_FRAME_ITERATION(1)) type; 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 //: ETI workaround
template<> struct apply<int> template<> struct apply<int>
{ {

View File

@@ -102,7 +102,7 @@ struct advance_forward< BOOST_PP_FRAME_ITERATION(1) >
typedef BOOST_PP_CAT(iter,i) type; typedef BOOST_PP_CAT(iter,i) type;
}; };
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
//: ETI workaround //: ETI workaround
template<> struct apply<int> template<> struct apply<int>
{ {

View File

@@ -36,7 +36,7 @@ struct back_traits
template< typename Sequence > struct algorithm template< typename Sequence > struct algorithm
{ {
typedef typename end<Sequence>::type iter_; 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_; typedef typename prior<iter_>::type last_;
#else #else
typedef typename iter_::prior last_; typedef typename iter_::prior last_;

View File

@@ -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(begin, non_sequence_tag, void_)
AUX_AGLORITM_TRAIT_SPEC(end, 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(begin, int, int)
AUX_AGLORITM_TRAIT_SPEC(end, int, int) AUX_AGLORITM_TRAIT_SPEC(end, int, int)
#endif #endif

View File

@@ -22,9 +22,9 @@
// flags for MSVC 6.5's so-called "early template instantiation bug" // flags for MSVC 6.5's so-called "early template instantiation bug"
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300 #if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
# if BOOST_MSVC < 1300 # if BOOST_MSVC < 1300
# define BOOST_MPL_MSVC_ETI_BUG # define BOOST_MPL_MSVC_60_ETI_BUG
# endif # endif
# define BOOST_MPL_MSVC_70_ETI_BUG # define BOOST_MPL_MSVC_ETI_BUG
#endif #endif
#endif // BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED #endif // BOOST_MPL_AUX_CONFIG_ETI_HPP_INCLUDED

View File

@@ -19,7 +19,7 @@
#include "boost/mpl/aux_/config/eti.hpp" #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 { namespace boost { namespace mpl { namespace aux {

View File

@@ -268,7 +268,7 @@ struct AUX_FOLD_CHUNK_NAME<-1>
typedef typename res_::iterator iterator; typedef typename res_::iterator iterator;
}; };
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
//: ETI workaround //: ETI workaround
template<> struct result_<int,int,int,int,int> 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; typedef BOOST_PP_CAT(iter,i) iterator;
}; };
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
//: ETI workaround //: ETI workaround
template<> struct result_<int,int,int,int,int> template<> struct result_<int,int,int,int,int>
{ {

View File

@@ -254,7 +254,7 @@ struct AUX_FOLD_CHUNK_NAME<-1>
typedef typename res_::iterator iterator; typedef typename res_::iterator iterator;
}; };
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
//: ETI workaround //: ETI workaround
template<> struct result_<int,int,int,int> 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; 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 //: ETI workaround
template<> struct result_<int,int,int,int> template<> struct result_<int,int,int,int>
{ {

View File

@@ -162,7 +162,7 @@ struct template_arity
{ {
}; };
#if defined(BOOST_MPL_MSVC_70_ETI_BUG) #if defined(BOOST_MPL_MSVC_ETI_BUG)
template<> template<>
struct template_arity<int> struct template_arity<int>
{ {

View File

@@ -20,7 +20,7 @@
#include "boost/mpl/aux_/config/eti.hpp" #include "boost/mpl/aux_/config/eti.hpp"
#if defined(__BORLANDC__) && (__BORLANDC__ <= 0x561 || !defined(BOOST_STRICT_CONFIG)) \ #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" # 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<> template<>
struct value_wknd<int> struct value_wknd<int>
: int_c<0> : int_c<0>
@@ -42,7 +42,7 @@ struct value_wknd<int>
}}} // namespace boost::mpl::aux }}} // 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_VALUE_WKND(C) ::boost::mpl::aux::value_wknd< C >
# define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) BOOST_MPL_AUX_VALUE_WKND(C) # define BOOST_MPL_AUX_MSVC_VALUE_WKND(C) BOOST_MPL_AUX_VALUE_WKND(C)
# else # else
@@ -55,6 +55,6 @@ struct value_wknd<int>
# define BOOST_MPL_AUX_VALUE_WKND(C) C # define BOOST_MPL_AUX_VALUE_WKND(C) C
# define BOOST_MPL_AUX_MSVC_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 #endif // BOOST_MPL_AUX_VALUE_WKND_HPP_INCLUDED

View File

@@ -33,7 +33,7 @@ struct base
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,base,(T)) 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> template<> struct base<int>
{ {
typedef int type; typedef int type;

View File

@@ -87,7 +87,7 @@ struct is_sequence
#endif // BOOST_MSVC #endif // BOOST_MSVC
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
template<> struct is_sequence<int> template<> struct is_sequence<int>
: bool_c<false> : bool_c<false>
{ {

View File

@@ -33,7 +33,7 @@ struct iterator_category
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,iterator_category,(Iterator)) 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> template<> struct iterator_category<int>
{ {
typedef int type; typedef int type;

View File

@@ -33,7 +33,7 @@ struct next
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,next,(T)) 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> template<> struct next<int>
{ {
typedef int type; typedef int type;

View File

@@ -33,7 +33,7 @@ struct prior
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,prior,(T)) 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> template<> struct prior<int>
{ {
typedef int type; typedef int type;

View File

@@ -33,7 +33,7 @@ struct select1st
BOOST_MPL_AUX_LAMBDA_SUPPORT(1,select1st,(Pair)) 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> template<> struct select1st<int>
{ {
typedef int type; typedef int type;

View File

@@ -21,6 +21,7 @@
#include "boost/mpl/aux_/has_tag.hpp" #include "boost/mpl/aux_/has_tag.hpp"
#include "boost/mpl/aux_/has_begin.hpp" #include "boost/mpl/aux_/has_begin.hpp"
#include "boost/mpl/aux_/void_spec.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_/config/eti.hpp"
#include "boost/mpl/aux_/yes_no.hpp" #include "boost/mpl/aux_/yes_no.hpp"
#include "boost/mpl/aux_/config/workaround.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 } // namespace aux
template< template<
typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence) typename BOOST_MPL_AUX_VOID_SPEC_PARAM(Sequence)
> >
struct sequence_tag 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> ::template result_<Sequence>
{ {
}; };
@@ -135,7 +119,7 @@ struct sequence_tag
#endif // BOOST_MSVC #endif // BOOST_MSVC
#if defined(BOOST_MPL_MSVC_ETI_BUG) #if defined(BOOST_MPL_MSVC_60_ETI_BUG)
template<> struct sequence_tag<int> template<> struct sequence_tag<int>
{ {
typedef int type; typedef int type;

View File

@@ -76,7 +76,7 @@ struct unique
>::type fold_result_; >::type fold_result_;
public: 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 // MSVC6.5 forces us to use 'select1st<fold_result_>::type' instead of
// simple 'fold_result_::first' here // simple 'fold_result_::first' here
typedef typename select1st<fold_result_>::type type; typedef typename select1st<fold_result_>::type type;