14 Apr
2016
14 Apr
'16
6:39 a.m.
Hi, Is there a portable way (guaranteed by the interface) to do the following? I have an object 'ob' of type Ob and know its address. I know it is an active sub-object of a variant type, where Ob is one of the sub-types. Is there a way to compute the address of the containing variant object? The problem I am solving is to how to access the whole variant object from inside a static visitor: ``` using VariantOb = boost::variant<Ob>; struct MyVisitor : boost::static_visitor<> { void operator()(Ob const& ob) const { // --> get the address of the variant object ? boost::addressof(ob) + what_offset; ?? } }; ``` Regards, &rzej