[libcxx-commits] [libcxx] [libc++] Replace the last uses of __tuple_types with __type_list (PR #167214)
via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Nov 10 01:09:58 PST 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
`__tuple_types` is at this point just a `__type_list` with a weird name, so we can just replace the few places it's still used.
---
Full diff: https://github.com/llvm/llvm-project/pull/167214.diff
5 Files Affected:
- (modified) libcxx/include/CMakeLists.txt (-1)
- (modified) libcxx/include/__tuple/tuple_size.h (-1)
- (removed) libcxx/include/__tuple/tuple_types.h (-25)
- (modified) libcxx/include/module.modulemap.in (-1)
- (modified) libcxx/include/tuple (+7-7)
``````````diff
diff --git a/libcxx/include/CMakeLists.txt b/libcxx/include/CMakeLists.txt
index 46e17b584432e..09d4552664dd7 100644
--- a/libcxx/include/CMakeLists.txt
+++ b/libcxx/include/CMakeLists.txt
@@ -786,7 +786,6 @@ set(files
__tuple/tuple_like.h
__tuple/tuple_like_no_subrange.h
__tuple/tuple_size.h
- __tuple/tuple_types.h
__type_traits/add_cv_quals.h
__type_traits/add_pointer.h
__type_traits/add_reference.h
diff --git a/libcxx/include/__tuple/tuple_size.h b/libcxx/include/__tuple/tuple_size.h
index 60f2a667a1ba3..719edc0e342c0 100644
--- a/libcxx/include/__tuple/tuple_size.h
+++ b/libcxx/include/__tuple/tuple_size.h
@@ -12,7 +12,6 @@
#include <__config>
#include <__cstddef/size_t.h>
#include <__fwd/tuple.h>
-#include <__tuple/tuple_types.h>
#include <__type_traits/enable_if.h>
#include <__type_traits/integral_constant.h>
#include <__type_traits/is_const.h>
diff --git a/libcxx/include/__tuple/tuple_types.h b/libcxx/include/__tuple/tuple_types.h
deleted file mode 100644
index 7e1256cf8790e..0000000000000
--- a/libcxx/include/__tuple/tuple_types.h
+++ /dev/null
@@ -1,25 +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___TUPLE_TUPLE_TYPES_H
-#define _LIBCPP___TUPLE_TUPLE_TYPES_H
-
-#include <__config>
-
-#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
-# pragma GCC system_header
-#endif
-
-_LIBCPP_BEGIN_NAMESPACE_STD
-
-template <class... _Tp>
-struct __tuple_types {};
-
-_LIBCPP_END_NAMESPACE_STD
-
-#endif // _LIBCPP___TUPLE_TUPLE_TYPES_H
diff --git a/libcxx/include/module.modulemap.in b/libcxx/include/module.modulemap.in
index f77c885da5b6a..2266a1d1d4c1c 100644
--- a/libcxx/include/module.modulemap.in
+++ b/libcxx/include/module.modulemap.in
@@ -2124,7 +2124,6 @@ module std [system] {
module tuple_like_no_subrange { header "__tuple/tuple_like_no_subrange.h" }
module tuple_like { header "__tuple/tuple_like.h" }
module tuple_size { header "__tuple/tuple_size.h" }
- module tuple_types { header "__tuple/tuple_types.h" }
header "tuple"
export *
diff --git a/libcxx/include/tuple b/libcxx/include/tuple
index 3c5330dd6e14e..a960b64a71763 100644
--- a/libcxx/include/tuple
+++ b/libcxx/include/tuple
@@ -235,7 +235,6 @@ template <class... Types>
# include <__tuple/tuple_element.h>
# include <__tuple/tuple_like.h>
# include <__tuple/tuple_size.h>
-# include <__tuple/tuple_types.h>
# include <__type_traits/common_reference.h>
# include <__type_traits/common_type.h>
# include <__type_traits/conditional.h>
@@ -265,6 +264,7 @@ template <class... Types>
# include <__type_traits/remove_cv.h>
# include <__type_traits/remove_cvref.h>
# include <__type_traits/remove_reference.h>
+# include <__type_traits/type_list.h>
# include <__type_traits/unwrap_ref.h>
# include <__utility/declval.h>
# include <__utility/forward.h>
@@ -571,7 +571,7 @@ __memberwise_copy_assign(_Dest& __dest, _Source const& __source, __index_sequenc
template <class _Dest, class _Source, class... _Up, size_t... _Np>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 void
-__memberwise_forward_assign(_Dest& __dest, _Source&& __source, __tuple_types<_Up...>, __index_sequence<_Np...>) {
+__memberwise_forward_assign(_Dest& __dest, _Source&& __source, __type_list<_Up...>, __index_sequence<_Np...>) {
std::__swallow(((std::get<_Np>(__dest) = std::forward<_Up>(std::get<_Np>(__source))), void(), 0)...);
}
@@ -876,7 +876,7 @@ public:
requires(_And<is_assignable<const _Tp&, _Tp>...>::value)
{
std::__memberwise_forward_assign(
- *this, std::move(__tuple), __tuple_types<_Tp...>(), __make_index_sequence<sizeof...(_Tp)>());
+ *this, std::move(__tuple), __type_list<_Tp...>(), __make_index_sequence<sizeof...(_Tp)>());
return *this;
}
# endif // _LIBCPP_STD_VER >= 23
@@ -885,7 +885,7 @@ public:
operator=(_If<_And<is_move_assignable<_Tp>...>::value, tuple, __nat>&& __tuple) noexcept(
_And<is_nothrow_move_assignable<_Tp>...>::value) {
std::__memberwise_forward_assign(
- *this, std::move(__tuple), __tuple_types<_Tp...>(), __make_index_sequence<sizeof...(_Tp)>());
+ *this, std::move(__tuple), __type_list<_Tp...>(), __make_index_sequence<sizeof...(_Tp)>());
return *this;
}
@@ -905,7 +905,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
operator=(tuple<_Up...>&& __tuple) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {
std::__memberwise_forward_assign(
- *this, std::move(__tuple), __tuple_types<_Up...>(), __make_index_sequence<sizeof...(_Tp)>());
+ *this, std::move(__tuple), __type_list<_Up...>(), __make_index_sequence<sizeof...(_Tp)>());
return *this;
}
@@ -922,7 +922,7 @@ public:
enable_if_t< _And<_BoolConstant<sizeof...(_Tp) == sizeof...(_UTypes)>,
is_assignable<const _Tp&, _UTypes>...>::value>* = nullptr>
_LIBCPP_HIDE_FROM_ABI constexpr const tuple& operator=(tuple<_UTypes...>&& __u) const {
- std::__memberwise_forward_assign(*this, __u, __tuple_types<_UTypes...>(), __make_index_sequence<sizeof...(_Tp)>());
+ std::__memberwise_forward_assign(*this, __u, __type_list<_UTypes...>(), __make_index_sequence<sizeof...(_Tp)>());
return *this;
}
# endif // _LIBCPP_STD_VER >= 23
@@ -1000,7 +1000,7 @@ public:
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 tuple&
operator=(array<_Up, _Np>&& __array) noexcept(_And<is_nothrow_assignable<_Tp&, _Up>...>::value) {
std::__memberwise_forward_assign(
- *this, std::move(__array), __tuple_types<_If<true, _Up, _Tp>...>(), __make_index_sequence<sizeof...(_Tp)>());
+ *this, std::move(__array), __type_list<_If<true, _Up, _Tp>...>(), __make_index_sequence<sizeof...(_Tp)>());
return *this;
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/167214
More information about the libcxx-commits
mailing list