Boost logo

Boost :

From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2008-01-12 15:17:51


Tobias Schwinger wrote:
> Joel de Guzman wrote:
>> c0, c1, ... cN Returns a fusion sequence of Case objects
> seemingly equivalent to
> (c0, c1, ... cN)
> (note: Application of comma operator ;-)).
> ?! Why doesn't it just return another (compound) Case object and leave
> the Sequence an unspecified implementation detail...

So you want switch_ to be

  template<class R, class I, class Cases>
  requires Case<Cases> && BuiltInIntegerOrEnum<I>
  R switch(I i, Cases cases);

IMO, There is a very big problem here.
Suppose that you have a fusion sequence that holds your
cases and function objects coming from somewhere else.
The problem of adapting it to switch_ is no easier than it
would be with my original interface.

In Christ,
Steven Watanabe

Boost list run by bdawes at, gregod at, cpdaniel at, john at