Boost logo

Boost :

Subject: Re: [boost] [fusion] pop_back doesn't work on fwd sequences
From: Eric Niebler (eric_at_[hidden])
Date: 2011-08-11 00:19:13


On 8/10/2011 3:06 PM, Joel de Guzman wrote:
> On 8/11/2011 4:04 AM, Joel de Guzman wrote:
>
>> Hmmmm. now that I think about it, it is also possible to change the
>> implementation of pop_back to make it so that it would not need
>> to use 'prior'. The end iterator can be abstracted such that it
>> compares equal to i through next(i). I'll see if that works out.
>
> Yep. It works like a charm. I have a fix. Now this works:
>
> {
> list<int, int> l(1, 2);
> std::cout << pop_back(l) << std::endl;
> BOOST_TEST((pop_back(l) == make_list(1)));
> }
>
> Now, indeed, the docs works as advertized.
>
> Thanks for your nudging, Eric. I truly appreciate it. You get my
> neurons humming. Committed to trunk. I'd welcome a quick review
> before I make this official.

Very clever! Looks good to me.

-- 
Eric Niebler
BoostPro Computing
http://www.boostpro.com

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