On Wed, Oct 24, 2012 at 9:56 AM, Jerome <[email protected]> wrote: >> Remark 1: I understand that your mixin will be expanded into cascaded >> if...else statements. It would probably be more efficient to expand into >> switch...case, don't you think? > > > Oh! I've just figured out that it is not a mixin, but a function template.
That was to allow runtime arguments to be used. In your example, value is a compile-time argument. In this case, all tests can be done at CT and your code should result *only* in the right branch: no need to develop an entire switch statement.
