[libcxx-commits] [PATCH] D140911: [libc++] Implement P2505R5(Monadic operations for std::expected).

Yurong via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed May 10 09:20:41 PDT 2023


yronglin marked an inline comment as done.
yronglin added inline comments.


================
Comment at: libcxx/include/__expected/expected.h:850
+      }
+      return expected<_Tp, _Gp>(
+          __expected_construct_unexpected_from_invoke_tag{}, std::forward<_Func>(__f), std::move(error()));
----------------
Redundant error diagnostic messages was generated by `static_assert` at the front of `expected`
```
static_assert(
      !is_reference_v<_Tp> &&
          !is_function_v<_Tp> &&
          !is_same_v<remove_cv_t<_Tp>, in_place_t> &&
          !is_same_v<remove_cv_t<_Tp>, unexpect_t> &&
          !__is_std_unexpected<remove_cv_t<_Tp>>::value &&
          __valid_std_unexpected<_Err>::value
      ,
      "[expected.object.general] A program that instantiates the definition of template expected<T, E> for a "
      "reference type, a function type, or for possibly cv-qualified types in_place_t, unexpect_t, or a "
      "specialization of unexpected for the T parameter is ill-formed. A program that instantiates the "
      "definition of the template expected<T, E> with a type for the E parameter that is not a valid "
      "template argument for unexpected is ill-formed.");
```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D140911



More information about the libcxx-commits mailing list