[libcxx-commits] [PATCH] D96477: [libcxx] adds remaining callable concepts

Zoe Carver via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Mar 21 15:17:58 PDT 2021


zoecarver added inline comments.


================
Comment at: libcxx/test/std/concepts/callable/functions.h:27-28
+struct Bool {
+  int Value = false;
+  constexpr operator bool() const noexcept { return Value; }
+};
----------------
Quuxplusone wrote:
> cjdb wrote:
> > Quuxplusone wrote:
> > > 
> > No, this is definitely correct as-is.
> There is no //conceivable// library bug that could cause us to treat `int Value = false;` and `int Value = 0;` any differently.
> Also, you don't want to return `int Value` from `operator bool`; you want to return a `bool`.
> 
> Maybe you meant to write `bool Value = false;` instead of `int Value = false;`, is that the issue?
@Quuxplusone why do you want to remove noexcept? 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96477



More information about the libcxx-commits mailing list