
15 Apr
2012
15 Apr
'12
7:06 p.m.
On 04/15/12 08:02, paul Fultz wrote:
----- Original Message -----
From: Mathias Gaunard <mathias.gaunard@ens-lyon.org>
[snip]
Did you find a magic way to make a switch statement from a template parameter pack?
Well you can expand the parameter pack to create a static array of function pointers. This is how it is done in this implementation:
http://thenewcpp.wordpress.com/2012/02/15/variadic-templates-part-3-or-how-i...
[snip] IIUC, something similar was proposed earlier; however, a preprocessor generated switch statement was deemed faster: http://article.gmane.org/gmane.comp.lib.boost.devel/169739 However, maybe compiler's have improved since then. HTH. -regards, Larry