Boost logo

Boost :

Subject: Re: [boost] [type_erasure] Conflict with private member called data
From: Nigel Pattinson (nigel.pattinson_at_[hidden])
Date: 2016-07-22 14:30:37


On Wed, Jul 20, 2016 at 5:17 PM, Steven Watanabe <watanabesj_at_[hidden]>
wrote:

> On 07/20/2016 03:08 PM, Nigel Pattinson wrote:
> >
> > I'm running into a problem with the type erasure library when trying to
> > declare a member called 'data', e.g.
> >
> > <snip>
> >
> > This conflicts with the private member variable called 'data' in the any
> > class. SomeClass does compile, but attempting to call the data() does not
> > compile due to the conflict, with the error message being 'cannot access
> > private member ... ' .
>
> I tried to avoid this situation by mangling
> private member names, but I obviously forgot
> about this one (table too).
>
> The simplest workaround until I fix this is to use
> boost::type_erasure::call(has_data<void*()>(), x)
> instead of x.data().
>

Thanks Steven.

Cheers
Nigel


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