|
Boost : |
From: Aleksey Gurtovoy (alexy_at_[hidden])
Date: 2001-08-23 07:10:30
Peter Dimov wrote:
> When compiling another_tuple_test_bench.cpp, I get internal
> compiler errors in type_traits:
[snip]
I suppose you are talking about VC7.x, because MSVC6.0 SP5 compiles
type_traits headers without a single problem. Besides missing definitions of
traits classes' static 't' member, the questioned code is perfectly legal,
and the real source of the problems you've described is that the new version
of MS compiler still does not properly support static class data members of
const integral/enumeration types. In particular, any expression in form of
"sizeof(& <dependent-name>)", e.g.
template<typename T>
struct her
{
static T t;
};
template<typename T>
struct my
{
static bool const value = sizeof(&her<T>::t);
};
is very likely to cause an infamous ICE there. This is definitely a
deficiency of the compiler, and IMO, instead of "fixing" the code, we should
disable the broken feature until it gets usable (#define
BOOST_NO_INCLASS_MEMBER_INITIALIZATION, right now it gots enabled by default
if _MSC_VER > 1200).
Aleksey
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk