[libcxx-commits] [PATCH] D97176: [libcxx] adds concepts std::equality_comparable[_with]

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 4 19:15:24 PST 2021


Quuxplusone added inline comments.


================
Comment at: libcxx/test/std/concepts/comparison/types.h:129
+  auto
+  operator==(member_three_way_comparable_with_deleted_eq const&) const = delete;
+};
----------------
@cjdb: Here's a remaining `auto operator==`. You said a //defaulted// `operator==` should always be `bool` — yep, paper standard says https://eel.is/c++draft/class.eq#1 — but I was originally asking about //all// instances of `operator==`/`operator!=` in this file, including non-defaulted and deleted ones.

Looks like all vendors currently accept `=delete`'d functions with `auto` return types, and they're probably correct to do so. But I still think stylistically it would be preferable to say `bool` here.

(An interesting question, whose answer I don't currently know, is whether the difference between putting `auto` and `bool` here is detectable by a well-formed program.)


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97176/new/

https://reviews.llvm.org/D97176



More information about the libcxx-commits mailing list