[lib++][ranges][NFC] Refactor `iterator_operations.h` to use tags.
authorKonstantin Varlamov <varconst@apple.com>
Wed, 13 Jul 2022 00:52:14 +0000 (17:52 -0700)
committerKonstantin Varlamov <varconst@apple.com>
Wed, 13 Jul 2022 00:53:58 +0000 (17:53 -0700)
commit295b951ebcfea8d1fedf8abf4ffd449a83a551fd
tree4237d2afc5cb06b01af1b6ebb08626fdd0632393
parentfcbb4e1fa42793edc9531d59d047e6bd0909d3d3
[lib++][ranges][NFC] Refactor `iterator_operations.h` to use tags.

Change the mechanism in `iterator_operations.h` to pass around a generic
policy tag indicating whether an internal function is being invoked from
a "classic" STL algorithm or a ranges algorithm. `IterOps` is now
a template class specialized on the policy tag.

The advantage is that this mechanism is more generic and allows defining
arbitrary conditions in a clean manner.

Also add a few more iterator functions to `IterOps`.

Differential Revision: https://reviews.llvm.org/D129390
libcxx/include/__algorithm/equal_range.h
libcxx/include/__algorithm/iterator_operations.h
libcxx/include/__algorithm/lower_bound.h
libcxx/include/__algorithm/ranges_binary_search.h
libcxx/include/__algorithm/ranges_lower_bound.h
libcxx/include/__algorithm/ranges_set_intersection.h
libcxx/include/__algorithm/ranges_upper_bound.h
libcxx/include/__algorithm/set_intersection.h