Skip to content

Commit a83f4b9

Browse files
committed
[libc++] Remove <functional> includes
Reviewed By: var-const, #libc, ldionne Spies: #libc_vendors, ldionne, libcxx-commits, miyuki Differential Revision: https://reviews.llvm.org/D124123
1 parent be744da commit a83f4b9

File tree

17 files changed

+9
-20
lines changed

17 files changed

+9
-20
lines changed

libcxx/docs/ReleaseNotes.rst

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,15 @@ API Changes
6767
``<filesystem>`` header. The associated macro
6868
``_LIBCPP_DEPRECATED_EXPERIMENTAL_FILESYSTEM`` has also been removed.
6969

70-
- Some libc++ headers no longer transitively include all of ``<algorithm>``, ``<chrono>`` and ``<utility>``.
71-
If, after updating libc++, you see compiler errors related to missing declarations in
72-
namespace ``std``, it might be because one of your source files now needs to
73-
``#include <algorithm>``, ``#include <chrono>`` and/or ``#include <utility>``.
70+
- Some libc++ headers no longer transitively include all of:
71+
- ``<algorithm>``
72+
- ``<chrono>``
73+
- ``<functional>``
74+
- ``<utility>``
75+
76+
If, after updating libc++, you see compiler errors related to missing declarations
77+
in namespace ``std``, it might be because one of your source files now needs to
78+
include one or more of the headers listed above.
7479

7580
- The integer distributions ``binomial_distribution``, ``discrete_distribution``,
7681
``geometric_distribution``, ``negative_binomial_distribution``, ``poisson_distribution``,

libcxx/include/algorithm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,6 @@ template <class BidirectionalIterator, class Compare>
881881
#include <__debug>
882882
#include <cstddef>
883883
#include <cstring>
884-
#include <functional> // TODO: Remove this include
885884
#include <initializer_list>
886885
#include <iterator>
887886
#include <memory>

libcxx/include/experimental/coroutine

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ template <class P> struct hash<coroutine_handle<P>>;
4949
#include <__functional/hash.h>
5050
#include <cstddef>
5151
#include <experimental/__config>
52-
#include <functional> // TODO: Remove this include
5352
#include <memory> // for hash<T*>
5453
#include <new>
5554
#include <type_traits>

libcxx/include/experimental/propagate_const

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@
113113
#include <__utility/move.h>
114114
#include <__utility/swap.h>
115115
#include <experimental/__config>
116-
#include <functional> // TODO: Remove this include
117116
#include <type_traits>
118117

119118
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/experimental/simd

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,7 +654,6 @@ public:
654654
#include <array>
655655
#include <cstddef>
656656
#include <experimental/__config>
657-
#include <functional> // TODO: Remove this include
658657
#include <tuple>
659658

660659
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

libcxx/include/ext/hash_map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
206206
#include <__hash_table>
207207
#include <algorithm>
208208
#include <ext/__hash>
209-
#include <functional> // TODO: Remove this include
210209
#include <stdexcept>
211210
#include <type_traits>
212211

libcxx/include/ext/hash_set

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,6 @@ template <class Value, class Hash, class Pred, class Alloc>
197197
#include <__hash_table>
198198
#include <algorithm>
199199
#include <ext/__hash>
200-
#include <functional> // TODO: Remove this include
201200

202201
#if defined(__DEPRECATED) && __DEPRECATED
203202
#if defined(_LIBCPP_WARNING)

libcxx/include/map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,6 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
539539
#include <__utility/forward.h>
540540
#include <__utility/swap.h>
541541
#include <compare>
542-
#include <functional> // TODO: Remove this include
543542
#include <initializer_list>
544543
#include <iterator> // __libcpp_erase_if_container
545544
#include <memory>

libcxx/include/mutex

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ template<class Callable, class ...Args>
192192
#include <__threading_support>
193193
#include <__utility/forward.h>
194194
#include <cstdint>
195-
#include <functional> // TODO: Remove this include
196195
#include <memory>
197196
#ifndef _LIBCPP_CXX03_LANG
198197
# include <tuple>

libcxx/include/numeric

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,6 @@ template<class T>
147147
#include <__assert> // all public C++ headers provide the assertion handler
148148
#include <__config>
149149
#include <cmath> // for isnormal
150-
#include <functional> // TODO: Remove this include
151150
#include <iterator>
152151
#include <version>
153152

libcxx/include/optional

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ template<class T>
172172
#include <__utility/move.h>
173173
#include <__utility/swap.h>
174174
#include <compare>
175-
#include <functional> // TODO: Remove this include
176175
#include <initializer_list>
177176
#include <new>
178177
#include <stdexcept>

libcxx/include/queue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ template <class T, class Container, class Compare>
227227
#include <__utility/forward.h>
228228
#include <compare>
229229
#include <deque>
230-
#include <functional> // TODO: Remove this include
231230
#include <type_traits>
232231
#include <vector>
233232
#include <version>

libcxx/include/set

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,6 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
481481
#include <__tree>
482482
#include <__utility/forward.h>
483483
#include <compare>
484-
#include <functional> // TODO: Remove this include
485484
#include <initializer_list>
486485
#include <iterator> // __libcpp_erase_if_container
487486
#include <version>

libcxx/include/thread

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,6 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
9090
#include <__threading_support>
9191
#include <__utility/forward.h>
9292
#include <cstddef>
93-
#include <functional> // TODO: Remove this include
9493
#include <iosfwd>
9594
#include <memory>
9695
#include <system_error>

libcxx/include/unordered_map

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,6 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
525525
#include <__node_handle>
526526
#include <__utility/forward.h>
527527
#include <compare>
528-
#include <functional> // TODO: Remove this include
529528
#include <iterator> // __libcpp_erase_if_container
530529
#include <stdexcept>
531530
#include <tuple>

libcxx/include/unordered_set

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -469,7 +469,6 @@ template <class Value, class Hash, class Pred, class Alloc>
469469
#include <__node_handle>
470470
#include <__utility/forward.h>
471471
#include <compare>
472-
#include <functional> // TODO: Remove this include
473472
#include <iterator> // __libcpp_erase_if_container
474473
#include <version>
475474

libcxx/include/valarray

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,6 @@ template <class T> unspecified2 end(const valarray<T>& v);
357357
#include <__utility/swap.h>
358358
#include <cmath>
359359
#include <cstddef>
360-
#include <functional> // TODO: Remove this include
361360
#include <initializer_list>
362361
#include <new>
363362
#include <version>

0 commit comments

Comments
 (0)