[libc++] Move the contents of __fwd/get.h
into the forward declaration headers they actually belong to (#81368)
This brings us closer to one forward declaring header per public header.
This commit is contained in:
parent
373d9d7214
commit
f9d6d6fbcc
@ -427,7 +427,6 @@ set(files
|
||||
__fwd/array.h
|
||||
__fwd/bit_reference.h
|
||||
__fwd/fstream.h
|
||||
__fwd/get.h
|
||||
__fwd/hash.h
|
||||
__fwd/ios.h
|
||||
__fwd/istream.h
|
||||
|
@ -21,6 +21,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
template <class _Tp, size_t _Size>
|
||||
struct _LIBCPP_TEMPLATE_VIS array;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& get(array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& get(const array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&& get(array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP___FWD_ARRAY_H
|
||||
|
@ -1,99 +0,0 @@
|
||||
//===----------------------------------------------------------------------===//
|
||||
//
|
||||
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
||||
// See https://llvm.org/LICENSE.txt for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#ifndef _LIBCPP___FWD_GET_H
|
||||
#define _LIBCPP___FWD_GET_H
|
||||
|
||||
#include <__concepts/copyable.h>
|
||||
#include <__config>
|
||||
#include <__fwd/array.h>
|
||||
#include <__fwd/pair.h>
|
||||
#include <__fwd/subrange.h>
|
||||
#include <__fwd/tuple.h>
|
||||
#include <__tuple/tuple_element.h>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
#endif
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(const tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(tuple<_Tp...>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(const tuple<_Tp...>&&) _NOEXCEPT;
|
||||
|
||||
#endif //_LIBCPP_CXX03_LANG
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(const pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp& get(array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp& get(const array<_Tp, _Size>&) _NOEXCEPT;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 _Tp&& get(array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _Tp, size_t _Size>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const _Tp&& get(const array<_Tp, _Size>&&) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
|
||||
namespace ranges {
|
||||
|
||||
template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
|
||||
requires((_Index == 0 && copyable<_Iter>) || _Index == 1)
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>& __subrange);
|
||||
|
||||
template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
|
||||
requires(_Index < 2)
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto get(subrange<_Iter, _Sent, _Kind>&& __subrange);
|
||||
|
||||
} // namespace ranges
|
||||
|
||||
using ranges::get;
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP___FWD_GET_H
|
@ -10,6 +10,8 @@
|
||||
#define _LIBCPP___FWD_PAIR_H
|
||||
|
||||
#include <__config>
|
||||
#include <__fwd/tuple.h>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
@ -20,6 +22,24 @@ _LIBCPP_BEGIN_NAMESPACE_STD
|
||||
template <class, class>
|
||||
struct _LIBCPP_TEMPLATE_VIS pair;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&
|
||||
get(const pair<_T1, _T2>&) _NOEXCEPT;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class _T1, class _T2>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, pair<_T1, _T2> >::type&&
|
||||
get(const pair<_T1, _T2>&&) _NOEXCEPT;
|
||||
#endif
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP___FWD_PAIR_H
|
||||
|
@ -9,7 +9,10 @@
|
||||
#ifndef _LIBCPP___FWD_SUBRANGE_H
|
||||
#define _LIBCPP___FWD_SUBRANGE_H
|
||||
|
||||
#include <__concepts/copyable.h>
|
||||
#include <__config>
|
||||
#include <__iterator/concepts.h>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
@ -17,8 +20,6 @@
|
||||
|
||||
#if _LIBCPP_STD_VER >= 20
|
||||
|
||||
# include <__iterator/concepts.h>
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
namespace ranges {
|
||||
@ -29,8 +30,18 @@ template <input_or_output_iterator _Iter, sentinel_for<_Iter> _Sent, subrange_ki
|
||||
requires(_Kind == subrange_kind::sized || !sized_sentinel_for<_Sent, _Iter>)
|
||||
class _LIBCPP_TEMPLATE_VIS subrange;
|
||||
|
||||
template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
|
||||
requires((_Index == 0 && copyable<_Iter>) || _Index == 1)
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto get(const subrange<_Iter, _Sent, _Kind>&);
|
||||
|
||||
template <size_t _Index, class _Iter, class _Sent, subrange_kind _Kind>
|
||||
requires(_Index < 2)
|
||||
_LIBCPP_HIDE_FROM_ABI constexpr auto get(subrange<_Iter, _Sent, _Kind>&&);
|
||||
|
||||
} // namespace ranges
|
||||
|
||||
using ranges::get;
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
||||
#endif // _LIBCPP_STD_VER >= 20
|
||||
|
@ -10,6 +10,7 @@
|
||||
#define _LIBCPP___FWD_TUPLE_H
|
||||
|
||||
#include <__config>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
@ -17,11 +18,33 @@
|
||||
|
||||
_LIBCPP_BEGIN_NAMESPACE_STD
|
||||
|
||||
template <size_t, class>
|
||||
struct _LIBCPP_TEMPLATE_VIS tuple_element;
|
||||
|
||||
#ifndef _LIBCPP_CXX03_LANG
|
||||
|
||||
template <class...>
|
||||
class _LIBCPP_TEMPLATE_VIS tuple;
|
||||
|
||||
template <class>
|
||||
struct _LIBCPP_TEMPLATE_VIS tuple_size;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&
|
||||
get(const tuple<_Tp...>&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(tuple<_Tp...>&&) _NOEXCEPT;
|
||||
|
||||
template <size_t _Ip, class... _Tp>
|
||||
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 const typename tuple_element<_Ip, tuple<_Tp...> >::type&&
|
||||
get(const tuple<_Tp...>&&) _NOEXCEPT;
|
||||
|
||||
#endif // _LIBCPP_CXX03_LANG
|
||||
|
||||
_LIBCPP_END_NAMESPACE_STD
|
||||
|
@ -11,7 +11,6 @@
|
||||
#define _LIBCPP___MEMORY_COMPRESSED_PAIR_H
|
||||
|
||||
#include <__config>
|
||||
#include <__fwd/get.h>
|
||||
#include <__fwd/tuple.h>
|
||||
#include <__tuple/tuple_indices.h>
|
||||
#include <__type_traits/decay.h>
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <__concepts/derived_from.h>
|
||||
#include <__concepts/equality_comparable.h>
|
||||
#include <__config>
|
||||
#include <__fwd/get.h>
|
||||
#include <__iterator/concepts.h>
|
||||
#include <__iterator/iterator_traits.h>
|
||||
#include <__ranges/access.h>
|
||||
|
@ -17,7 +17,6 @@
|
||||
#include <__concepts/derived_from.h>
|
||||
#include <__concepts/different_from.h>
|
||||
#include <__config>
|
||||
#include <__fwd/get.h>
|
||||
#include <__fwd/subrange.h>
|
||||
#include <__iterator/advance.h>
|
||||
#include <__iterator/concepts.h>
|
||||
|
@ -16,7 +16,6 @@
|
||||
#include <__fwd/tuple.h>
|
||||
#include <__type_traits/integral_constant.h>
|
||||
#include <__type_traits/remove_cvref.h>
|
||||
#include <cstddef>
|
||||
|
||||
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
|
||||
# pragma GCC system_header
|
||||
|
@ -14,7 +14,6 @@
|
||||
#include <__concepts/different_from.h>
|
||||
#include <__config>
|
||||
#include <__fwd/array.h>
|
||||
#include <__fwd/get.h>
|
||||
#include <__fwd/pair.h>
|
||||
#include <__fwd/subrange.h>
|
||||
#include <__fwd/tuple.h>
|
||||
|
@ -167,6 +167,7 @@ template <class Stream, class T>
|
||||
#include <__type_traits/is_base_of.h>
|
||||
#include <__utility/declval.h>
|
||||
#include <__utility/forward.h>
|
||||
#include <bitset>
|
||||
#include <ostream>
|
||||
#include <version>
|
||||
|
||||
|
@ -1790,7 +1790,6 @@ module std_private_thread_thread [system] {
|
||||
}
|
||||
module std_private_thread_timed_backoff_policy [system] { header "__thread/timed_backoff_policy.h" }
|
||||
|
||||
module std_private_tuple_get_fwd [system] { header "__fwd/get.h" }
|
||||
module std_private_tuple_make_tuple_types [system] { header "__tuple/make_tuple_types.h" }
|
||||
module std_private_tuple_pair_like [system] {
|
||||
header "__tuple/pair_like.h"
|
||||
|
@ -110,6 +110,7 @@ protected:
|
||||
#include <__assert> // all public C++ headers provide the assertion handler
|
||||
#include <__config>
|
||||
#include <__fwd/streambuf.h>
|
||||
#include <__type_traits/is_same.h>
|
||||
#include <climits>
|
||||
#include <ios>
|
||||
#include <iosfwd>
|
||||
|
@ -211,7 +211,6 @@ template <class... Types>
|
||||
#include <__config>
|
||||
#include <__functional/invoke.h>
|
||||
#include <__fwd/array.h>
|
||||
#include <__fwd/get.h>
|
||||
#include <__fwd/tuple.h>
|
||||
#include <__memory/allocator_arg_t.h>
|
||||
#include <__memory/uses_allocator.h>
|
||||
|
@ -393,6 +393,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream concepts
|
||||
istream cstddef
|
||||
istream iosfwd
|
||||
|
|
@ -396,6 +396,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream concepts
|
||||
istream cstddef
|
||||
istream iosfwd
|
||||
|
|
@ -398,6 +398,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream concepts
|
||||
istream cstddef
|
||||
istream iosfwd
|
||||
|
|
@ -398,6 +398,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream concepts
|
||||
istream cstddef
|
||||
istream iosfwd
|
||||
|
|
@ -403,6 +403,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream concepts
|
||||
istream cstddef
|
||||
istream iosfwd
|
||||
|
|
@ -282,6 +282,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream cstddef
|
||||
istream ostream
|
||||
istream version
|
||||
|
|
@ -282,6 +282,7 @@ iostream istream
|
||||
iostream ostream
|
||||
iostream streambuf
|
||||
iostream version
|
||||
istream bitset
|
||||
istream cstddef
|
||||
istream ostream
|
||||
istream version
|
||||
|
|
Loading…
x
Reference in New Issue
Block a user