[libcxx-commits] [PATCH] D117917: [libc++] Use addressof in unordered_set.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sat Jan 22 02:40:55 PST 2022


Mordante marked 2 inline comments as done.
Mordante added inline comments.


================
Comment at: libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move.addressof.compile.pass.cpp:9
+
+// UNSUPPORTED: c++03
+
----------------
Quuxplusone wrote:
> This line can be removed, can't it?
> (Ditto throughout, probably. Please investigate each UNSUPPORTED and remove the ones that can be removed.)
No this constructor is only available in C++11 in our implementation.


================
Comment at: libcxx/test/std/containers/unord/unord.multiset/unord.multiset.cnstr/move_alloc.addressof.compile.pass.cpp:26-32
+  using A = test_allocator<operator_hijacker>;
+  using H = std::hash<operator_hijacker>;
+  using P = std::equal_to<operator_hijacker>;
+
+  const A a;
+  std::unordered_multiset<operator_hijacker, H, P, A> so;
+  std::unordered_multiset<operator_hijacker, H, P, A> s(std::move(so), a);
----------------
Quuxplusone wrote:
> This is good just for extra test coverage, but FWIW/FYI, I'm pretty sure you could have just done something like
> ```
> std::unordered_multiset<operator_hijacker> so;
> std::unordered_multiset<operator_hijacker> s(std::move(so), so.get_allocator());
> ```
> without all the extra params.
Yes that would have been possible.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D117917



More information about the libcxx-commits mailing list