Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-25 05:25:51


On Sat, 25 Jan 2003 01:45:37 +0200, "Peter Dimov" <pdimov_at_[hidden]>
wrote:

>But how does this apply to is_convertible<X, int> when a private X::operator
>int()? Or are you discussing something else?
>
>I see no reason to make that undefined behavior. It's either "false", "true"
>(Comeau says true BTW), "unspecified", or "ill formed, no diagnostic
>required" - in order of preference.

I think we must still answer the fundamental question: *why* we need
is_convertible applied to a type instead of an expression? If you
check convertibility it's because you want to convert something,
right? Then what can you legally convert if not an expression? Given
that, why not using the function templates I gave in my other posting?
As you know (you are the one who suggested that solution for
implicit_cast), with them access checking is made in the context of
the function call expression, so we get rid of the problem completely.
No?

Genny.


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