Boost logo

Boost :

From: Terje Slettebø (tslettebo_at_[hidden])
Date: 2002-08-13 08:01:55


>From: "Paul Mensonides" <pmenso57_at_[hidden]>

> > From: "David B. Held" <dheld_at_[hidden]>
> >
> > I guess I just don't know what would convince you that the STL/MPL
> > comparison is valid.
>
> I am not saying absolutely that it is invalid. I am simply saying that
> there are red flags and that we are paying a price for generality that
very well
> may not be needed. In my opinion, that makes the library, at this point,
> experimental rather than practical.

In what way would standardising to a certain sequence type, that all
sequence providers have to conform to this type, or provide converters, make
it simpler than standardising on iterators?

It appears to me that standardising at something more specific, such as a
specific sequence like vector, would make it more complex, because the
requirements would be more specific. FYI, vector doesn't even work on Intel
C++, which I use, possibly due to the PP stuff making the EDG based compiler
grind to a halt. If there was only vector at MPL, it would mean I couldn't
use any sequence, there. If this is not a compelling reason for several
possible sequence types, then I don't know what is.

> Currently, I see no real use for that
> generality. Even if there were a couple different valid sequence types
> (maybe a
> vector (or typelist) and a map), I still don't think that would validate
> the full generality that the library uses. It is easy to define a
sequence
> converter if necessary.

Why would this be easier than providing iterators? If you want to use
programming that suits the FP MP engine, then I think lists are the way to
go, because it's quite easy to write recursive routines with them. How would
you do that with a vector? I've given some examples for MPL usage, perhaps
you could give some concrete examples as well, of what you think would be
better? I think that would make it easier to understand why you find
iterators to be an overhead, and standardising on one sequence not to be it.

> Look, all I've been asking for is a single example that illustrates one
> thing being better than another *and* vice-versa. I know full well that
at this
> point things aren't going to change. And, obviously, only time will tell.
> Generality for the sake of generality is a waste of time (practically
speaking, it is
> intellectually interesting).

You have already got examples. You have, however, not shown why it would be
easier to use a standard sequence, than iterators. How would you use e.g.
vector, that you suggest, in algorithms? This could help to make the
discussion more concrete. That was also my reason for providing the
"factorial" example. As it had been asked for things that was easy to do in
MPL, but hard to do without it, I gave such an example.

Regards,

Terje


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