Boost logo

Boost :

From: degski (degski_at_[hidden])
Date: 2019-06-27 07:40:50

On Thu, 27 Jun 2019 at 10:33, Gavin Lambert via Boost <boost_at_[hidden]>

> On 27/06/2019 19:06, degski wrote:
> > Yes, but std::swap must also not invalidate any references, pointers,
> or
> > iterators referring to the elements of the containers being swapped,
> which
> > leaves the scope for throwing rather small [if at all possible].
> Are you sure about that?
> Perhaps it is a failure of my imagination (or I'm misunderstanding what
> you're saying), but that doesn't even seem possible.

I'm just reading (
"After container move construction (overload (6)), references, pointers,
and iterators (other than the end iterator) to other remain valid, but
refer to elements that are now in *this. The current standard makes this
guarantee via the blanket statement in
§23.2.1[container.requirements.general]/12, and a more direct guarantee is
under consideration via LWG 2321

Possibly I'm reading it wrongly, please set me right in that case. LWG 2321
<> goes on
about std::swap as well.


"Anyone who believes that exponential growth can go on forever in a finite
world is either a madman or an economist" - Kenneth E. Boulding

Boost list run by bdawes at, gregod at, cpdaniel at, john at