[libcxx-commits] [PATCH] D110738: [libc++] [P1614] Implement the first half of [cmp.alg]: strong_order, weak_order, partial_order.

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 29 10:36:40 PDT 2021


Quuxplusone created this revision.
Quuxplusone added reviewers: libc++, ldionne, Mordante, rarutyun.
Quuxplusone added a project: libc++.
Herald added a subscriber: mgorny.
Quuxplusone requested review of this revision.
Herald added a subscriber: libcxx-commits.
Herald added 1 blocking reviewer(s): libc++.

Re the behavior of `std::strong_order` for floating-point types, see
https://stackoverflow.com/questions/59348310/how-to-implement-the-totalorder-predicate-for-floating-point-values
https://stackoverflow.com/questions/69068075/what-is-the-purpose-of-if-x-and-y-represent-the-same-floating-point-datum-i
https://quuxplusone.github.io/blog/2021/09/05/float-format/

There's still an open question of what it should do for `long double`.

This PR does //not// implement `std::strong_order_fallback` et al. That will be a second PR. I haven't actually done that work yet.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D110738

Files:
  libcxx/include/CMakeLists.txt
  libcxx/include/__compare/partial_order.h
  libcxx/include/__compare/strong_order.h
  libcxx/include/__compare/weak_order.h
  libcxx/include/__utility/priority_tag.h
  libcxx/include/compare
  libcxx/include/module.modulemap
  libcxx/include/utility
  libcxx/test/libcxx/diagnostics/detail.headers/compare/partial_order.module.verify.cpp
  libcxx/test/libcxx/diagnostics/detail.headers/compare/strong_order.module.verify.cpp
  libcxx/test/libcxx/diagnostics/detail.headers/compare/weak_order.module.verify.cpp
  libcxx/test/libcxx/diagnostics/detail.headers/utility/priority_tag.module.verify.cpp
  libcxx/test/std/language.support/cmp/cmp.alg/partial_order.pass.cpp
  libcxx/test/std/language.support/cmp/cmp.alg/strong_order.pass.cpp
  libcxx/test/std/language.support/cmp/cmp.alg/weak_order.pass.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110738.375953.patch
Type: text/x-patch
Size: 84032 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20210929/f0cce4f0/attachment-0001.bin>


More information about the libcxx-commits mailing list