[libc-commits] [PATCH] D139576: [libc] move errno out of file internals

Michael Jones via Phabricator via libc-commits libc-commits at lists.llvm.org
Mon Dec 12 10:27:35 PST 2022


michaelrj added inline comments.


================
Comment at: libc/src/__support/CPP/expected.h:32
+  constexpr expected(unexpected<E> unexp)
+      : unexp(unexp.value), is_expected(false) {}
+
----------------
sivachandra wrote:
> michaelrj wrote:
> > sivachandra wrote:
> > > Does `std::expected` have constructors of this kind? If no, then we should not add incompatible constructors.
> > Yes, this is how the `std::expected` constructors are defined.
> Can you point me to a link or section in the standard where its listed? I am looking at cppreference.com and I don't see an `unexpected` type. I see one which takes `std::unexpect_t` followed by args for in-place construction of the error value.
here is std::unexpected: https://en.cppreference.com/w/cpp/error/unexpected
It's used in constructors 7 and 8 in the list on this page: https://en.cppreference.com/w/cpp/utility/expected/expected


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D139576



More information about the libc-commits mailing list