[libcxx-commits] [libcxx] [libc++][NFC] Reformat some deduction guides (PR #160085)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Sep 22 06:08:46 PDT 2025
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/160085
>From 715d0b11c35081603b4529c8319923eed62d16c8 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Mon, 22 Sep 2025 14:23:54 +0200
Subject: [PATCH] [libc++][NFC] Reformat some deduction guides
They're not formatted correctly anymore, since clang-format was updated.
---
libcxx/include/map | 18 ++++++++----------
libcxx/include/set | 20 ++++++++------------
libcxx/include/stack | 10 ++++------
libcxx/include/unordered_map | 12 ++++++------
libcxx/include/unordered_set | 14 +++++++-------
5 files changed, 33 insertions(+), 41 deletions(-)
diff --git a/libcxx/include/map b/libcxx/include/map
index e5085076faf02..5f906bb0106c1 100644
--- a/libcxx/include/map
+++ b/libcxx/include/map
@@ -1353,9 +1353,8 @@ template <class _Key,
class _Allocator = allocator<pair<const _Key, _Tp>>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(initializer_list<pair<_Key, _Tp>>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
+map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
+ -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
template <class _InputIterator,
class _Allocator,
@@ -1374,8 +1373,8 @@ map(from_range_t, _Range&&, _Allocator)
# endif
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-map(initializer_list<pair<_Key, _Tp>>,
- _Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
+map(initializer_list<pair<_Key, _Tp>>, _Allocator)
+ -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
# endif
# ifndef _LIBCPP_CXX03_LANG
@@ -1911,9 +1910,8 @@ template <class _Key,
class _Allocator = allocator<pair<const _Key, _Tp>>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(initializer_list<pair<_Key, _Tp>>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
+multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
+ -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
template <class _InputIterator,
class _Allocator,
@@ -1932,8 +1930,8 @@ multimap(from_range_t, _Range&&, _Allocator)
# endif
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multimap(initializer_list<pair<_Key, _Tp>>,
- _Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
+multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
+ -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
# endif
# ifndef _LIBCPP_CXX03_LANG
diff --git a/libcxx/include/set b/libcxx/include/set
index 6470894517fd8..81c3de7343ee5 100644
--- a/libcxx/include/set
+++ b/libcxx/include/set
@@ -925,15 +925,13 @@ template <class _InputIterator,
class _Allocator,
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(_InputIterator,
- _InputIterator,
- _Allocator) -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
+set(_InputIterator, _InputIterator, _Allocator)
+ -> set<__iter_value_type<_InputIterator>, less<__iter_value_type<_InputIterator>>, _Allocator>;
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-set(from_range_t,
- _Range&&,
- _Allocator) -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
+set(from_range_t, _Range&&, _Allocator)
+ -> set<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
# endif
template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
@@ -1373,9 +1371,8 @@ template <class _Key,
class _Allocator = allocator<_Key>,
class = enable_if_t<__is_allocator<_Allocator>::value, void>,
class = enable_if_t<!__is_allocator<_Compare>::value, void>>
-multiset(initializer_list<_Key>,
- _Compare = _Compare(),
- _Allocator = _Allocator()) -> multiset<_Key, _Compare, _Allocator>;
+multiset(initializer_list<_Key>, _Compare = _Compare(), _Allocator = _Allocator())
+ -> multiset<_Key, _Compare, _Allocator>;
template <class _InputIterator,
class _Allocator,
@@ -1386,9 +1383,8 @@ multiset(_InputIterator, _InputIterator, _Allocator)
# if _LIBCPP_STD_VER >= 23
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
-multiset(from_range_t,
- _Range&&,
- _Allocator) -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
+multiset(from_range_t, _Range&&, _Allocator)
+ -> multiset<ranges::range_value_t<_Range>, less<ranges::range_value_t<_Range>>, _Allocator>;
# endif
template <class _Key, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
diff --git a/libcxx/include/stack b/libcxx/include/stack
index 19d09373e23d1..985813fcf578a 100644
--- a/libcxx/include/stack
+++ b/libcxx/include/stack
@@ -315,14 +315,12 @@ template <class _InputIterator,
class _Alloc,
__enable_if_t<__has_input_iterator_category<_InputIterator>::value, int> = 0,
__enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-stack(_InputIterator,
- _InputIterator,
- _Alloc) -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
+stack(_InputIterator, _InputIterator, _Alloc)
+ -> stack<__iter_value_type<_InputIterator>, deque<__iter_value_type<_InputIterator>, _Alloc>>;
template <ranges::input_range _Range, class _Alloc, __enable_if_t<__is_allocator<_Alloc>::value, int> = 0>
-stack(from_range_t,
- _Range&&,
- _Alloc) -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
+stack(from_range_t, _Range&&, _Alloc)
+ -> stack<ranges::range_value_t<_Range>, deque<ranges::range_value_t<_Range>, _Alloc>>;
# endif
diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map
index 3c19d6f2a7f0d..43a2245c5acc0 100644
--- a/libcxx/include/unordered_map
+++ b/libcxx/include/unordered_map
@@ -2035,12 +2035,12 @@ template <class _Key,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_multimap(
- initializer_list<pair<_Key, _Tp>>,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
+unordered_multimap(initializer_list<pair<_Key, _Tp>>,
+ typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(),
+ _Pred = _Pred(),
+ _Allocator = _Allocator())
+ -> unordered_multimap<remove_const_t<_Key>, _Tp, _Hash, _Pred, _Allocator>;
template <class _InputIterator,
class _Allocator,
diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set
index 4bc9c1afa2639..c6ee0ffdec6af 100644
--- a/libcxx/include/unordered_set
+++ b/libcxx/include/unordered_set
@@ -937,13 +937,13 @@ template <ranges::input_range _Range,
class = enable_if_t<!is_integral<_Hash>::value>,
class = enable_if_t<!__is_allocator<_Pred>::value>,
class = enable_if_t<__is_allocator<_Allocator>::value>>
-unordered_set(
- from_range_t,
- _Range&&,
- typename allocator_traits<_Allocator>::size_type = 0,
- _Hash = _Hash(),
- _Pred = _Pred(),
- _Allocator = _Allocator()) -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
+unordered_set(from_range_t,
+ _Range&&,
+ typename allocator_traits<_Allocator>::size_type = 0,
+ _Hash = _Hash(),
+ _Pred = _Pred(),
+ _Allocator = _Allocator())
+ -> unordered_set<ranges::range_value_t<_Range>, _Hash, _Pred, _Allocator>; // C++23
# endif
template <class _Tp,
More information about the libcxx-commits
mailing list