Boost logo

Boost :

From: Howard Hinnant (hinnant_at_[hidden])
Date: 2003-01-24 22:39:01


On Friday, January 24, 2003, at 09:12 PM, Howard Hinnant wrote:

> struct A
> {
> private:
> A(const A&);
> };
>
> struct B
> : A
> {
> };
>
> char test[is_convertible<B, A>::value];
>
> On Metrowerks this gives:
>
> Error : illegal access from 'A' to protected/private member
> 'A::A(const A &)'
> (instantiating: 'is_convertible<B, A>')
> main.cpp line 14 tatic const bool value =
> sizeof(is_convertible_helper<U>::test(make<T>())) == 1;

Sorry, my example (from memory) was inaccurate:

#include <msl_utility>

struct A
{
};

struct B
{
private:
        B(const B&);
};

char test[!Metrowerks::is_convertible<B, A>::value];

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.

-Howard


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