tr1::type_traits question

Peter Doerfler gcc@pdoerfler.com
Tue May 16 15:18:00 GMT 2006


Hi.

I've been looking at tr1::type_traits. In n1424 there is a paragraph:

....
The expression is_convertible<From,To>::value is ill-formed if:

Type From, is a void or incomplete type (3.9).

Type To, is an incomplete, void or abstract type (3.9).

.....

That makes me wonder why the testsuite in is_convertible.cc has
   VERIFY( (test_relationship<is_convertible, void, void>(true)) );
   VERIFY( (test_relationship<is_convertible, int, void>(true)) );
   VERIFY( (test_relationship<is_convertible, int[4], void>(true)) );

as the To type is void in these cases. I would have expected false for 
ill-formed cases. Or am I misunderstanding the proposal and these are 
not ill-formed.

There's probably an easy solution to this like like
"when ill-formed we do something the user might expect" but I don't 
understand.

A short comment for is_convertible_helper and its usage would be helpful 
in the sources.

And a lengthy one for is_convertible, but I could probably do that once 
I understand this issue. Is it allowed to reuse wording from the 
proposal for that?


Thanks, Peter


P.S. I've started the Copyright Assignment process. Only a few months now ;)



More information about the Libstdc++ mailing list