[libcxx-commits] [libcxx] [libc++] mark `std::expected` as `nodiscard` (PR #130820)

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 25 01:03:52 PDT 2025


philnik777 wrote:

While I like the idea in general, I really dislike that there is no way for the user to say "it's fine to discard the `expected` from this function", so we force the user to either not use `expected` when it may be OK to discard, or add casts to void on every single call site. Neither option seems great.


https://github.com/llvm/llvm-project/pull/130820


More information about the libcxx-commits mailing list