Skip to content

[libc++] Remove <array> include from <span> #83742

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions libcxx/include/__fwd/array.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ 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

template <class>
struct __is_std_array : false_type {};

template <class _Tp, size_t _Size>
struct __is_std_array<array<_Tp, _Size> > : true_type {};

_LIBCPP_END_NAMESPACE_STD

#endif // _LIBCPP___FWD_ARRAY_H
16 changes: 8 additions & 8 deletions libcxx/include/span
Original file line number Diff line number Diff line change
Expand Up @@ -130,24 +130,29 @@ template<class R>

#include <__assert>
#include <__config>
#include <__fwd/array.h>
#include <__fwd/span.h>
#include <__iterator/bounded_iter.h>
#include <__iterator/concepts.h>
#include <__iterator/iterator_traits.h>
#include <__iterator/reverse_iterator.h>
#include <__iterator/wrap_iter.h>
#include <__memory/pointer_traits.h>
#include <__ranges/concepts.h>
#include <__ranges/data.h>
#include <__ranges/enable_borrowed_range.h>
#include <__ranges/enable_view.h>
#include <__ranges/size.h>
#include <__type_traits/is_array.h>
#include <__type_traits/is_const.h>
#include <__type_traits/is_convertible.h>
#include <__type_traits/remove_cv.h>
#include <__type_traits/remove_cvref.h>
#include <__type_traits/remove_reference.h>
#include <__type_traits/type_identity.h>
#include <__utility/forward.h>
#include <array> // for array
#include <cstddef> // for byte
#include <cstddef> // for byte
#include <initializer_list>
#include <stdexcept>
#include <version>

Expand All @@ -171,12 +176,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD

#if _LIBCPP_STD_VER >= 20

template <class _Tp>
struct __is_std_array : false_type {};

template <class _Tp, size_t _Sz>
struct __is_std_array<array<_Tp, _Sz>> : true_type {};

template <class _Tp>
struct __is_std_span : false_type {};

Expand Down Expand Up @@ -586,6 +585,7 @@ _LIBCPP_END_NAMESPACE_STD
_LIBCPP_POP_MACROS

#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
# include <array>
# include <concepts>
# include <functional>
# include <iterator>
Expand Down
1 change: 0 additions & 1 deletion libcxx/test/libcxx/transitive_includes/cxx23.csv
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ shared_mutex string
shared_mutex version
source_location cstdint
source_location version
span array
span cstddef
span initializer_list
span limits
Expand Down
1 change: 0 additions & 1 deletion libcxx/test/libcxx/transitive_includes/cxx26.csv
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,6 @@ shared_mutex string
shared_mutex version
source_location cstdint
source_location version
span array
span cstddef
span initializer_list
span limits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
// requires pair-like-convertible-from<PairLike, const I&, const S&>
// constexpr operator PairLike() const;

#include <array>
#include <cassert>
#include <concepts>
#include <ranges>
Expand Down