cpplearner created this revision.
cpplearner added reviewers: mclow.lists, EricWF, howard.hinnant.
cpplearner added a subscriber: cfe-commits.

See https://github.com/cplusplus/draft/pull/839 and 
https://github.com/cplusplus/fundamentals-ts/pull/73.


https://reviews.llvm.org/D27850

Files:
  include/experimental/optional
  include/optional


Index: include/optional
===================================================================
--- include/optional
+++ include/optional
@@ -893,7 +893,7 @@
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    value_type value_or(_Up&& __v) &&
+    constexpr value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible_v<value_type>,
                       "optional<T>::value_or: T must be move constructible");
Index: include/experimental/optional
===================================================================
--- include/experimental/optional
+++ include/experimental/optional
@@ -562,7 +562,7 @@
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    value_type value_or(_Up&& __v) &&
+    constexpr value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible<value_type>::value,
                       "optional<T>::value_or: T must be move constructible");


Index: include/optional
===================================================================
--- include/optional
+++ include/optional
@@ -893,7 +893,7 @@
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    value_type value_or(_Up&& __v) &&
+    constexpr value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible_v<value_type>,
                       "optional<T>::value_or: T must be move constructible");
Index: include/experimental/optional
===================================================================
--- include/experimental/optional
+++ include/experimental/optional
@@ -562,7 +562,7 @@
 
     template <class _Up>
     _LIBCPP_INLINE_VISIBILITY
-    value_type value_or(_Up&& __v) &&
+    constexpr value_type value_or(_Up&& __v) &&
     {
         static_assert(is_move_constructible<value_type>::value,
                       "optional<T>::value_or: T must be move constructible");
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to