
26 Sep
2008
26 Sep
'08
4:17 p.m.
On Fri, Sep 26, 2008 at 4:53 PM, Giovanni Piero Deretta <gpderetta@gmail.com> wrote:
do this:
switch_(arg1) [ case(1)[cout << val("one") << '\n'], case(2)[cout << val("two") << '\n'], default_[cout << val("other value"] << '\n') ]
this allows not only runtime selection of switch case values, but it will also work with everything that is equally comparable:
switch_(arg1) [ case("one")[cout << val(1) << '\n'], case("two")[cout << val(2) << '\n'], default_[cout << val("other value"] << '\n') ]
which IMHO is a killer feature.
Blimey, yes, that really is worth having! BTW I assume 'case' is meant to read 'case_'? - Rob. -- ACCU - Professionalism in programming - http://www.accu.org