Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-10-17 13:27:46


"Joel de Guzman" <joel_at_[hidden]> writes:

> One more alternative, using MPL is:
>
> switch_(condition)
> [
> case_(int_<label1>())[expr1],
> case_(int_<label2>())[expr2],
> case_(int_<label3>())[expr3],
> default_(expr4)
> ]
>
> Yaiks!
>
> Actually,
>
> switch_(condition)
> [
> case_(label1)[expr1],
> case_(label2)[expr2],
> case_(label3)[expr3]
> default_[expr4]
> ]
>
> will work if label1..3 is declared as (example):
>
> mpl::int_<1> label1;
>
> mpl::int_<2> label2;
>
> mpl::int_<3> label3;
>
> Choose your pick :-)

I prefer those two for consistency's sake. Square brackets should
always mean the same thing in Phoenix/LL if possible.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk