Boost logo

Boost :

From: Giovanni Bajo (giovannibajo_at_[hidden])
Date: 2002-07-19 17:26:46


----- Original Message -----
From: "Aleksey Gurtovoy" <agurtovoy_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Saturday, July 20, 2002 12:02 AM
Subject: RE: [boost] mpl::erase with vector_c

> That's not a bug - 'list' does not support 'push_back', because it's not
> possible to implement it in the way that would satisfy the algorithm's
> complexity requirements - see
> http://www.mywikinet.com/mpl/ref/Reference/push_back.html and
> http://www.mywikinet.com/mpl/ref/Reference/list.html.

The problem is that this breaks the orthogonality between algorithms and
containers. That is, I can't write an algorithm that works with both vectors
and lists (or I have to specialize it so that it uses different codepaths).
Which is not what I'd expect.

> FWIW, 'copy_if' + 'push_back' is equivalent to 'copy_backward_if' +
> 'push_front'.

Yes, I had this workaround already in place :)

Giovanni Bajo


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