Skip to content

Commit e9275b2

Browse files
committed
[libc++] Rename __fwd/hash.h to __fwd/functional.h and add reference_wrapper
1 parent aaf9164 commit e9275b2

File tree

18 files changed

+20
-26
lines changed

18 files changed

+20
-26
lines changed

libcxx/include/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ set(files
428428
__fwd/array.h
429429
__fwd/bit_reference.h
430430
__fwd/fstream.h
431-
__fwd/hash.h
431+
__fwd/functional.h
432432
__fwd/ios.h
433433
__fwd/istream.h
434434
__fwd/mdspan.h

libcxx/include/__filesystem/path.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,8 @@
1414
#include <__algorithm/replace_copy.h>
1515
#include <__availability>
1616
#include <__config>
17-
#include <__functional/hash.h>
1817
#include <__functional/unary_function.h>
19-
#include <__fwd/hash.h>
18+
#include <__fwd/functional.h>
2019
#include <__iterator/back_insert_iterator.h>
2120
#include <__iterator/iterator_traits.h>
2221
#include <__type_traits/decay.h>

libcxx/include/__functional/bind.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#include <__config>
1414
#include <__functional/invoke.h>
1515
#include <__functional/weak_result_type.h>
16+
#include <__fwd/functional.h>
1617
#include <__type_traits/decay.h>
1718
#include <__type_traits/is_reference_wrapper.h>
1819
#include <__type_traits/is_void.h>

libcxx/include/__functional/hash.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
#include <__config>
1313
#include <__functional/invoke.h>
1414
#include <__functional/unary_function.h>
15-
#include <__fwd/hash.h>
15+
#include <__fwd/functional.h>
1616
#include <__tuple/sfinae_helpers.h>
1717
#include <__type_traits/is_copy_constructible.h>
1818
#include <__type_traits/is_default_constructible.h>

libcxx/include/__functional/identity.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
#define _LIBCPP___FUNCTIONAL_IDENTITY_H
1212

1313
#include <__config>
14-
#include <__functional/reference_wrapper.h>
14+
#include <__fwd/functional.h>
1515
#include <__type_traits/integral_constant.h>
1616
#include <__utility/forward.h>
1717

libcxx/include/__fwd/hash.h renamed to libcxx/include/__fwd/functional.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
//
77
//===---------------------------------------------------------------------===//
88

9-
#ifndef _LIBCPP___FWD_HASH_H
10-
#define _LIBCPP___FWD_HASH_H
9+
#ifndef _LIBCPP___FWD_FUNCTIONAL_H
10+
#define _LIBCPP___FWD_FUNCTIONAL_H
1111

1212
#include <__config>
1313

@@ -20,6 +20,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2020
template <class>
2121
struct _LIBCPP_TEMPLATE_VIS hash;
2222

23+
template <class>
24+
class _LIBCPP_TEMPLATE_VIS reference_wrapper;
25+
2326
_LIBCPP_END_NAMESPACE_STD
2427

25-
#endif // _LIBCPP___FWD_HASH_H
28+
#endif // _LIBCPP___FWD_FUNCTIONAL_H

libcxx/include/__thread/id.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#include <__compare/ordering.h>
1414
#include <__config>
15-
#include <__fwd/hash.h>
15+
#include <__fwd/functional.h>
1616
#include <__fwd/ostream.h>
1717
#include <__thread/support.h>
1818

libcxx/include/__thread/support/pthread.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
#include <__chrono/convert_to_timespec.h>
1515
#include <__chrono/duration.h>
1616
#include <__config>
17-
#include <__fwd/hash.h>
1817
#include <ctime>
1918
#include <errno.h>
2019
#include <pthread.h>

libcxx/include/__type_traits/is_reference_wrapper.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define _LIBCPP___TYPE_TRAITS_IS_REFERENCE_WRAPPER_H
1111

1212
#include <__config>
13+
#include <__fwd/functional.h>
1314
#include <__type_traits/integral_constant.h>
1415
#include <__type_traits/remove_cv.h>
1516

@@ -19,9 +20,6 @@
1920

2021
_LIBCPP_BEGIN_NAMESPACE_STD
2122

22-
template <class _Tp>
23-
class _LIBCPP_TEMPLATE_VIS reference_wrapper;
24-
2523
template <class _Tp>
2624
struct __is_reference_wrapper_impl : public false_type {};
2725
template <class _Tp>

libcxx/include/__type_traits/unwrap_ref.h

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#define _LIBCPP___TYPE_TRAITS_UNWRAP_REF_H
1111

1212
#include <__config>
13+
#include <__fwd/functional.h>
1314
#include <__type_traits/decay.h>
1415

1516
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -23,17 +24,11 @@ struct __unwrap_reference {
2324
typedef _LIBCPP_NODEBUG _Tp type;
2425
};
2526

26-
template <class _Tp>
27-
class reference_wrapper;
28-
2927
template <class _Tp>
3028
struct __unwrap_reference<reference_wrapper<_Tp> > {
3129
typedef _LIBCPP_NODEBUG _Tp& type;
3230
};
3331

34-
template <class _Tp>
35-
struct decay;
36-
3732
#if _LIBCPP_STD_VER >= 20
3833
template <class _Tp>
3934
struct unwrap_reference : __unwrap_reference<_Tp> {};

libcxx/include/experimental/propagate_const

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@
109109

110110
#include <__assert> // all public C++ headers provide the assertion handler
111111
#include <__functional/operations.h>
112-
#include <__fwd/hash.h>
112+
#include <__fwd/functional.h>
113113
#include <__type_traits/conditional.h>
114114
#include <__type_traits/decay.h>
115115
#include <__type_traits/enable_if.h>

libcxx/include/filesystem

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ inline constexpr bool std::ranges::enable_view<std::filesystem::recursive_direct
565565
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
566566
# include <concepts>
567567
# include <cstdlib>
568+
# include <cstring>
568569
# include <iosfwd>
569570
# include <new>
570571
# include <system_error>

libcxx/include/libcxx.imp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@
423423
{ include: [ "<__fwd/bit_reference.h>", "private", "<bitset>", "public" ] },
424424
{ include: [ "<__fwd/bit_reference.h>", "private", "<vector>", "public" ] },
425425
{ include: [ "<__fwd/fstream.h>", "private", "<fstream>", "public" ] },
426-
{ include: [ "<__fwd/hash.h>", "private", "<functional>", "public" ] },
426+
{ include: [ "<__fwd/functional.h>", "private", "<functional>", "public" ] },
427427
{ include: [ "<__fwd/ios.h>", "private", "<ios>", "public" ] },
428428
{ include: [ "<__fwd/istream.h>", "private", "<istream>", "public" ] },
429429
{ include: [ "<__fwd/mdspan.h>", "private", "<mdspan>", "public" ] },

libcxx/include/module.modulemap.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1357,7 +1357,7 @@ module std_private_functional_hash [system] {
13571357
export std_private_type_traits_underlying_type
13581358
export std_private_utility_pair
13591359
}
1360-
module std_private_functional_hash_fwd [system] { header "__fwd/hash.h" }
1360+
module std_private_functional_fwd [system] { header "__fwd/functional.h" }
13611361
module std_private_functional_identity [system] { header "__functional/identity.h" }
13621362
module std_private_functional_invoke [system] {
13631363
header "__functional/invoke.h"

libcxx/include/optional

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,8 +186,8 @@ namespace std {
186186
#include <__exception/exception.h>
187187
#include <__functional/hash.h>
188188
#include <__functional/invoke.h>
189-
#include <__functional/reference_wrapper.h>
190189
#include <__functional/unary_function.h>
190+
#include <__fwd/functional.h>
191191
#include <__memory/addressof.h>
192192
#include <__memory/construct_at.h>
193193
#include <__tuple/sfinae_helpers.h>

libcxx/include/type_traits

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ namespace std
418418
*/
419419
#include <__assert> // all public C++ headers provide the assertion handler
420420
#include <__config>
421-
#include <__fwd/hash.h> // This is https://llvm.org/PR56938
421+
#include <__fwd/functional.h> // This is https://llvm.org/PR56938
422422
#include <__type_traits/add_const.h>
423423
#include <__type_traits/add_cv.h>
424424
#include <__type_traits/add_lvalue_reference.h>

libcxx/test/libcxx/transitive_includes/cxx23.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ experimental/utility utility
177177
filesystem compare
178178
filesystem cstddef
179179
filesystem cstdint
180-
filesystem cstring
181180
filesystem ctime
182181
filesystem iomanip
183182
filesystem limits

libcxx/test/libcxx/transitive_includes/cxx26.csv

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ experimental/utility utility
177177
filesystem compare
178178
filesystem cstddef
179179
filesystem cstdint
180-
filesystem cstring
181180
filesystem ctime
182181
filesystem iomanip
183182
filesystem limits

0 commit comments

Comments
 (0)