msvc fixes

[SVN r16481]
This commit is contained in:
Dave Abrahams
2002-12-02 19:03:39 +00:00
parent ef03d3bef0
commit e8b42afe69

View File

@ -46,6 +46,68 @@
#endif
#if defined(BOOST_MSVC) && BOOST_MSVC <= 1300
// Various hacks to reduce the occurrence of "internal structure overflow" messages
# if 1
# define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
template < typename T > struct trait; \
\
namespace mpl_rebind \
{ \
template < typename T > \
struct rebind_##trait \
{ \
enum { arity = 1 }; \
typedef T arg1; \
\
template< typename U1 > \
struct apply : trait< U1 > \
{ \
}; \
}; \
} \
\
template< typename T > struct trait \
BOOST_TT_AUX_BOOL_C_BASE(C) \
{ \
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
typedef mpl_rebind::rebind_##trait< T > rebind; \
}; \
/**/
# define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
template < typename T1, typename T2 > struct trait; \
\
namespace mpl_rebind \
{ \
template < typename T1, typename T2 > \
struct rebind_##trait \
{ \
enum { arity = 2 }; \
typedef T1 arg1; \
typedef T2 arg2; \
\
template< typename U1, typename U2 > \
struct apply : trait< U1,U2 > \
{ \
}; \
}; \
} \
\
template< typename T1, typename T2 > struct trait \
BOOST_TT_AUX_BOOL_C_BASE(C) \
{ \
BOOST_TT_AUX_BOOL_TRAIT_VALUE_DECL(C) \
typedef mpl_rebind::rebind_##trait< T1,T2 > rebind; \
};
/**/
# else
// this approach doesn't seem to work. For binary traits we often get
// the error message that 'rebind' is an undefined type. For either
// case we sometimes get the message that 'T' (or 'T1') is unknown.
# define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \
template< typename T > struct trait \
@ -55,11 +117,11 @@
struct rebind; \
}; \
\
template < typename X > \
struct trait< X >::rebind \
template < typename T > \
struct trait< T >::rebind \
{ \
enum { arity = 1 }; \
typedef X arg1; \
typedef typename trait<T>::arg1 arg1; \
template< typename U1 > \
struct apply : trait< U1 > \
{ \
@ -67,7 +129,6 @@
}; \
/**/
# define BOOST_TT_AUX_BOOL_TRAIT_DEF2(trait,T1,T2,C) \
template< typename T1, typename T2 > struct trait \
BOOST_TT_AUX_BOOL_C_BASE(C) \
@ -76,19 +137,21 @@
struct rebind; \
}; \
\
template < typename X1, typename X2 > \
struct trait< X1,X2 >::rebind \
template < typename T1, typename T2 > \
struct trait< T1,T2 >::rebind \
{ \
enum { arity = 2 }; \
typedef X1 arg1; \
typedef X2 arg2; \
template< typename U1, typename U2 > \
struct apply : trait< U1,U2 > \
typedef T1 arg1; \
typedef T2 arg2; \
template< typename X1, typename X2 > \
struct apply : trait< X1,X2 > \
{ \
}; \
}; \
/**/
# endif
#else
# define BOOST_TT_AUX_BOOL_TRAIT_DEF1(trait,T,C) \