Skip to content

Commit 45a2600

Browse files
Change policy template parameter name; add issue description
1 parent bf74931 commit 45a2600

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

libcxx/include/deque

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,10 +1203,10 @@ private:
12031203
template <class _Iterator>
12041204
_LIBCPP_HIDE_FROM_ABI iterator __insert_with_size(const_iterator __p, _Iterator __f, size_type __n);
12051205

1206-
template <class _IterOpsPolicy, class _BiIter, class _Sentinel>
1206+
template <class _AlgPolicy, class _BiIter, class _Sentinel>
12071207
_LIBCPP_HIDE_FROM_ABI iterator
12081208
__insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel __sent, size_type __n);
1209-
template <class _IterOpsPolicy, class _BiIter>
1209+
template <class _AlgPolicy, class _BiIter>
12101210
_LIBCPP_HIDE_FROM_ABI iterator __insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n);
12111211

12121212
template <class _InpIter, __enable_if_t<__has_exactly_input_iterator_category<_InpIter>::value, int> = 0>
@@ -1907,17 +1907,17 @@ typename deque<_Tp, _Allocator>::iterator deque<_Tp, _Allocator>::insert(const_i
19071907
}
19081908

19091909
template <class _Tp, class _Allocator>
1910-
template <class _IterOpsPolicy, class _BiIter, class _Sentinel>
1910+
template <class _AlgPolicy, class _BiIter, class _Sentinel>
19111911
_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
19121912
deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _Sentinel, size_type __n) {
1913-
return __insert_bidirectional<_IterOpsPolicy>(__p, __f, _IterOps<_IterOpsPolicy>::next(__f, __n), __n);
1913+
return __insert_bidirectional<_AlgPolicy>(__p, __f, _IterOps<_AlgPolicy>::next(__f, __n), __n);
19141914
}
19151915

19161916
template <class _Tp, class _Allocator>
1917-
template <class _IterOpsPolicy, class _BiIter>
1917+
template <class _AlgPolicy, class _BiIter>
19181918
_LIBCPP_HIDE_FROM_ABI typename deque<_Tp, _Allocator>::iterator
19191919
deque<_Tp, _Allocator>::__insert_bidirectional(const_iterator __p, _BiIter __f, _BiIter __l, size_type __n) {
1920-
using _Ops = _IterOps<_IterOpsPolicy>;
1920+
using _Ops = _IterOps<_AlgPolicy>;
19211921
size_type __pos = __p - begin();
19221922
size_type __to_end = size() - __pos;
19231923
allocator_type& __a = __alloc();

libcxx/test/std/containers/from_range_helpers.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,8 @@ constexpr auto wrap_input(std::vector<T>& input) {
5454
}
5555

5656
// https://llvm.org/PR159943
57+
// Verify container insertion/assignment from ranges whose iterators dereference to prvalues.
58+
// Especially, `std::prev` should be avoided when inserting such a `bidirectional_range`.
5759
struct DecayCopy {
5860
template <class T>
5961
requires std::convertible_to<T, std::decay_t<T>>

0 commit comments

Comments
 (0)