Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2001-08-23 06:10:42


When compiling another_tuple_test_bench.cpp, I get internal compiler errors
in type_traits:

template <typename T>
struct is_const
{
private:
   static T t;
public:
   BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) ==
sizeof(detail::is_const_helper(&t)))); // error here
};

Leaving aside whether the above is legal (I don't see is_const<>::t defined
anywhere, this modification fixes the problem:

template <typename T>
struct is_const
{
private:
   static T * t();
public:
   BOOST_STATIC_CONSTANT(bool, value = (sizeof(detail::yes_type) ==
sizeof(detail::is_const_helper(t()))));
};

is_volatile suffers from the same problem.

is_array also fails to compile due to the same 'static T t' problem, but I
don't see a simple way to fix it. For now I've made it return false. ;-)

--
Peter Dimov
Multi Media Ltd.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk