[libcxx-commits] [PATCH] D110852: [libc++] Use addressof in assignment operator.

Mark de Wever via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Oct 5 10:17:35 PDT 2021


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


================
Comment at: libcxx/test/std/containers/associative/map/map.cons/copy_assign.compile.pass.cpp:26-28
+    std::map<int, deleted_operator_ampersand> mo;
+    std::map<int, deleted_operator_ampersand> m;
+    m = mo;
----------------
Quuxplusone wrote:
> All of these tests can be one line shorter.
> ```
> std::map<int, deleted_operator_ampersand> x;
> x = x;
> ```
Actually they can't this triggers a self-assignment warning. So I prefer to keep it as is.


================
Comment at: libcxx/test/std/containers/container.adaptors/priority.queue/priqueue.cons/assign_copy.compile.pass.cpp:23
+void test() {
+  std::priority_queue<deleted_operator_ampersand, std::vector<deleted_operator_ampersand> > pqo;
+  std::priority_queue<deleted_operator_ampersand, std::vector<deleted_operator_ampersand> > pq;
----------------
jloser wrote:
> Should we explicitly `#include <vector>`? Do we even need to provide our own container template (I think using the default of `std::deque` is fine, right?)?
`std::vector` is the default and yes we should include `<vector>`, instead I use `std::queue` which can be used without an additional include.


================
Comment at: libcxx/test/std/containers/container.adaptors/queue/queue.defn/assign_copy.compile.pass.cpp:9
+
+// UNSUPPORTED: c++03
+
----------------
Quuxplusone wrote:
> Throughout: Why is this unsupported in '03?
> ...oh, because of the `=delete`? Clang supports `=delete` in '03, so we can go ahead and test it. This will shorten most of these test files by another 2 lines each.
Indeed because of C++03, thanks for reminding that we can use `=delete` in Clang in C++03.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110852



More information about the libcxx-commits mailing list