Boost logo

Boost :

From: Aleksey Gurtovoy (agurtovoy_at_[hidden])
Date: 2002-07-19 17:02:07


Giovanni Bajo wrote:
> I can't make erase<> work with vector_c<>, with Comeau 4.3.
> It complains with unparsable errors related to specializations of
> push_front<> not found for vector_c<>.

That's a bug - 'vector' should specialize the default 'erase' (and, most
probable, 'insert') implementation (which requires 'push_front', which
'vector' doesn't support) to use 'push_back' (or may be provide a
'push_front' - it's doable). I'll look into it on the weekend.

> A very similar problem happens with test\copy_if.cpp: just change
> push_front<> into push_back<> and the sample won't work
> anymore (this time, it's push_back which isn't happy of list_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.

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

Aleksey


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