Description
During the qualification of the C++ STL Validas has pointed me to the following issue:
The specification of [alg.search] has a wrong range.
Currently the range is "[first1, last1 - (last2 - first2))" (exclusive) but should be "[first1, last1 - (last2 - first2)]" (inclusive).
So please correct the closing ")" to "]". Otherwise the last occurence will not be found.
We observed the issue in C++14 and C++17 and cppreference.com
The implementations do the right thing and work correctly and find even the last occurence.
For example in the list {1, 2, 3, 4, 5} the pattern {4,5} should be found (obviously).
In the case the last element is not included it will not be found.
The attached programm shows that the implementation is working and find the pattern.
rangebug.cpp.txt