Bruce Trask
The syntax of the SWITCH I was referring to is the one on page 439 of Generative Programming. I.e.
<snip>
with the usage syntax of SWITCH
> > ::RET::func();
Am I missing what you are saying here?
Where?
My real code is a hair more complicated but even so, I guess this is the heart of my question and it stems from page 62 of C++ Template Metaprogramming section on Type Selection, where you and Aleksey talk about the alternative of using classes with mnemonic names versus ad hoc template specializations.
So my question is, do you guys have a rule of thumb for going with ad hoc specializations versus using metafunctions with mnemonic names or is it just whether is reads better at the point of the call?
Personally, I do the latter, though ad hoc specializations will tend towards being harder to read so even that informal rule leads to avoiding specializations. Sometimes I'm also trying to accomodate broken compilers where partial specialization doesn't work, so I end up avoiding them for that reason as well. -- Dave Abrahams Boost Consulting www.boost-consulting.com