Boost logo

Boost Users :

Subject: [Boost-users] [type_erasure] any holding a ref to any
From: Joaquin M López Muñoz (joaquinlopezmunoz_at_[hidden])
Date: 2017-05-31 09:25:31


Say I have an object a of type

any<mpl::vector<Concept1,typeid_<>>,_self&>

and an object b of type

   any<Concept2,T>

where Concept1 is a subconcept of Concept2. Is it possible to make
a refer to b rather than the object wrapped by b? I mean:

   any_cast<void*>(&a)==&b
typeid_of(a)==typeid(b)

A solution involving wrapping/copying b into some auxiliary entity would
be acceptable too. This questin is obviously connected to the
implementation of boost::any_collection, as Steven will undoubtedly have
guessed.

Thank you,

Joaquín M López Muñoz



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net