10
I want to construct boost::variants containing default-constructed values, specified with a type index - without writing my own switch statement over the type index.
I figure this must be possible, somehow, with MPL?
To clarify though, the index is not a compile-time constant expression.
The use case is that I need to construct a variant which will later be replaced with one containing the correct value, but at this point I only know the type index. Think of it as a lazy deserialisation problem.