Skip to content

Commit a94cdd4

Browse files
committed
[libc++] remove unused template parameter from __is_transparent_v
1 parent f494346 commit a94cdd4

File tree

6 files changed

+109
-117
lines changed

6 files changed

+109
-117
lines changed

libcxx/include/__flat_map/flat_map.h

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ class flat_map {
131131
_LIBCPP_HIDE_FROM_ABI static constexpr bool __allocator_ctor_constraint =
132132
_And<uses_allocator<key_container_type, _Allocator>, uses_allocator<mapped_container_type, _Allocator>>::value;
133133

134-
_LIBCPP_HIDE_FROM_ABI static constexpr bool __is_compare_transparent = __is_transparent_v<_Compare, _Compare>;
134+
_LIBCPP_HIDE_FROM_ABI static constexpr bool __is_compare_transparent = __is_transparent_v<_Compare>;
135135

136136
public:
137137
// [flat.map.cons], construct/copy/destroy
@@ -1187,22 +1187,20 @@ template <ranges::input_range _Range,
11871187
class _Compare = less<__range_key_type<_Range>>,
11881188
class _Allocator = allocator<byte>,
11891189
class = __enable_if_t<!__is_allocator<_Compare>::value && __is_allocator<_Allocator>::value>>
1190-
flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
1191-
-> flat_map<
1192-
__range_key_type<_Range>,
1193-
__range_mapped_type<_Range>,
1194-
_Compare,
1195-
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
1196-
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
1190+
flat_map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator()) -> flat_map<
1191+
__range_key_type<_Range>,
1192+
__range_mapped_type<_Range>,
1193+
_Compare,
1194+
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
1195+
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
11971196

11981197
template <ranges::input_range _Range, class _Allocator, class = __enable_if_t<__is_allocator<_Allocator>::value>>
1199-
flat_map(from_range_t, _Range&&, _Allocator)
1200-
-> flat_map<
1201-
__range_key_type<_Range>,
1202-
__range_mapped_type<_Range>,
1203-
less<__range_key_type<_Range>>,
1204-
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
1205-
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
1198+
flat_map(from_range_t, _Range&&, _Allocator) -> flat_map<
1199+
__range_key_type<_Range>,
1200+
__range_mapped_type<_Range>,
1201+
less<__range_key_type<_Range>>,
1202+
vector<__range_key_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_key_type<_Range>>>,
1203+
vector<__range_mapped_type<_Range>, __allocator_traits_rebind_t<_Allocator, __range_mapped_type<_Range>>>>;
12061204

12071205
template <class _Key, class _Tp, class _Compare = less<_Key>>
12081206
requires(!__is_allocator<_Compare>::value)

libcxx/include/__functional/is_transparent.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2121

2222
#if _LIBCPP_STD_VER >= 14
2323

24-
template <class _Tp, class, class = void>
24+
template <class _Tp, class = void>
2525
inline const bool __is_transparent_v = false;
2626

27-
template <class _Tp, class _Up>
28-
inline const bool __is_transparent_v<_Tp, _Up, __void_t<typename _Tp::is_transparent> > = true;
27+
template <class _Tp>
28+
inline const bool __is_transparent_v<_Tp, __void_t<typename _Tp::is_transparent> > = true;
2929

3030
#endif
3131

libcxx/include/map

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,27 +1371,27 @@ public:
13711371
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
13721372
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
13731373
# if _LIBCPP_STD_VER >= 14
1374-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1374+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
13751375
_LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
13761376
return __tree_.find(__k);
13771377
}
1378-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1378+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
13791379
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
13801380
return __tree_.find(__k);
13811381
}
13821382
# endif
13831383

13841384
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_unique(__k); }
13851385
# if _LIBCPP_STD_VER >= 14
1386-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1386+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
13871387
_LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
13881388
return __tree_.__count_multi(__k);
13891389
}
13901390
# endif
13911391

13921392
# if _LIBCPP_STD_VER >= 20
13931393
_LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
1394-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1394+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
13951395
_LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
13961396
return find(__k) != end();
13971397
}
@@ -1400,12 +1400,12 @@ public:
14001400
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
14011401
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
14021402
# if _LIBCPP_STD_VER >= 14
1403-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1403+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14041404
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
14051405
return __tree_.lower_bound(__k);
14061406
}
14071407

