I'm wondering if it is possible to start a
std::search() from the end of the range as opposed to the beginning. I know
find_end would be sufficient, but I would like to specifically know if this is possible with
search. An example:
I have a data set
1 2 3 4 5 1 2 | 3 4 5 6 7 1 3 where the
| represents a break in the range, these two partitions will be executed asynchronously.
Is it possible to search for the range
1 2 starting from the last point in the partition? I would think it would be possible to do some sort of reverse iterator on both the range and the subsequence?
search(reverse_iter_begin, reverse_iter_end, reverse_iter_subseq_begin, reverse_iter_subseq_end)
std::find_end is specially written for containers that have only a forward iterator. For example you can use
Of course you may use
std::search with bidirectional iterators either applying iterator adapter
std::reverse_iterator or uing a built-in reverse iterator of a container as for example the reverse iterator of class std::vector where you can use member functions