Boost logo

Boost Users :

From: Joel de Guzman (joel_at_[hidden])
Date: 2008-01-13 05:19:44


Tobias Schwinger wrote:
> Joel de Guzman wrote:
>> Steven Watanabe wrote:
>>> AMDG
>>>
>>> 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.
>> Oh man, either my headache is killing me, or I am currently in
>> dumb mode. I can't understand both Tobias and Steven. What's
>> a "compound Case object"?
>
> (c0,c1,...,cN) being just another 'Case' rather than a 'Sequence'.

o..k... Hmm.. so how would the resulting case object for this
expression look like:

     case_c<1>(f1), case_c<2>(f2)

?

Regards,

-- 
Joel de Guzman
http://www.boost-consulting.com
http://spirit.sf.net

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net