[libcxx-commits] [PATCH] D119159: [libc++] Make shared_ptr move unique_ptr's deleter

Asher Mancinelli via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Feb 7 11:27:52 PST 2022


ashermancinelli marked an inline comment as done.
ashermancinelli added inline comments.


================
Comment at: libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.const/unique_ptr.pass.cpp:87
+struct MoveOnlyDeleter {
+  MoveOnlyDeleter() {}
+  MoveOnlyDeleter(MoveOnlyDeleter&&) {}
----------------
philnik wrote:
> Could you `= delete` the default constructor? That ensures the deleter is actually moved properly. Also count how many moves have been made and ensure it's exactly one.
unique_ptr's deleter is constrained by `_EnableIfDeleterDefaultConstructible` so I can't do that iiuc. Would it suffice to have counts for move and default constructors, and assert that each constructor was called the expected number of times?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D119159



More information about the libcxx-commits mailing list