[libcxx-commits] [PATCH] D94452: [libc++] Support immovable return types in std::function.

Logan Smith via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jan 24 09:30:11 PST 2021


logan-5 added a comment.

Thanks @Quuxplusone for working on this. I ran into this issue while trying to write real actual code in a codebase with (for better or worse) lots of noncopyable types, so this will really be a nice-to-have once it's landed.



================
Comment at: libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/noncopyable_return_type.pass.cpp:44
+    std::function<NonCopyable(int)> f3b = LargeLambda();
+    std::function<NonCopyable(int)> f4b = std::ref(f1b);
+
----------------
What about some tests for assigning `NonCopyable X::*` and `NonCopyable (X::*)()` into `std::function<NonCopyable(X)>`? I suppose the pointer to data member should fail at some point or another (can't copy the data member out), but the pointer to member function should work.

The void tests below might benefit from PMF/PMD coverage as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94452



More information about the libcxx-commits mailing list