|
Boost : |
From: John Maddock (john_maddock_at_[hidden])
Date: 2002-09-17 06:11:16
The new MPL code is now breaking all of the type traits test programs with
C++ Builder 6.
First off there was a minor problem in integral_c.hpp caused by the recent
IBM C++ fixes (now fixed).
However there is a more serious problem in if.hpp caused by the line:
BOOST_MPL_AUX_VOID_SPEC(3, if_)
which if I've got it right expands to:
template<>
struct if_< void_,void_,void_ >
{
template< typename T1,typename T2,typename T3 , typename T4=void_,
typename T5=void_ > //error here
struct apply : if_< T1,T2,T3 > { };
};
namespace aux {
template< typename T1,typename T2,typename T3 >
struct template_arity< if_< T1,T2,T3 > >
{ static const int value = 3; };
template<>
struct template_arity< if_< void_,void_,void_ > >
{ static const int value = 3; };
}
The problem here is the nested template inside the if_ class, Builder 6
doesn't cope with default template parameters applied to template classes
that are themselves template class members. The fix is to remove the
default parameters and make sure that the apply template always gets passed
a full complement of parameters (it's only an implementation detail right?),
unfortunately you seem to be using this idiom quite a lot :-(
Hoping you can fix this...
John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk