
Mathias Gaunard-2 wrote
On 15/04/12 11:57, Florian Goujeon wrote:
Hi Boosters,
I'd like to know if anybody were working on a C++11 version (using variadic
templates) of Boost.Variant.
Variadic templates would not help at all with Boost.Variant.
I've written an implementation.
Did you find a magic way to make a switch statement from a template parameter pack?
Why not just use template partial specialization to explicitly expand the first N template arguments into a switch statement and recursively expand the remaining arguments in the default case if that fails? Something along the lines of recursive_apply <Args...>::apply(index) with the default case calling recursive_apply <Tail...>::apply(index-N) should suffice...is there some subtly I'm missing here? -- View this message in context: http://boost.2283326.n4.nabble.com/Variant-C-11-variadic-template-implementa... Sent from the Boost - Dev mailing list archive at Nabble.com.