Boost logo

Boost :

Subject: [boost] [type_erasure] Conflict with private member called data
From: Nigel Pattinson (nigel.pattinson_at_[hidden])
Date: 2016-07-20 17:08:20


Hi

I'm running into a problem with the type erasure library when trying to
declare a member called 'data', e.g.

BOOST_TYPE_ERASURE_MEMBER((has_data), data)

using SomeClass =
    any<
        vector<
            copy_constructible<>,
            typeid_<>,
            relaxed,
            has_data<void*()>
>
>;

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'm not sure if this is a limitation in the library or a compiler bug - I'm
using Visual Studio 2015 Update 1. Using boost 1.57.0 at present, I could
use a more recent version if that would help.

Does anyone know of a possible workaround ?

Thanks
Nigel Pattinson


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