Boost logo

Boost :

From: Gennaro Prota (gennaro_prota_at_[hidden])
Date: 2003-01-28 08:07:50


--- John Maddock <jm_at_[hidden]> wrote:

> > Incidentally, I've noticed that boost's implementation of
> > is_base_and_derived has the same access-checking problems as
> > is_convertible. That could be easily fixed, as said in the thread
> > about is convertible, by using function templates:
> >
> >
> > typedef char (&no_type)[1];
> > typedef char (&yes_type)[2];
> >
> > template <typename T>
> > struct identity { typedef T type; };
> >
> > template <typename To>
> > no_type is_convertible(...);
> >
> > template <typename To>
> > yes_type is_convertible(typename identity<To>::type);
>
> IMO your identity template only serves to trip up less capable compilers, it
> does nothing to solve member access problems.

It's there just to force explicit specification of the target type. Yes, it has
nothing to with the main topic of this discussion so you can cut it away if you
find that convenient.

Genny.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com


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