Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2005-02-28 12:01:43


Larry Evans <cppljevans_at_[hidden]> writes:

> On 02/28/2005 07:16 AM, David Abrahams wrote:
> [snip]
>>>OTOH, I really should have said "make the result of a fold metafunction
>>>invokation into a sequence". Would that have been sufficient to make
>>>my meaning clear?
>> Not really. As I said, "fold and reverse_fold don't even have to
>> _return_ sequences." By that I mean that the result of invoking fold
>> might be, e.g. int.
>
> OK, granted, but I need it to be a sequence. I guess what I planned
> will not work on all results of fold, but it will work on at least some.
> Right now, I'm just trying to get it to work on what I need at the
> moment, which is part of a test driver. I guess I'll just write
> my own begin<fold<Sequence,StartState,ForwardOp> > and put it in
> my test driver directory.

That's misguided it seems to me. Your tuple_type is not a
specialization of fold. Are you really interested in making
specializations of fold into sequences?

You're folding some kind of cons cell, right? Don't you want to
implement begin and end on that?

  template <class A, class B>
  struct begin<inherit<A,B> >
  {
     ...
  };

or something?

> [snip]
>>>
>>>OTOH, I haven't really looked at fusion, so maybe I should. It's
>>>just I've found mpl very good and I've gotten used to it; hence,
>>> I'm reluctant to change.
>> It's not a change. Fusion is a compatible layer on top of MPL.
>>
>
> My other post mentioned visitors.hpp and its need for fold.
> How could fusion's tuple be used to implement visitors where
> the critical need is a StartState superclass for all instantiations
> of ForwardOp?

I'm not the guy to ask, sorry. Joel is the fusion expert, and... I
mean no offense by this, but I find your code hard to read and
understand, so I'm trying to be helpful while not getting entangled in
looking at its details because I think it will cost me too much time.

-- 
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