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

Nikolas Klauser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Mon Jun 20 04:02:21 PDT 2022


philnik updated this revision to Diff 438334.
philnik marked 2 inline comments as done.
philnik added a comment.

- Address comments


Repository:
  rG LLVM Github Monorepo

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

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)
 
 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 removed in C++03. If you are using it, please remove usages
+  or upgrade to C++11 or later. It is possible to re-enable ``std::function`` in C++03 by defining
+  ``_LIBCPP_ENABLE_CXX03_FUNCTION``. This option it will be removed in LLVM 16.
+
 ABI Changes
 -----------
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127908.438334.patch
Type: text/x-patch
Size: 1239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20220620/c78b3e0a/attachment-0001.bin>


More information about the libcxx-commits mailing list