[libcxx-commits] [PATCH] D106824: [libc++] Implement the resolution of LWG3506 in all language modes.
Arthur O'Dwyer via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Jul 28 11:14:42 PDT 2021
Quuxplusone marked 2 inline comments as done.
Quuxplusone added inline comments.
================
Comment at: libcxx/include/queue:554
+
+#ifndef _LIBCPP_CXX03_LANG
+ template <class _InputIter, class _Alloc, class = _EnableIf<__is_cpp17_input_iterator<_InputIter>::value> >
----------------
ldionne wrote:
> Doesn't this work even in C++03 mode with the rvalue references extension?
Yes, but I haven't been reckless enough yet to break our historical tradition that guards all actual container move-constructors and move-assignments under `_LIBCPP_CXX03_LANG`. I think we should break those all at once.
Note particularly the `priority_queue(const Comp&, Container&&, const Alloc&)` on line 528, which is already guarded like this.
================
Comment at: libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_iter_iter_comp_cont_alloc.pass.cpp:21
+
+template<class T, class Cont, class Comp = std::less<T> >
+struct PQ : std::priority_queue<T, Cont, Comp> {
----------------
ldionne wrote:
> Why are you creating this derived type?
I'd been doing it in order to get at `q.c.get_allocator()` on line 35.
However, it turns out that `using priority_queue::priority_queue;` is a C++11ism, unsupported in C++03 mode, so I'll either have to do the more verbose inheritance from e.g. `libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons.alloc/ctor_alloc.pass.cpp` or else think of a different way to get at the allocator.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106824/new/
https://reviews.llvm.org/D106824
More information about the libcxx-commits
mailing list