Boost logo

Boost :

From: John Maddock (jm_at_[hidden])
Date: 2003-01-25 06:54:27


> Error : illegal access from 'B' to protected/private member
> 'B::B(const B &)'
> (instantiating: 'Metrowerks::is_convertible<B, A>')
> msl_utility line 472 tatic const bool value =
> sizeof(is_convertible_helper<U>::test(make<T>())) == 1;
>
> Haven't tried it with boost::is_convertible, but I suspect it would
> have the same problem.

Yes, it will, as will any implementation IMO, since however the conversion
is attempted an error must be produced. Likewise:

struct A{};
struct B: public A{};
struct C: public A{};
struct D: public B, public C{};

char test[!boost::is_convertible<D, A>::value]; // error ambiguous
conversion

One final point: the "passing a UDT through ellipsis" problem can be solved
(see boost implementation gcc specific version), however the code is only
accepted by a minority of compilers :-(

John Maddock
http://ourworld.compuserve.com/homepages/john_maddock/index.htm


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