[libcxx-commits] [PATCH] D127908: [libc++] Remvoe std::function in C++03

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 15 15:21:02 PDT 2022


philnik created this revision.
philnik added a reviewer: ldionne.
Herald added a project: All.
philnik requested review of this revision.
Herald added a project: libc++.
Herald added a subscriber: libcxx-commits.
Herald added a reviewer: libc++.

`std::function` has been deprecated for a few releases now. Remove it with and option to opt-back-in with a note that this option will be removed in libc++16.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D127908

Files:
  libcxx/docs/ReleaseNotes.rst
  libcxx/include/__functional/function.h


Index: libcxx/include/__functional/function.h
===================================================================
--- libcxx/include/__functional/function.h
+++ libcxx/include/__functional/function.h
@@ -1239,7 +1239,7 @@
 swap(function<_Rp(_ArgTypes...)>& __x, function<_Rp(_ArgTypes...)>& __y) _NOEXCEPT
 {return __x.swap(__y);}
 
-#else // _LIBCPP_CXX03_LANG
+#elif defined(_LIBCPP_ENABLE_CXX03_FUNCTION) // _LIBCPP_CXX03_LANG
 
 namespace __function {
 
@@ -2805,7 +2805,7 @@
 swap(function<_Fp>& __x, function<_Fp>& __y)
 {return __x.swap(__y);}
 
-#endif
+#endif // _LIBCPP_CXX03_LANG
 
 _LIBCPP_END_NAMESPACE_STD
 
Index: libcxx/docs/ReleaseNotes.rst
===================================================================
--- libcxx/docs/ReleaseNotes.rst
+++ libcxx/docs/ReleaseNotes.rst
@@ -142,6 +142,10 @@
   ``_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS``, this ensures that the members of
   ``allocator<void>`` removed in C++20 can be accessed.
 
+- ``std::function`` has been remove from C++03. If you are using it please remove the uses
+  or upgrade to C++11. It is possible to re-enable ``std::function`` by defining
+  ``_LIBCPP_ENABLE_CXX03_FUNCTION``. This option it will be removed in libc++16.
+
 ABI Changes
 -----------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127908.437368.patch
Type: text/x-patch
Size: 1246 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220615/7502769b/attachment.bin>


More information about the libcxx-commits mailing list