Skip to content

Commit 993c5f8

Browse files
Fix the rebase mess
1 parent 1cc13ec commit 993c5f8

File tree

9 files changed

+143
-88
lines changed

9 files changed

+143
-88
lines changed

libcxx/docs/FeatureTestMacroTable.rst

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,10 @@ Status
198198
---------------------------------------------------------- -----------------
199199
``__cpp_lib_char8_t`` ``201907L``
200200
---------------------------------------------------------- -----------------
201+
``__cpp_lib_common_reference`` ``202302L``
202+
---------------------------------------------------------- -----------------
203+
``__cpp_lib_common_reference_wrapper`` ``202302L``
204+
---------------------------------------------------------- -----------------
201205
``__cpp_lib_concepts`` ``202002L``
202206
---------------------------------------------------------- -----------------
203207
``__cpp_lib_constexpr_algorithms`` ``201806L``
@@ -376,7 +380,7 @@ Status
376380
---------------------------------------------------------- -----------------
377381
``__cpp_lib_ranges_iota`` ``202202L``
378382
---------------------------------------------------------- -----------------
379-
``__cpp_lib_ranges_join_with`` *unimplemented*
383+
``__cpp_lib_ranges_join_with`` ``202202L``
380384
---------------------------------------------------------- -----------------
381385
``__cpp_lib_ranges_repeat`` ``202207L``
382386
---------------------------------------------------------- -----------------
@@ -414,6 +418,8 @@ Status
414418
---------------------------------------------------------- -----------------
415419
``__cpp_lib_atomic_min_max`` *unimplemented*
416420
---------------------------------------------------------- -----------------
421+
``__cpp_lib_atomic_ref`` ``202411L``
422+
---------------------------------------------------------- -----------------
417423
``__cpp_lib_bind_front`` ``202306L``
418424
---------------------------------------------------------- -----------------
419425
``__cpp_lib_bitset`` ``202306L``
@@ -430,7 +436,7 @@ Status
430436
---------------------------------------------------------- -----------------
431437
``__cpp_lib_constexpr_queue`` ``202502L``
432438
---------------------------------------------------------- -----------------
433-
``__cpp_lib_constrained_equality`` *unimplemented*
439+
``__cpp_lib_constrained_equality`` ``202411L``
434440
---------------------------------------------------------- -----------------
435441
``__cpp_lib_copyable_function`` *unimplemented*
436442
---------------------------------------------------------- -----------------
@@ -478,14 +484,16 @@ Status
478484
---------------------------------------------------------- -----------------
479485
``__cpp_lib_not_fn`` ``202306L``
480486
---------------------------------------------------------- -----------------
481-
``__cpp_lib_optional_range_support`` *unimplemented*
487+
``__cpp_lib_optional_range_support`` ``202406L``
482488
---------------------------------------------------------- -----------------
483489
``__cpp_lib_out_ptr`` ``202311L``
484490
---------------------------------------------------------- -----------------
485491
``__cpp_lib_philox_engine`` *unimplemented*
486492
---------------------------------------------------------- -----------------
487493
``__cpp_lib_ranges_concat`` *unimplemented*
488494
---------------------------------------------------------- -----------------
495+
``__cpp_lib_ranges_indices`` ``202506L``
496+
---------------------------------------------------------- -----------------
489497
``__cpp_lib_ratio`` ``202306L``
490498
---------------------------------------------------------- -----------------
491499
``__cpp_lib_rcu`` *unimplemented*
@@ -504,6 +512,8 @@ Status
504512
---------------------------------------------------------- -----------------
505513
``__cpp_lib_sstream_from_string_view`` ``202306L``
506514
---------------------------------------------------------- -----------------
515+
``__cpp_lib_string_subview`` ``202506L``
516+
---------------------------------------------------------- -----------------
507517
``__cpp_lib_string_view`` ``202403L``
508518
---------------------------------------------------------- -----------------
509519
``__cpp_lib_submdspan`` *unimplemented*

libcxx/docs/ReleaseNotes/22.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ Implemented Papers
4040

