Boost logo

Boost :

From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2002-08-01 18:43:45


----- Original Message -----
From: "David Abrahams" <dave_at_[hidden]>

> I think this is a slightly hasty analysis. In general we need to know a bit
> about the internals of the compiler to say what goes on. For example,
> insertion in a dot-style list may only require copying the head part of the
> list:

Okay, maybe a little. :)

> > Given that this is the case, the most efficient solution would be to
> always use
> > a tuple-like (i.e. vector-like) container that can hold a huge number of
> > elements.
>
> I'm not sure. When things get really large, push_front on a cons-style list
> could easily be faster than copying all those pointers.

When things get really large, you are entering the realm of impracticality. Not
everything should be done within the language itself.

> > On the other hand, the most extensible solution would be to use a
> > cons-style list. One or the other is fine, but both is unnecessary.
>
> I agree with you and Andrei that some numbers would really help with the
> analysis. However, I think even with the numbers I'd be reluctant to give
> up the flexibility at this stage, especially if it's not costing us much.

Yeah, I think only time will tell.

> There are other reasons to be able to work with different sequences. For
> example, if someone already has a program full of Loki typelists and wants
> to use an MPL algorithm, they can do it. A program that manipulates
> boost::tuple can treat the tuple's types as an MPL sequence.

This is a good point, IMO, but I also think it only goes so far. I think it is
fair to say that rolling-your-own is typically frowned on when something already
exists.

> I realize that
> these all have cons-style structures, but their types /are/ expressed
> differently from mpl type_list, and from one another. Not being hardcoded
> to use a single type list structure still has great advantages, and as
> Emily said I appreciate the flexibility to experiment with other
> structures.

I'm just not sure about the real benefit, in the fully generic sense, of
compressing a more complicated non-sequencial structure into a sequence. As I
said, only time will tell, and I agree, the MPL does provide the foundation to
experiment with this sort of thing.

Paul Mensonides


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