Created on 2012-03-28.00:00:00 last changed 130 months ago
Proposed resolution:
This wording is relative to N3376.
Change [alg.find.end] p2 as indicated:
template<class ForwardIterator1, class ForwardIterator2> ForwardIterator1 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> ForwardIterator1 find_end(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);[…]
-2- Returns: The last iterator i in the range [first1,last1 - (last2 - first2)) such that foranyevery nonnegative integer n < (last2 - first2), the following corresponding conditions hold: *(i + n) == *(first2 + n), pred(*(i + n), *(first2 + n)) != false. Returns last1 if [first2,last2) is empty or if no such iterator is found.
Change [alg.search] p2 and p6 as indicated:
template<class ForwardIterator1, class ForwardIterator2> ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2); template<class ForwardIterator1, class ForwardIterator2, class BinaryPredicate> ForwardIterator1 search(ForwardIterator1 first1, ForwardIterator1 last1, ForwardIterator2 first2, ForwardIterator2 last2, BinaryPredicate pred);[…]
-2- Returns: The first iterator i in the range [first1,last1 - (last2-first2)) such that foranyevery nonnegative integer n less than last2 - first2 the following corresponding conditions hold: *(i + n) == *(first2 + n), pred(*(i + n), *(first2 + n)) != false. Returns first1 if [first2,last2) is empty, otherwise returns last1 if no such iterator is found.
[…]
template<class ForwardIterator, class Size, class T> ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value); template<class ForwardIterator, class Size, class T, class BinaryPredicate> ForwardIterator search_n(ForwardIterator first, ForwardIterator last, Size count, const T& value, BinaryPredicate pred);[…]
-6- Returns: The first iterator i in the range [first,last-count) such that foranyevery non-negative integer n less than count the following corresponding conditions hold: *(i + n) == value, pred(*(i + n),value) != false. Returns last if no such iterator is found.
Change [alg.reverse] p4 as indicated:
template<class BidirectionalIterator, class OutputIterator> OutputIterator reverse_copy(BidirectionalIterator first, BidirectionalIterator last, OutputIterator result);[…]
-4- Effects: Copies the range [first,last) to the range [result,result+(last-first)) such that foranyevery non-negative integer i < (last - first) the following assignment takes place: *(result + (last - first) - i) = *(first + i).
Change [alg.partitions] p5 and p9 as indicated:
template<class ForwardIterator, class Predicate> ForwardIterator partition(ForwardIterator first, ForwardIterator last, Predicate pred);[…]
-5- Returns: An iterator i such that foranyevery iterator j in the range [first,i) pred(*j) != false, and foranyevery iterator k in the range [i,last), pred(*k) == false.
[…]
template<class BidirectionalIterator, class Predicate> BidirectionalIterator stable_partition(BidirectionalIterator first, BidirectionalIterator last, Predicate pred);[…]
-9- Returns: An iterator i such that foranyevery iterator j in the range [first,i), pred(*j) != false, and foranyevery iterator k in the range [i,last), pred(*k) == false. The relative order of the elements in both groups is preserved.
Change [alg.sorting] p5 as indicated:
-5- A sequence is sorted with respect to a comparator comp if for
anyevery iterator i pointing to the sequence andanyevery non-negative integer n such that i + n is a valid iterator pointing to an element of the sequence, comp(*(i + n), *i) == false.
Change [alg.nth.element] p1 as indicated:
template<class RandomAccessIterator> void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last); template<class RandomAccessIterator, class Compare> void nth_element(RandomAccessIterator first, RandomAccessIterator nth, RandomAccessIterator last, Compare comp);-1- After nth_element the element in the position pointed to by nth is the element that would be in that position if the whole range were sorted. Also for
anyevery iterator i in the range [first,nth) andanyevery iterator j in the range [nth,last) it holds that: !(*i > *j) or comp(*j, *i) == false.
Change [lower.bound] p2 as indicated:
template<lass ForwardIterator, class T> ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value); template<class ForwardIterator, class T, class Compare> ForwardIterator lower_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);[…]
-2- Returns: The furthermost iterator i in the range [first,last] such that foranyevery iterator j in the range [first,i) the following corresponding conditions hold: *j < value or comp(*j, value) != false.
Change [upper.bound] p2 as indicated:
template<lass ForwardIterator, class T> ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value); template<class ForwardIterator, class T, class Compare> ForwardIterator upper_bound(ForwardIterator first, ForwardIterator last, const T& value, Compare comp);[…]
-2- Returns: The furthermost iterator i in the range [first,last] such that foranyevery iterator j in the range [first,i) the following corresponding conditions hold: !(value < *j) or comp(value, *j) == false.
Change [alg.min.max] p21 and p23 as indicated:
template<class ForwardIterator> ForwardIterator min_element(ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Compare> ForwardIterator min_element(ForwardIterator first, ForwardIterator last, Compare comp);-21- Returns: The first iterator i in the range [first,last) such that for
anyevery iterator j in the range [first,last) the following corresponding conditions hold: !(*j < *i) or comp(*j, *i) == false. Returns last if first == last.
[…]
template<class ForwardIterator> ForwardIterator max_element(ForwardIterator first, ForwardIterator last); template<class ForwardIterator, class Compare> ForwardIterator max_element(ForwardIterator first, ForwardIterator last, Compare comp);-23- Returns: The first iterator i in the range [first,last) such that for
anyevery iterator j in the range [first,last) the following corresponding conditions hold: !(*i < *j) or comp(*i, *j) == false. Returns last if first == last.
[ 2013-09-29, Chicago ]
Apply to Working Paper
[ 2013-04-20, Bristol ]
Unanimous agreement on the wording.
Resolution: move to tentatively ready[alg.find.end] describes the behavior of find_end as returning:
The last iterator i in the range [first1,last1 - (last2 - first2)) such that for any nonnegative integer n < (last2 - first2), the following corresponding conditions hold: *(i + n) == *(first2 + n), pred(*(i + n), *(first2 + n)) != false.
Does "for any" here mean "for every" or "there exists a"? I think it means the former, but it could be interpreted either way.
Daniel: The same problem exists for the following specifications from Clause [algorithms]:History | |||
---|---|---|---|
Date | User | Action | Args |
2014-02-20 13:20:35 | admin | set | status: wp -> c++14 |
2013-09-29 10:45:42 | admin | set | messages: + msg6658 |
2013-09-29 10:45:42 | admin | set | status: voting -> wp |
2013-09-23 13:24:31 | admin | set | status: ready -> voting |
2013-05-20 16:25:01 | admin | set | messages: + msg6506 |
2013-05-20 16:25:01 | admin | set | status: new -> ready |
2012-07-22 13:20:28 | admin | set | messages: + msg6081 |
2012-03-28 00:00:00 | admin | create |