4141
- P2321R2: ``zip`` (`Github <https://llvm.org/PR105169>`__) (The paper is partially implemented. ``zip_transform_view``
4242
is implemented in this release)
43+
- P3044R2: sub-``string_view`` from ``string`` (`Github <https://llvm.org/PR148140>`__)
44+
- P3223R2: Making ``std::istream::ignore`` less surprising (`Github <https://llvm.org/PR148178>`__)
45+
- P3060R3: Add ``std::views::indices(n)`` (`Github <https://llvm.org/PR148175>`__)
46+
- P2835R7: Expose ``std::atomic_ref``'s object address (`Github <https://llvm.org/PR118377>`__)
4347
- P3168R2: Give ``std::optional`` Range Support (`Github <https://llvm.org/PR105430>`__)
4448
- P3372R3: ``constexpr map`` (`Github <https://llvm.org/PR134330>`__) (The paper is partially implemented. ``constexpr map`` is implemented in this release)
4549

@@ -64,6 +68,14 @@ Improvements and New Features
6468
- Multiple internal types have been refactored to use ``[[no_unique_address]]``, resulting in faster compile times and
6569
reduced debug information.
6670

71+
- The performance of ``std::find`` has been improved by up to 2x for integral types
72+
- The ``std::distance`` and ``std::ranges::distance`` algorithms have been optimized for segmented iterators (e.g.,
73+
``std::join_view`` iterators), reducing the complexity from ``O(n)`` to ``O(n / segment_size)``. Benchmarks show
74+
performance improvements of over 1600x in favorable cases with large segment sizes (e.g., 1024).
75+
- The ``std::{fill, fill_n}`` and ``std::ranges::{fill, fill_n}`` algorithms have been optimized for segmented iterators,
76+
resulting in a performance improvement of at least 10x for ``std::deque<int>`` iterators and
77+
``std::join_view<std::vector<std::vector<int>>>`` iterators.
78+
6779
Deprecations and Removals
6880
-------------------------
6981

libcxx/include/__type_traits/make_transparent.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ template <class _Comparator>
3333
using __make_transparent_t _LIBCPP_NODEBUG = typename __make_transparent<_Comparator>::type;
3434

