|
Boost : |
From: John Maddock (john_at_[hidden])
Date: 2004-07-17 06:20:10
The string algo library is currently failing with Borland's compiler because
it uses code like:
template< typename T >
class has_native_replace
{
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_native_replace_tester(t))==sizeof(yes_type) ) );
#else // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
public:
# if BOOST_WORKAROUND( __IBMCPP__, <= 600 )
enum { value = false };
# else
BOOST_STATIC_CONSTANT(bool, value=false);
# endif // BOOST_WORKAROUND( __IBMCPP__, <= 600 )
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
typedef mpl::bool_<value> type; //error here
};
Rather than adding yet another workaround, I think this can all be
simplified by just using:
#ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
template< typename T >
class has_native_replace
{
private:
static T* t;
public:
BOOST_STATIC_CONSTANT(bool, value=(
sizeof(has_native_replace_tester(t))==sizeof(yes_type) ) );
typedef mpl::bool_<value> type;
};
#else
template< typename T >
class has_native_replace : public mpl::bool_<false>
{
};
#endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
and similar for the other traits classes.
John.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk