Boost logo

Boost Users :

From: David Abrahams (dave_at_[hidden])
Date: 2003-05-19 14:37:52


Tarjei Knapstad <tarjeik_at_[hidden]> writes:

> On Fri, 2003-05-16 at 18:44, David Abrahams wrote:
>> Tarjei Knapstad <tarjeik_at_[hidden]> writes:
>>
>> > So, problem solved for now, but I'd still like to use pop_back and know
>> > why it failed...
>>
>> list is like a singly-linked list at runtime: you can't do pop_back()
>> because it's not an O(1) operation.
>>
> I see, but does that go for the other mpl containers as well? pop_back
> fails on all of list, vector, list_c, vector_c and range_c.

pop_back will work on vector[_c] soon. In fact, vector[_c] will
probably be implemented as an alias to deque[_c] (coming soon) because
there isn't enough savings in having a sequence that's only extensible
at the front.

> Can't say I see any good reason to supply an algorithm that's not
> working with any of the containers ;)

It's a temporary condition. Someone convinced Aleksey during the
review period that vector ought to supply front- rather than
back-extensibility, so that vector might be exchanged with list.
We're not sure it was a good choice anymore ;-)

HTH,

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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