3535
template <class _Comparator, __enable_if_t<is_same<_Comparator, __make_transparent_t<_Comparator> >::value, int> = 0>
36-
_LIBCPP_HIDE_FROM_ABI _Comparator& __as_transparent(_Comparator& __comp) {
36+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 _Comparator& __as_transparent(_Comparator& __comp) {
3737
return __comp;
3838
}
3939

libcxx/include/__utility/default_three_way_comparator.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ template <class _LHS, class _RHS>
3131
struct __default_three_way_comparator<_LHS,
3232
_RHS,
3333
__enable_if_t<is_arithmetic<_LHS>::value && is_arithmetic<_RHS>::value> > {
34-
_LIBCPP_HIDE_FROM_ABI static int operator()(_LHS __lhs, _RHS __rhs) {
34+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 static int operator()(_LHS __lhs, _RHS __rhs) {
3535
if (__lhs < __rhs)
3636
return -1;
3737
if (__lhs > __rhs)

libcxx/include/map

Lines changed: 37 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1414,17 +1414,17 @@ template <class _InputIterator,
14141414
class _Compare = less<__iter_key_type<_InputIterator>>,
14151415
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
14161416
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1417-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
1418-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1417+
class = enable_if_t<!__is_allocator_v<_Compare>>,
1418+
class = enable_if_t<__is_allocator_v<_Allocator>>>
14191419
map(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
14201420
-> map<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
14211421

14221422
# if _LIBCPP_STD_VER >= 23
14231423
template <ranges::input_range _Range,
14241424
class _Compare = less<__range_key_type<_Range>>,
14251425
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
1426-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
1427-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1426+
class = enable_if_t<!__is_allocator_v<_Compare>>,
1427+
class = enable_if_t<__is_allocator_v<_Allocator>>>
14281428
map(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
14291429
-> map<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
14301430
# endif
@@ -1433,31 +1433,30 @@ template <class _Key,
14331433
class _Tp,
14341434
class _Compare = less<remove_const_t<_Key>>,
14351435
class _Allocator = allocator<pair<const _Key, _Tp>>,
1436-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
1437-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1438-
map(initializer_list<pair<_Key, _Tp>>,
1439-
_Compare = _Compare(),
1440-
_Allocator = _Allocator()) -> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
1436+
class = enable_if_t<!__is_allocator_v<_Compare>>,
1437+
class = enable_if_t<__is_allocator_v<_Allocator>>>
1438+
map(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
1439+
-> map<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
14411440

14421441
template <class _InputIterator,
14431442
class _Allocator,
14441443
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
1445-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1444+
class = enable_if_t<__is_allocator_v<_Allocator>>>
14461445
map(_InputIterator, _InputIterator, _Allocator)
14471446
-> map<__iter_key_type<_InputIterator>,
14481447
__iter_mapped_type<_InputIterator>,
14491448
less<__iter_key_type<_InputIterator>>,
14501449
_Allocator>;
14511450

14521451
# if _LIBCPP_STD_VER >= 23
1453-
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1452+
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
14541453
map(from_range_t, _Range&&, _Allocator)
14551454
-> map<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
14561455
# endif
14571456

1458-
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
1459-
map(initializer_list<pair<_Key, _Tp>>,
1460-
_Allocator) -> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
1457+
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
1458+
map(initializer_list<pair<_Key, _Tp>>, _Allocator)
1459+
-> map<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
14611460
# endif
14621461

14631462
# ifndef _LIBCPP_CXX03_LANG
@@ -1625,10 +1624,11 @@ public:
16251624
protected:
16261625
key_compare comp;
16271626

1628-
_LIBCPP_HIDE_FROM_ABI value_compare(key_compare __c) : comp(__c) {}
1627+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 value_compare(key_compare __c) : comp(__c) {}
16291628

16301629
public:
1631-
_LIBCPP_HIDE_FROM_ABI bool operator()(const value_type& __x, const value_type& __y) const {
1630+
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 bool
1631+
operator()(const value_type& __x, const value_type& __y) const {
16321632
return comp(__x.first, __y.first);
16331633
}
16341634
};
@@ -1963,37 +1963,37 @@ public:
19631963
# endif // _LIBCPP_STD_VER >= 20
19641964

19651965
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const key_type& __k) {
1966-
return __tree_.lower_bound(__k);
1966+
return __tree_.__lower_bound_multi(__k);
19671967
}
19681968
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const key_type& __k) const {
1969-
return __tree_.lower_bound(__k);
1969+
return __tree_.__lower_bound_multi(__k);
19701970
}
19711971
# if _LIBCPP_STD_VER >= 14
19721972
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
19731973
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator lower_bound(const _K2& __k) {
1974-
return __tree_.lower_bound(__k);
1974+
return __tree_.__lower_bound_multi(__k);
19751975
}
19761976

19771977
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
19781978
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator lower_bound(const _K2& __k) const {
1979-
return __tree_.lower_bound(__k);
1979+
return __tree_.__lower_bound_multi(__k);
19801980
}
19811981
# endif
19821982

19831983
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const key_type& __k) {
1984-
return __tree_.upper_bound(__k);
1984+
return __tree_.__upper_bound_multi(__k);
19851985
}
19861986
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const key_type& __k) const {
1987-
return __tree_.upper_bound(__k);
1987+
return __tree_.__upper_bound_multi(__k);
19881988
}
19891989
# if _LIBCPP_STD_VER >= 14
19901990
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
19911991
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 iterator upper_bound(const _K2& __k) {
1992-
return __tree_.upper_bound(__k);
1992+
return __tree_.__upper_bound_multi(__k);
19931993
}
19941994
template <typename _K2, enable_if_t<__is_transparent_v<_Compare, _K2>, int> = 0>
19951995
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX26 const_iterator upper_bound(const _K2& __k) const {
1996-
return __tree_.upper_bound(__k);
1996+
return __tree_.__upper_bound_multi(__k);
19971997
}
19981998
# endif
19991999

@@ -2030,17 +2030,17 @@ template <class _InputIterator,
20302030
class _Compare = less<__iter_key_type<_InputIterator>>,
20312031
class _Allocator = allocator<__iter_to_alloc_type<_InputIterator>>,
20322032
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
2033-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
2034-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2033+
class = enable_if_t<!__is_allocator_v<_Compare>>,
2034+
class = enable_if_t<__is_allocator_v<_Allocator>>>
20352035
multimap(_InputIterator, _InputIterator, _Compare = _Compare(), _Allocator = _Allocator())
20362036
-> multimap<__iter_key_type<_InputIterator>, __iter_mapped_type<_InputIterator>, _Compare, _Allocator>;
20372037

20382038
# if _LIBCPP_STD_VER >= 23
20392039
template <ranges::input_range _Range,
20402040
class _Compare = less<__range_key_type<_Range>>,
20412041
class _Allocator = allocator<__range_to_alloc_type<_Range>>,
2042-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
2043-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2042+
class = enable_if_t<!__is_allocator_v<_Compare>>,
2043+
class = enable_if_t<__is_allocator_v<_Allocator>>>
20442044
multimap(from_range_t, _Range&&, _Compare = _Compare(), _Allocator = _Allocator())
20452045
-> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, _Compare, _Allocator>;
20462046
# endif
@@ -2049,31 +2049,30 @@ template <class _Key,
20492049
class _Tp,
20502050
class _Compare = less<remove_const_t<_Key>>,
20512051
class _Allocator = allocator<pair<const _Key, _Tp>>,
2052-
class = enable_if_t<!__is_allocator<_Compare>::value, void>,
2053-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2054-
multimap(initializer_list<pair<_Key, _Tp>>,
2055-
_Compare = _Compare(),
2056-
_Allocator = _Allocator()) -> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
2052+
class = enable_if_t<!__is_allocator_v<_Compare>>,
2053+
class = enable_if_t<__is_allocator_v<_Allocator>>>
2054+
multimap(initializer_list<pair<_Key, _Tp>>, _Compare = _Compare(), _Allocator = _Allocator())
2055+
-> multimap<remove_const_t<_Key>, _Tp, _Compare, _Allocator>;
20572056

20582057
template <class _InputIterator,
20592058
class _Allocator,
20602059
class = enable_if_t<__has_input_iterator_category<_InputIterator>::value, void>,
2061-
class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2060+
class = enable_if_t<__is_allocator_v<_Allocator>>>
20622061
multimap(_InputIterator, _InputIterator, _Allocator)
20632062
-> multimap<__iter_key_type<_InputIterator>,
20642063
__iter_mapped_type<_InputIterator>,
20652064
less<__iter_key_type<_InputIterator>>,
20662065
_Allocator>;
20672066

20682067
# if _LIBCPP_STD_VER >= 23
2069-
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2068+
template <ranges::input_range _Range, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
20702069
multimap(from_range_t, _Range&&, _Allocator)
20712070
-> multimap<__range_key_type<_Range>, __range_mapped_type<_Range>, less<__range_key_type<_Range>>, _Allocator>;
20722071
# endif
20732072

2074-
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator<_Allocator>::value, void>>
2075-
multimap(initializer_list<pair<_Key, _Tp>>,
2076-
_Allocator) -> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
2073+
template <class _Key, class _Tp, class _Allocator, class = enable_if_t<__is_allocator_v<_Allocator>>>
2074+
multimap(initializer_list<pair<_Key, _Tp>>, _Allocator)
2075+
-> multimap<remove_const_t<_Key>, _Tp, less<remove_const_t<_Key>>, _Allocator>;
20772076
# endif
20782077

20792078
# ifndef _LIBCPP_CXX03_LANG

0 commit comments

Comments
 (0)