Boost logo

Boost :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2003-01-25 10:31:37


From: "Gennaro Prota" <gennaro_prota_at_[hidden]>
> On Sat, 25 Jan 2003 15:35:48 +0200, "Peter Dimov" <pdimov_at_[hidden]>
> wrote:
>
> > I.e. it is up to you to decide whether this is a bug or a
> >feature. My opinion is that it is a bug... except that From and To must
be
> >complete, of course, or is_convertible may violate ODR.
>
> I'm even more radical than that. Even the fact that is_convertible may
> violate ODR is a limitation of the current solution. I think we must
> *first* decide what we want then see how to implement it. If we want
> access checking to be performed in the context of usage then the class
> template is not adequate. And if we don't want that, then the class
> template is ok and no violation of ODR occurs (unless there's some
> reason other than access checking why value can depend on the context
> and I'm missing it right now).

class From;
class To;

enum { a = is_convertible<From, To>::value };

class From {};
class To: public From {};

enum { b = is_convertible<From, To>::value };


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