1408-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1408+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14091409
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
14101410
return __tree_.lower_bound(__k);
14111411
}
@@ -1414,11 +1414,11 @@ public:
14141414
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
14151415
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
14161416
# if _LIBCPP_STD_VER >= 14
1417-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1417+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14181418
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
14191419
return __tree_.upper_bound(__k);
14201420
}
1421-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1421+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14221422
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
14231423
return __tree_.upper_bound(__k);
14241424
}
@@ -1431,11 +1431,11 @@ public:
14311431
return __tree_.__equal_range_unique(__k);
14321432
}
14331433
# if _LIBCPP_STD_VER >= 14
1434-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1434+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14351435
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
14361436
return __tree_.__equal_range_multi(__k);
14371437
}
1438-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1438+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
14391439
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
14401440
return __tree_.__equal_range_multi(__k);
14411441
}
@@ -1482,9 +1482,8 @@ template <class _Key,
14821482
class _Allocator = allocator<pair<const _Key, _Tp>>,
14831483
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
14841484
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1485-
map(initializer_list<pair<_Key, _Tp>>,
1486-
_Compare = _Compare(),
1487-
_Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
1485+
map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
1486+
-> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
14881487

14891488
template <class _InputIterator,
14901489
class _Allocator,
@@ -1503,8 +1502,8 @@ map(from_range_t, _Range&&, _Allocator)
15031502
# endif
15041503

15051504
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1506-
map(initializer_list<pair<_Key, _Tp>>,
1507-
_Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
1505+
map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1506+
-> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
15081507
# endif
15091508

15101509
# ifndef _LIBCPP_CXX03_LANG
@@ -1964,27 +1963,27 @@ public:
19641963
_LIBCPP_HIDE_FROM_ABI iterator find(const key_type& __k) { return __tree_.find(__k); }
19651964
_LIBCPP_HIDE_FROM_ABI const_iterator find(const key_type& __k) const { return __tree_.find(__k); }
19661965
# if _LIBCPP_STD_VER >= 14
1967-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1966+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
19681967
_LIBCPP_HIDE_FROM_ABI iterator find(const _K2& __k) {
19691968
return __tree_.find(__k);
19701969
}
1971-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1970+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
19721971
_LIBCPP_HIDE_FROM_ABI const_iterator find(const _K2& __k) const {
19731972
return __tree_.find(__k);
19741973
}
19751974
# endif
19761975

19771976
_LIBCPP_HIDE_FROM_ABI size_type count(const key_type& __k) const { return __tree_.__count_multi(__k); }
19781977
# if _LIBCPP_STD_VER >= 14
1979-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1978+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
19801979
_LIBCPP_HIDE_FROM_ABI size_type count(const _K2& __k) const {
19811980
return __tree_.__count_multi(__k);
19821981
}
19831982
# endif
19841983

19851984
# if _LIBCPP_STD_VER >= 20
19861985
_LIBCPP_HIDE_FROM_ABI bool contains(const key_type& __k) const { return find(__k) != end(); }
1987-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1986+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
19881987
_LIBCPP_HIDE_FROM_ABI bool contains(const _K2& __k) const {
19891988
return find(__k) != end();
19901989
}
@@ -1993,12 +1992,12 @@ public:
19931992
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const key_type& __k) { return __tree_.lower_bound(__k); }
19941993
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const key_type& __k) const { return __tree_.lower_bound(__k); }
19951994
# if _LIBCPP_STD_VER >= 14
1996-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
1995+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
19971996
_LIBCPP_HIDE_FROM_ABI iterator lower_bound(const _K2& __k) {
19981997
return __tree_.lower_bound(__k);
19991998
}
20001999

2001-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
2000+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
20022001
_LIBCPP_HIDE_FROM_ABI const_iterator lower_bound(const _K2& __k) const {
20032002
return __tree_.lower_bound(__k);
20042003
}
@@ -2007,11 +2006,11 @@ public:
20072006
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const key_type& __k) { return __tree_.upper_bound(__k); }
20082007
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const key_type& __k) const { return __tree_.upper_bound(__k); }
20092008
# if _LIBCPP_STD_VER >= 14
2010-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
2009+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
20112010
_LIBCPP_HIDE_FROM_ABI iterator upper_bound(const _K2& __k) {
20122011
return __tree_.upper_bound(__k);
20132012
}
2014-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
2013+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
20152014
_LIBCPP_HIDE_FROM_ABI const_iterator upper_bound(const _K2& __k) const {
20162015
return __tree_.upper_bound(__k);
20172016
}
@@ -2024,11 +2023,11 @@ public:
20242023
return __tree_.__equal_range_multi(__k);
20252024
}
20262025
# if _LIBCPP_STD_VER >= 14
2027-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
2026+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
20282027
_LIBCPP_HIDE_FROM_ABI pair<iterator, iterator> equal_range(const _K2& __k) {
20292028
return __tree_.__equal_range_multi(__k);
20302029
}
2031-
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
2030+
template <typename _K2, enable_if_t<__is_transparent_v<_Compare>, int> = 0>
20322031
_LIBCPP_HIDE_FROM_ABI pair<const_iterator, const_iterator> equal_range(const _K2& __k) const {
20332032
return __tree_.__equal_range_multi(__k);
20342033
}
@@ -2069,9 +2068,8 @@ template <class _Key,
20692068
class _Allocator = allocator<pair<const _Key, _Tp>>,
20702069
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
20712070
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2072-
multimap(initializer_list<pair<_Key, _Tp>>,
2073-
_Compare = _Compare(),
2074-
_Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
2071+
multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
2072+
-> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
20752073

20762074
template <class _InputIterator,
20772075
class _Allocator,
@@ -2090,8 +2088,8 @@ multimap(from_range_t, _Range&&, _Allocator)
20902088
# endif
20912089

20922090
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2093-
multimap(initializer_list<pair<_Key, _Tp>>,
2094-
_Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
2091+
multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2092+
-> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
20952093
# endif
20962094

20972095
# ifndef _LIBCPP_CXX03_LANG

0 commit comments

Comments
 (0)