Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-07-19 20:01:36

You might consider turning the way you think of vector around so that
push_front is actually what you're now calling push_back. You can still
index it in O(1) I think.


----- Original Message -----
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>

> It is a problem. Actually, you can, using 'insert', but it would be
> inefficient on one or another type of sequence. An interesting thing is
> we have the same situation in STL (there is no unified efficient way to
> insert something into container), but it's not a problem there because
> of STL algorithms work "in place" by modifying the sequence elements, and
> compile-time world we need to put the results somewhere else - i.e. push
> into a new sequence. Anyway, I guess a right solution for this is to
> one of the sequence insert operations mandatory for any Extensible
> 'push_front' seems to be the only reasonable candidate for this, since
> implementable for pretty much everything. I'll think a little bit more
> it, but if you need a uniform way to copy a sequence right away :),
> 'copy_backward' + 'push_front' to be it.
> Thank you for your comments,
> Aleksey
> _______________________________________________
> Unsubscribe & other changes:

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