[libc++] Granularize <functional> includes

Reviewed By: Mordante, #libc

Spies: libcxx-commits, miyuki

Differential Revision: https://reviews.llvm.org/D123912
This commit is contained in:
Nikolas Klauser 2022-04-17 16:01:38 +02:00
parent 02eac667ed
commit faef447e72
27 changed files with 50 additions and 16 deletions

View File

@ -9,8 +9,15 @@
#ifndef _LIBCPP___RANGES_JOIN_VIEW_H
#define _LIBCPP___RANGES_JOIN_VIEW_H
#include <__concepts/constructible.h>
#include <__concepts/convertible_to.h>
#include <__concepts/copyable.h>
#include <__concepts/derived_from.h>
#include <__concepts/equality_comparable.h>
#include <__config>
#include <__iterator/concepts.h>
#include <__iterator/iter_move.h>
#include <__iterator/iter_swap.h>
#include <__iterator/iterator_traits.h>
#include <__ranges/access.h>
#include <__ranges/all.h>

View File

@ -881,7 +881,7 @@ template <class BidirectionalIterator, class Compare>
#include <__debug>
#include <cstddef>
#include <cstring>
#include <functional>
#include <functional> // TODO: Remove this include
#include <initializer_list>
#include <iterator>
#include <memory>

View File

@ -46,9 +46,10 @@ template <class P> struct hash<coroutine_handle<P>>;
*/
#include <__assert> // all public C++ headers provide the assertion handler
#include <__functional/hash.h>
#include <cstddef>
#include <experimental/__config>
#include <functional>
#include <functional> // TODO: Remove this include
#include <memory> // for hash<T*>
#include <new>
#include <type_traits>

View File

@ -108,10 +108,12 @@
*/
#include <__assert> // all public C++ headers provide the assertion handler
#include <__functional/operations.h>
#include <__utility/forward.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <experimental/__config>
#include <functional>
#include <functional> // TODO: Remove this include
#include <type_traits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)

View File

@ -650,10 +650,12 @@ public:
*/
#include <__assert> // all public C++ headers provide the assertion handler
#include <__functional/operations.h>
#include <array>
#include <cstddef>
#include <experimental/__config>
#include <functional>
#include <functional> // TODO: Remove this include
#include <tuple>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header

View File

@ -206,7 +206,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__hash_table>
#include <algorithm>
#include <ext/__hash>
#include <functional>
#include <functional> // TODO: Remove this include
#include <stdexcept>
#include <type_traits>

View File

@ -197,7 +197,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__hash_table>
#include <algorithm>
#include <ext/__hash>
#include <functional>
#include <functional> // TODO: Remove this include
#if defined(__DEPRECATED) && __DEPRECATED
#if defined(_LIBCPP_WARNING)

View File

@ -539,7 +539,7 @@ erase_if(multimap<Key, T, Compare, Allocator>& c, Predicate pred); // C++20
#include <__utility/forward.h>
#include <__utility/swap.h>
#include <compare>
#include <functional>
#include <functional> // TODO: Remove this include
#include <initializer_list>
#include <iterator> // __libcpp_erase_if_container
#include <memory>

View File

@ -192,7 +192,7 @@ template<class Callable, class ...Args>
#include <__threading_support>
#include <__utility/forward.h>
#include <cstdint>
#include <functional>
#include <functional> // TODO: Remove this include
#include <memory>
#ifndef _LIBCPP_CXX03_LANG
# include <tuple>

View File

@ -147,7 +147,7 @@ template<class T>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <cmath> // for isnormal
#include <functional>
#include <functional> // TODO: Remove this include
#include <iterator>
#include <version>

View File

@ -162,10 +162,17 @@ template<class T>
#include <__availability>
#include <__concepts/invocable.h>
#include <__config>
#include <__functional/hash.h>
#include <__functional/invoke.h>
#include <__functional/unary_function.h>
#include <__memory/construct_at.h>
#include <__tuple>
#include <__utility/forward.h>
#include <__utility/in_place.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <compare>
#include <functional>
#include <functional> // TODO: Remove this include
#include <initializer_list>
#include <new>
#include <stdexcept>

View File

@ -227,7 +227,7 @@ template <class T, class Container, class Compare>
#include <__utility/forward.h>
#include <compare>
#include <deque>
#include <functional>
#include <functional> // TODO: Remove this include
#include <type_traits>
#include <vector>
#include <version>

View File

@ -763,6 +763,7 @@ typedef regex_token_iterator<wstring::const_iterator> wsregex_token_iterator;
*/
#include <__algorithm/find.h>
#include <__algorithm/search.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__iterator/wrap_iter.h>

View File

@ -481,7 +481,7 @@ erase_if(multiset<Key, Compare, Allocator>& c, Predicate pred); // C++20
#include <__tree>
#include <__utility/forward.h>
#include <compare>
#include <functional>
#include <functional> // TODO: Remove this include
#include <initializer_list>
#include <iterator> // __libcpp_erase_if_container
#include <version>

View File

@ -90,7 +90,7 @@ void sleep_for(const chrono::duration<Rep, Period>& rel_time);
#include <__threading_support>
#include <__utility/forward.h>
#include <cstddef>
#include <functional>
#include <functional> // TODO: Remove this include
#include <iosfwd>
#include <memory>
#include <system_error>

View File

@ -525,7 +525,7 @@ template <class Key, class T, class Hash, class Pred, class Alloc>
#include <__node_handle>
#include <__utility/forward.h>
#include <compare>
#include <functional>
#include <functional> // TODO: Remove this include
#include <iterator> // __libcpp_erase_if_container
#include <stdexcept>
#include <tuple>

View File

@ -469,7 +469,7 @@ template <class Value, class Hash, class Pred, class Alloc>
#include <__node_handle>
#include <__utility/forward.h>
#include <compare>
#include <functional>
#include <functional> // TODO: Remove this include
#include <iterator> // __libcpp_erase_if_container
#include <version>

View File

@ -350,9 +350,14 @@ template <class T> unspecified2 end(const valarray<T>& v);
#include <__algorithm/unwrap_iter.h>
#include <__assert> // all public C++ headers provide the assertion handler
#include <__config>
#include <__functional/operations.h>
#include <__memory/allocator.h>
#include <__memory/uninitialized_algorithms.h>
#include <__utility/move.h>
#include <__utility/swap.h>
#include <cmath>
#include <cstddef>
#include <functional>
#include <functional> // TODO: Remove this include
#include <initializer_list>
#include <new>
#include <version>

View File

@ -40,6 +40,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "test_iterators.h"

View File

@ -24,6 +24,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "test_iterators.h"

View File

@ -28,6 +28,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "almost_satisfies_types.h"

View File

@ -22,6 +22,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <random>
#include <ranges>

View File

@ -26,6 +26,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "almost_satisfies_types.h"

View File

@ -22,6 +22,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <random>
#include <ranges>

View File

@ -28,6 +28,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "test_iterators.h"

View File

@ -23,6 +23,7 @@
#include <algorithm>
#include <array>
#include <cassert>
#include <functional>
#include <ranges>
#include "almost_satisfies_types.h"

View File

@ -15,6 +15,7 @@
// (forward_range<V> || tiny-range<Pattern>)
// class lazy_split_view;
#include <functional>
#include <ranges>
#include "test_iterators.h"