[PATCH] D22584: constexpr array support C++1z (P0031)

Marshall Clow via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 08:56:02 PDT 2016


mclow.lists added a comment.

This diff no longer applies cleanly, and I've added some formatting concerns.  However, the //content// looks fine to me.


================
Comment at: include/array:176
@@ -175,3 +175,3 @@
     _LIBCPP_INLINE_VISIBILITY
-    const_iterator cend() const _NOEXCEPT {return end();}
+    _LIBCPP_CONSTEXPR_AFTER_CXX14 const_iterator cend() const _NOEXCEPT {return end();}
     _LIBCPP_INLINE_VISIBILITY
----------------
Nit: I would put the `_LIBCPP_CONSTEXPR_AFTER_CXX14` on the same line as `_LIBCPP_INLINE_VISIBILITY` to keep the lines from getting too long.

================
Comment at: include/array:191
@@ -190,3 +190,3 @@
     // element access:
-    _LIBCPP_INLINE_VISIBILITY reference operator[](size_type __n)             {return __elems_[__n];}
+    _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14 reference operator[](size_type __n)             {return __elems_[__n];}
     _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 const_reference operator[](size_type __n) const {return __elems_[__n];}
----------------
And break this line after the macros for the same reason as L#176


================
Comment at: include/iterator:526
@@ -525,2 +525,3 @@
 template <class _InputIter>
 inline _LIBCPP_INLINE_VISIBILITY
+_LIBCPP_CONSTEXPR_AFTER_CXX14
----------------
Here, I would smoosh them all together on the same line: `inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX14`


https://reviews.llvm.org/D22584





More information about the cfe-commits mailing list