mpl and fusion containers: numbered vs variadic
Hello, Is it true that as a general rule, using the numbered version instead of the variadic version yields faster compile times? Or is it just about compilers supporting variadic templates? MM
"MM"
Is it true that as a general rule, using the numbered version instead of the variadic version yields faster compile times? Or is it just about compilers supporting variadic templates?
IIRC Fusion currently implements the variadic vector in terms of the fixed numeric ones. (And all other container on top of the vector.) This is, the use of a numeric vector should be slightly faster than the use of the variadic one. If C++11's variadic templates are used, it will be easiest to implement the numbered ones using an unnumbered, variadic implementation in combination with template aliases, though. Christopher
On 05/27/12 14:49, Christopher Schmidt wrote:
"MM"
writes: Is it true that as a general rule, using the numbered version instead of the variadic version yields faster compile times? Or is it just about compilers supporting variadic templates?
IIRC Fusion currently implements the variadic vector in terms of the fixed numeric ones. (And all other container on top of the vector.) This is, the use of a numeric vector should be slightly faster than the use of the variadic one.
If C++11's variadic templates are used, it will be easiest to implement the numbered ones using an unnumbered, variadic implementation in combination with template aliases, though.
Christopher Hi Christopher,
Could you please provide an example implementation of this C++11 implementation? I've no idea how template aliases could be used :( TIA. -regards, Larry
Larry Evans
Could you please provide an example implementation of this C++11 implementation? I've no idea how template aliases could be used :(
Actually it is the other way round, the language feature is called alias
template. (N3337, 14.5.7)
template
participants (3)
-
Christopher Schmidt
-
Larry Evans
-
MM