Dear Users and Developers,
I am currently working on a kind of discriminated union type, e.g. XDR specific union type
implementation (please refer to http://www.faqs.org/rfcs/rfc1832.html section) which maps
enumeration values to types. In this case one wants to provide users as much comfort as possible
for accesing this union. I have written a template class, which is defined by mpl::vector pairs of
discriminant and related type. This class contains a boost::variant definition from this sequence.
The problem is, that accessing the values etc. of this variant is a little bit clumsy:
discriminated_union_inst.get<some const int for discrminant>();
discriminated_union_inst.set<some const int for discrminant>(new value);
So I defined some accessor template. If initialized the accessor is responsible to access only one
particular discriminant related type
for example if discriminated_union is defined by sequence of:
mpl_derived_pair<0, int>, mpl_derived_pair<1, std::string> ... mpl_derived_pair