[libcxx-commits] [PATCH] D131395: [libc++] Implement `lexicographical_compare_three_way`

Adrian Vogelsgesang via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Aug 8 06:17:30 PDT 2022


avogelsgesang created this revision.
avogelsgesang added reviewers: ldionne, Mordante, philnik, mumbleskates.
Herald added a subscriber: mgorny.
Herald added a project: All.
avogelsgesang requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

The implementation is rather straightforward and unoptimized. A more
performant implementation is possible for most cases, but I think we
should rather fix clang to optimize the code correctly (see
https://godbolt.org/z/7xbMEen5e). This commit makes sure to not call
`operator==` unnecessarily on the iterators, though, as was noted in
LWG 3410.

Implements part of P1614R2 "The Mothership has Landed"

Fixes LWG 3410


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D131395

Files:
  libcxx/docs/Status/Cxx2bIssues.csv
  libcxx/docs/Status/SpaceshipProjects.csv
  libcxx/include/CMakeLists.txt
  libcxx/include/__algorithm/lexicographical_compare_three_way.h
  libcxx/include/algorithm
  libcxx/include/module.modulemap.in
  libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way.pass.cpp
  libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.pass.cpp
  libcxx/test/std/algorithms/alg.sorting/alg.three.way/lexicographical_compare_three_way_comp.verify.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D131395.450781.patch
Type: text/x-patch
Size: 15650 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220808/77276583/attachment.bin>


More information about the libcxx-commits mailing list