This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
tr1::type_traits question
- From: Peter Doerfler <gcc at pdoerfler dot com>
- To: libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 16 May 2006 17:18:29 +0200
- Subject: tr1::type_traits question
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 ;)