I see Boost.Switch_ was provisionally accepted back inJan 2008. I see some doc here: http://dancinghacker.com/switch But I can't see it released in recent boost versions
I need to select a type to dynamic_cast to based on a runtime index, so I would have the type in a mpl::vector, and use the switch_ to pick up the right type? I have under 20 types.
in pseudo c++11:
void f(std::size_t i, const T* obj) {
typedef mpl::vector
alltypes_t; const auto* drvobj = dynamic_cast<...>(obj); /// what do I set as arg of dynamic_cast
}
If switch_ can help, where do I get the code for it?
Hi,
You can simply use the 'std::map (o); ...; }}
,{1 , [](const void *obj){ derived1 *p = dynamic_cast ... const auto* drvobj = dynamic_cast<...>(obj);
/// what do I set as arg of dynamic_cast In that case the boost::switch_ not help you.