[libcxx-commits] [PATCH] D115977: [libc++] Implement P1425R4 (Iterator pair constructors for std::stack and std::queue)

Arthur O'Dwyer via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Dec 30 11:48:24 PST 2021


Quuxplusone added a comment.

Getting there! Definitely wait for buildkite to be back online and green before landing this, though, because I can totally imagine buildkite not liking it.



================
Comment at: libcxx/include/queue:228
 #include <functional>
+#include <memory>
+#include <type_traits>
----------------
Why all of `<memory>`? (Same question below in `stack`.)


================
Comment at: libcxx/include/queue:230
+#include <type_traits>
 #include <vector>
 
----------------
Here and `<stack>`, `<version>` should be included now.
(That is, please just make sure the merge-conflict with D116172 doesn't somehow get lost in the shuffle.)


================
Comment at: libcxx/include/queue:276
+              class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+    _LIBCPP_HIDE_FROM_ABI queue(_InputIterator __first, _InputIterator __last) : c(__first, __last) {}
+
----------------
Please linebreak before `queue`, for consistency. (Here and line 283, and presumably also in `stack`)


================
Comment at: libcxx/include/queue:409
+          class = __enable_if_t<__is_cpp17_input_iterator<_InputIterator>::value>>
+    queue(_InputIterator, _InputIterator) -> queue<__iter_value_type<_InputIterator>>;
+
----------------



================
Comment at: libcxx/include/queue:415-416
+          class = __enable_if_t<__is_allocator<_Alloc>::value>>
+    queue(_InputIterator, _InputIterator, _Alloc)
+        -> queue<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
+#endif
----------------



================
Comment at: libcxx/include/stack:277-286
+#if _LIBCPP_STD_VER > 20
+template<class _InputIterator> requires __is_cpp17_input_iterator<_InputIterator>::value
+stack(_InputIterator, _InputIterator) -> stack<__iter_value_type<_InputIterator>>;
+
+template<class _InputIterator, class _Alloc>
+        requires (__is_cpp17_input_iterator<_InputIterator>::value && __is_allocator<_Alloc>::value)
+stack(_InputIterator, _InputIterator, _Alloc)
----------------
Please follow the `enable_if_t` pattern here as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D115977



More information about the libcxx-commits mailing list