Boost logo

Boost :

Subject: Re: [boost] On Iteration
From: Christian Holmquist (c.holmquist_at_[hidden])
Date: 2009-11-11 20:48:32


> For this particular case, the usual answer is that you should be using
> a sentinel-terminated range instead of the find, something like this:
>
> auto before_part = before(v.all(), X);
>
>
Is vector<T>::erase polymorphic?

I assume the following is a valid way to clear a vector
v.clear(v.all());

So, what exactly does v.all() return? RandomAccessRange<???>?
If so, would the following compile?

deque<int> d;
vector<int> v;
v.clear(d.all());

Here we'd lose some static checks compared to current stl, the above is
obviously illegal.

Utterly confused,
Christian


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