From f26ebd0fcaca6ea4231d2c969f25a31990012d95 Mon Sep 17 00:00:00 2001 From: Mathias Stearn Date: Tue, 1 Feb 2022 11:41:05 +0100 Subject: [PATCH] [iterator.operations] clarify preconditions on std::distance The prior wording implied that the two sides of the "or" were independent, so as long as `last` was reachable from `first`, `first` didn't need to be reachable from `last` even if passing a `RandomAccessIterator`. It seems clear that it is really trying to express two different possible preconditions depending on whether a `RandomAccessIterator` is passed or not. I used the same phrasing as in the "Effects:" clause to separate the cases. --- source/iterators.tex | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/iterators.tex b/source/iterators.tex index ce9786e65a..6c515ab24a 100644 --- a/source/iterators.tex +++ b/source/iterators.tex @@ -2806,10 +2806,10 @@ \begin{itemdescr} \pnum \expects -\tcode{last} is reachable from \tcode{first}, or -\tcode{InputIterator} meets -the \oldconcept{RandomAccessIterator} requirements and -\tcode{first} is reachable from \tcode{last}. +If \tcode{InputIterator} meets the \oldconcept{RandomAccessIterator} requirements, +\tcode{first} is reachable from \tcode{last}; otherwise, +\tcode{last} is reachable from \tcode{first}. + \pnum \effects