[libcxx-commits] [libcxx] [libc++] Remove a few includes from <__functional/hash.h> (PR #83254)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Feb 28 03:56:43 PST 2024
https://github.com/philnik777 created https://github.com/llvm/llvm-project/pull/83254
None
>From c97f431cbb28a14fd3a080b3fb228fe5c00a87c3 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Wed, 28 Feb 2024 12:53:12 +0100
Subject: [PATCH] [libc++] Remove a few includes from <__functional/hash.h>
---
libcxx/include/__functional/hash.h | 7 ++-----
libcxx/include/__tuple/sfinae_helpers.h | 7 +------
libcxx/include/__type_traits/conjunction.h | 7 +++++++
libcxx/include/array | 1 +
4 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/libcxx/include/__functional/hash.h b/libcxx/include/__functional/hash.h
index ff22055d6915e4..b8e4c0745090e4 100644
--- a/libcxx/include/__functional/hash.h
+++ b/libcxx/include/__functional/hash.h
@@ -10,23 +10,20 @@
#define _LIBCPP___FUNCTIONAL_HASH_H
#include <__config>
-#include <__functional/invoke.h>
#include <__functional/unary_function.h>
#include <__fwd/hash.h>
-#include <__tuple/sfinae_helpers.h>
+#include <__type_traits/conjunction.h>
+#include <__type_traits/invoke.h>
#include <__type_traits/is_copy_constructible.h>
#include <__type_traits/is_default_constructible.h>
#include <__type_traits/is_enum.h>
#include <__type_traits/is_move_constructible.h>
#include <__type_traits/underlying_type.h>
-#include <__utility/forward.h>
-#include <__utility/move.h>
#include <__utility/pair.h>
#include <__utility/swap.h>
#include <cstddef>
#include <cstdint>
#include <cstring>
-#include <limits>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
diff --git a/libcxx/include/__tuple/sfinae_helpers.h b/libcxx/include/__tuple/sfinae_helpers.h
index 90e9b1e5800478..35a57ff7765923 100644
--- a/libcxx/include/__tuple/sfinae_helpers.h
+++ b/libcxx/include/__tuple/sfinae_helpers.h
@@ -16,6 +16,7 @@
#include <__tuple/tuple_like_ext.h>
#include <__tuple/tuple_size.h>
#include <__tuple/tuple_types.h>
+#include <__type_traits/conjunction.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_constructible.h>
@@ -32,12 +33,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
#ifndef _LIBCPP_CXX03_LANG
-template <bool... _Preds>
-struct __all_dummy;
-
-template <bool... _Pred>
-struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>> {};
-
struct __tuple_sfinae_base {
template <template <class, class...> class _Trait, class... _LArgs, class... _RArgs>
static auto __do_test(__tuple_types<_LArgs...>, __tuple_types<_RArgs...>)
diff --git a/libcxx/include/__type_traits/conjunction.h b/libcxx/include/__type_traits/conjunction.h
index 4bfa5a27300d1e..38bffa7ea06f9a 100644
--- a/libcxx/include/__type_traits/conjunction.h
+++ b/libcxx/include/__type_traits/conjunction.h
@@ -13,6 +13,7 @@
#include <__type_traits/conditional.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
+#include <__type_traits/is_same.h>
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
# pragma GCC system_header
@@ -37,6 +38,12 @@ false_type __and_helper(...);
template <class... _Pred>
using _And _LIBCPP_NODEBUG = decltype(std::__and_helper<_Pred...>(0));
+template <bool... _Preds>
+struct __all_dummy;
+
+template <bool... _Pred>
+struct __all : _IsSame<__all_dummy<_Pred...>, __all_dummy<((void)_Pred, true)...>> {};
+
#if _LIBCPP_STD_VER >= 17
template <class...>
diff --git a/libcxx/include/array b/libcxx/include/array
index 41f016a4859a32..dd088f4d0c0117 100644
--- a/libcxx/include/array
+++ b/libcxx/include/array
@@ -122,6 +122,7 @@ template <size_t I, class T, size_t N> const T&& get(const array<T, N>&&) noexce
#include <__iterator/reverse_iterator.h>
#include <__tuple/sfinae_helpers.h>
#include <__type_traits/conditional.h>
+#include <__type_traits/conjunction.h>
#include <__type_traits/is_array.h>
#include <__type_traits/is_const.h>
#include <__type_traits/is_constructible.h>
More information about the libcxx-commits
mailing list