Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[iterator.concept.writable] Double if and one-item list #2568

Closed
JohelEGP opened this issue Dec 7, 2018 · 2 comments
Closed

[iterator.concept.writable] Double if and one-item list #2568

JohelEGP opened this issue Dec 7, 2018 · 2 comments

Comments

@JohelEGP
Copy link
Contributor

JohelEGP commented Dec 7, 2018

draft/source/iterators.tex

Lines 1227 to 1236 in 38eb5e5

Let \tcode{E} be an an expression such that \tcode{decltype((E))} is \tcode{T},
and let \tcode{o} be a dereferenceable object of type \tcode{Out}.
\tcode{Out} and \tcode{T} model \tcode{Writable<Out, T>} only if
\begin{itemize}
\item If \tcode{Out} and \tcode{T} model
\tcode{Readable<Out> \&\& Same<iter_value_t<Out>, decay_t<T>{>}},
then \tcode{*o} after any above assignment is equal to
the value of \tcode{E} before the assignment.
\end{itemize}

This one-item list starts with an if, but its introducing paragraph ends with an if too.

@jensmaurer jensmaurer assigned jensmaurer and unassigned jensmaurer Dec 7, 2018
@jensmaurer
Copy link
Member

And, reading through this, it seems intentional. The point here is that (beyond the syntactic requirements), a Writeable iterator that happens to also be a Readable iterator guarantees that you can read the just-written value back from the iterator. (Assuming the value types are the same.)
Just merging the duplicate "if"s would change the semantics.

@JohelEGP
Copy link
Contributor Author

JohelEGP commented Dec 7, 2018

Right. After many rereads of your comment and the wording, I get it. Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants