
14 Jan
2008
14 Jan
'08
11:58 p.m.
Steven Watanabe wrote:
From the standpoint of the implementor of switch_, how do I figure out which Case is the default?
I thought it would be just a check:
mpl::empty
But if you want single labels for each Case, then, perhaps:
is_same
or somesuch. Am I missing something
Ok. I didn't like mpl::empty because of the following possibility:
switch_<r>(n)(case_range_c<0, N>(f), default(f));
If N is zero there's a problem.
Is case_range_c<0, 0> a valid case? If so, it can simply amount to a no-op (ignored). It won't match anything anyway. But, my instincts tell me that case_range_c should expect a valid range. Regards, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net