From 97a86d8bf6e3b6fa076639402fac364562c2af58 Mon Sep 17 00:00:00 2001 From: Arthur O'Dwyer Date: Tue, 11 Apr 2023 11:07:14 -0400 Subject: [PATCH] [coro.generator] Editorial fixes Iterators can't have been "previously obtained from" a by-value parameter; they must have been obtained elsewhere (e.g. from `x` and then `other` was move-constructed from `x`, so now we have iterators into `x`). `std::exchange(x, nullptr)` for `unique_ptr x` is equivalent to `std::move(x)`. --- source/ranges.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/ranges.tex b/source/ranges.tex index 8de263c0c4..8dd13d0594 100644 --- a/source/ranges.tex +++ b/source/ranges.tex @@ -15835,11 +15835,11 @@ Initializes \exposid{coroutine_} with \tcode{exchange(other.\exposid{coroutine_}, \{\})} and \exposid{active_} with -\tcode{exchange(\brk{}other.active_, nullptr)}. +\tcode{std::move(\brk{}other.active_)}. \pnum \begin{note} -Iterators previously obtained from \tcode{other} are not invalidated; +Iterators previously into \tcode{other} are not invalidated; they become iterators into \tcode{*this}. \end{note} \end{itemdescr} @@ -15889,7 +15889,7 @@ \pnum \begin{note} -Iterators previously obtained from \tcode{other} are not invalidated; +Iterators previously into \tcode{other} are not invalidated; they become iterators into \tcode{*this}. \end{note} \end{itemdescr}