Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-02-16 06:45:30

> typedef test::remove_pointer< int A::* >::type t1;
> typedef test::remove_pointer< int A::* const >::type t2;
> typedef test::remove_pointer< int A::* volatile >::type t3;
> typedef test::remove_pointer< int A::* const volatile >::type t4;

Those should not work: or maybe you want them to do nothing? Whatever you
can't remove the pointer from a member pointer because the result is not a
valid type. However the boost implementation should compile (so it's a
bug), I'll look into it when I get some space.

> typedef test::add_const< int( int ) >::type t5;
> typedef test::add_volatile< int( int ) >::type t6;
> typedef test::add_cv< int( int ) >::type t7;

That compiles but emits warnings on gcc, fails to compile on other
compilers, the docs say: "The same as "T const" for all T" which means that
function types are effectively banned (because cv-qualifed functions are
banned), we can filter the template through is_function to avoid that
though - I'm not sure how common the situation would be though.

> typedef char t8[ test::is_convertible< double, int >::value ];

That one issues a warning: for other compilers we are able to suppress that,
if you have any ideas on how to do so with gcc I'd be happy to hear about

> typedef char t9[ !test::is_class< int( int ) >::value ];

Generates warnings on gcc only, these have been reported and confirmed as a
gcc bug:

> typedef char t10[ !test::is_enum< int( int ) >::value ];

again that's a gcc 3.2 bug.

> I won't try to fix any of these anymore. I neither understand the
> documentation nor the implementation of boost's type-traits. I tried to
> make the code better but AFAICS there is no interest in improvment.

There's always interest - but please remember that:

a) we have limited time for testing new ideas - the more you can do to make
this easy the better, especially as there is a new boost release imminent,
along with a deadline for committee meeting papers real soon now :-(
b) experience suggests that almost any changes to type traits break
something, sorry but that's the way it is.
c) several of your ideas I did test on other compilers, but didn't get very
far (I should have reported this before, sorry) your is_function version
doesn't work with any of the popular win32 compilers for example - and yes I
know that the standard says that it should work :-(

John Maddock

Boost list run by bdawes at, gregod at, cpdaniel at, john at