[PATCH] D55045: Add a version of std::function that includes a few optimizations.

Eric Fiselier via Phabricator reviews at reviews.llvm.org
Fri Nov 30 17:48:58 PST 2018


EricWF added inline comments.


================
Comment at: include/functional:1610
+// DO NOT SUBMIT: The optimized function doesn't work with allocators. It should
+// probably just require C++ > 14 before sending out a patch.
+#define _LIBCPP_FUNCTION_ALLOC 0
----------------
This implementation must work in all dialects (likely including C++03 w/ Clang extensions :-S ). So it has to support allocators.

At minimum it needs to support calling the allocator constructors. We may be able to get away with ignoring the allocator though. I'll have to ask my other maintainers.

Let me know if you want some help adding allocator support.


================
Comment at: include/functional:1731
+    {
+      static const __policy __policy_ =
+          {&__large_clone<_Fp>, &__large_destroy<_Fp>, false,
----------------
`_LIBCPP_CONSTEXPR`


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D55045





More information about the libcxx-commits mailing list