[PATCH] D27850: [libcxx] add missing constexpr to optional::value_or

S. B. Tam via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Dec 16 07:30:48 PST 2016


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");


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D27850.81754.patch
Type: text/x-patch
Size: 938 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20161216/437dc76e/attachment.bin>


More information about the cfe-commits mailing list