[libcxx-commits] [PATCH] D129390: [lib++][ranges][NFC] Refactor `iterator_operations.h` to use tags.

Konstantin Varlamov via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jul 8 12:39:03 PDT 2022


var-const created this revision.
Herald added a project: All.
var-const requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added subscribers: libcxx-commits, sstefan1.
Herald added a project: libc++.
Herald added a reviewer: libc++.

Change the mechanism in `iterator_operations.h` to pass around a generic
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 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`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D129390

Files:
  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_upper_bound.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D129390.443327.patch
Type: text/x-patch
Size: 10102 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220708/823a2104/attachment.bin>


More information about the libcxx-commits mailing list