diff --git a/stl/inc/deque b/stl/inc/deque index a5a97e287c0..3ce93fd2e3f 100644 --- a/stl/inc/deque +++ b/stl/inc/deque @@ -825,8 +825,8 @@ public: template , int> = 0> void assign(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - _Assign_range(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Assign_range(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1244,10 +1244,10 @@ public: template , int> = 0> iterator insert(const_iterator _Where, _Iter _First, _Iter _Last) { // insert [_First, _Last) at _Where - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); const size_type _Off = static_cast(_Where - begin()); return _Insert_range(_Is_cpp17_bidi_iter_v<_Iter>)>( - _Off, _Get_unwrapped(_First), _Get_unwrapped(_Last)); + _Off, _STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1469,7 +1469,7 @@ public: #if _ITERATOR_DEBUG_LEVEL == 2 _STL_VERIFY(_First <= _Last && begin() <= _First && _Last <= end(), "deque erase iterator outside range"); - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); auto _Off = static_cast(_First - begin()); auto _Count = static_cast(_Last - _First); diff --git a/stl/inc/forward_list b/stl/inc/forward_list index 7a5da3e152e..141d8f1d2a8 100644 --- a/stl/inc/forward_list +++ b/stl/inc/forward_list @@ -595,18 +595,18 @@ public: template , int> = 0> forward_list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t{}) { - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); _Flist_insert_after_op2<_Alnode> _Insert_op(_Getal()); - _Insert_op._Append_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _Insert_op._Append_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); _Alloc_proxy(); _Insert_op._Attach_after(_Mypair._Myval2._Before_head()); } template , int> = 0> forward_list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) { - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); _Flist_insert_after_op2<_Alnode> _Insert_op(_Getal()); - _Insert_op._Append_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _Insert_op._Append_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); _Alloc_proxy(); _Insert_op._Attach_after(_Mypair._Myval2._Before_head()); } @@ -960,8 +960,8 @@ private: public: template , int> = 0> void assign(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - _Assign_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Assign_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1022,8 +1022,8 @@ public: _STL_VERIFY( _Where._Getcont() == _STD addressof(_Mypair._Myval2), "forward_list insert_after location incompatible"); #endif // _ITERATOR_DEBUG_LEVEL == 2 - _Adl_verify_range(_First, _Last); - return _Insert_range_after(_Where._Ptr, _Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + return _Insert_range_after(_Where._Ptr, _STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1275,12 +1275,12 @@ public: template void merge(forward_list& _Right, _Pr2 _Pred) { // merge in elements from _Right, both ordered by _Pred - _Merge1(_Right, _Pass_fn(_Pred)); + _Merge1(_Right, _STD _Pass_fn(_Pred)); } template void merge(forward_list&& _Right, _Pr2 _Pred) { // merge in elements from _Right, both ordered by _Pred - _Merge1(_Right, _Pass_fn(_Pred)); + _Merge1(_Right, _STD _Pass_fn(_Pred)); } private: @@ -1397,7 +1397,7 @@ public: template void sort(_Pr2 _Pred) { // order sequence - _Scary_val::_Sort(_Mypair._Myval2._Before_head(), _Pass_fn(_Pred)); + _Scary_val::_Sort(_Mypair._Myval2._Before_head(), _STD _Pass_fn(_Pred)); } void reverse() noexcept { // reverse sequence diff --git a/stl/inc/list b/stl/inc/list index 30a30caedfa..74c0902b050 100644 --- a/stl/inc/list +++ b/stl/inc/list @@ -876,14 +876,14 @@ public: template , int> = 0> list(_Iter _First, _Iter _Last) : _Mypair(_Zero_then_variadic_args_t{}) { - _Adl_verify_range(_First, _Last); - _Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Construct_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } template , int> = 0> list(_Iter _First, _Iter _Last, const _Alloc& _Al) : _Mypair(_One_then_variadic_args_t{}, _Al) { - _Adl_verify_range(_First, _Last); - _Construct_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Construct_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1334,8 +1334,8 @@ private: public: template , int> = 0> void assign(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - _Assign_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Assign_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 @@ -1391,9 +1391,9 @@ public: #if _ITERATOR_DEBUG_LEVEL == 2 _STL_VERIFY(_Where._Getcont() == _STD addressof(_Mypair._Myval2), "list insert iterator outside range"); #endif // _ITERATOR_DEBUG_LEVEL == 2 - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); _List_node_insert_op2<_Alnode> _Op(_Getal()); - _Op._Append_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _Op._Append_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); return _Make_iter(_Op._Attach_before(_Mypair._Myval2, _Where._Ptr)); } @@ -1431,7 +1431,7 @@ private: public: iterator erase(const const_iterator _First, const const_iterator _Last) noexcept /* strengthened */ { - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); return _Make_iter(_Unchecked_erase(_First._Ptr, _Last._Ptr)); } diff --git a/stl/inc/vector b/stl/inc/vector index e0010eef8b9..01293cec40a 100644 --- a/stl/inc/vector +++ b/stl/inc/vector @@ -622,17 +622,17 @@ public: template , int> = 0> _CONSTEXPR20 vector(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t{}, _Al) { - _Adl_verify_range(_First, _Last); - auto _UFirst = _Get_unwrapped(_First); - auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + auto _UFirst = _STD _Get_unwrapped(_First); + auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_cpp17_fwd_iter_v<_Iter>) { const auto _Length = static_cast(_STD distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Count = _STD _Convert_size(_Length); _Construct_n(_Count, _STD move(_UFirst), _STD move(_ULast)); #ifdef __cpp_lib_concepts } else if constexpr (forward_iterator<_Iter>) { - const auto _Length = _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Length = _STD _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); + const auto _Count = _STD _Convert_size(_Length); _Construct_n(_Count, _STD move(_UFirst), _STD move(_ULast)); #endif // defined(__cpp_lib_concepts) } else { @@ -1125,28 +1125,28 @@ private: const size_type _Newsize = _Oldsize + _Count; size_type _Newcapacity = _Calculate_growth(_Newsize); - const pointer _Newvec = _Allocate_at_least_helper(_Al, _Newcapacity); + const pointer _Newvec = _STD _Allocate_at_least_helper(_Al, _Newcapacity); const auto _Whereoff = static_cast(_Whereptr - _Oldfirst); const pointer _Constructed_last = _Newvec + _Whereoff + _Count; pointer _Constructed_first = _Constructed_last; _TRY_BEGIN - _Uninitialized_copy_n(_STD move(_First), _Count, _Newvec + _Whereoff, _Al); + _STD _Uninitialized_copy_n(_STD move(_First), _Count, _Newvec + _Whereoff, _Al); _Constructed_first = _Newvec + _Whereoff; if (_Count == 1 && _Whereptr == _Oldlast) { // one at back, provide strong guarantee if constexpr (is_nothrow_move_constructible_v<_Ty> || !is_copy_constructible_v<_Ty>) { - _Uninitialized_move(_Oldfirst, _Oldlast, _Newvec, _Al); + _STD _Uninitialized_move(_Oldfirst, _Oldlast, _Newvec, _Al); } else { - _Uninitialized_copy(_Oldfirst, _Oldlast, _Newvec, _Al); + _STD _Uninitialized_copy(_Oldfirst, _Oldlast, _Newvec, _Al); } } else { // provide basic guarantee - _Uninitialized_move(_Oldfirst, _Whereptr, _Newvec, _Al); + _STD _Uninitialized_move(_Oldfirst, _Whereptr, _Newvec, _Al); _Constructed_first = _Newvec; - _Uninitialized_move(_Whereptr, _Oldlast, _Newvec + _Whereoff + _Count, _Al); + _STD _Uninitialized_move(_Whereptr, _Oldlast, _Newvec + _Whereoff + _Count, _Al); } _CATCH_ALL - _Destroy_range(_Constructed_first, _Constructed_last, _Al); + _STD _Destroy_range(_Constructed_first, _Constructed_last, _Al); _Al.deallocate(_Newvec, _Newcapacity); _RERAISE; _CATCH_END @@ -1160,51 +1160,51 @@ private: _ASAN_VECTOR_EXTEND_GUARD(static_cast(_Oldlast - _Oldfirst) + _Count); if (_Count < _Affected_elements) { // some affected elements must be assigned - _Mylast = _Uninitialized_move(_Oldlast - _Count, _Oldlast, _Oldlast, _Al); - _Move_backward_unchecked(_Whereptr, _Oldlast - _Count, _Oldlast); - _Destroy_range(_Whereptr, _Whereptr + _Count, _Al); + _Mylast = _STD _Uninitialized_move(_Oldlast - _Count, _Oldlast, _Oldlast, _Al); + _STD _Move_backward_unchecked(_Whereptr, _Oldlast - _Count, _Oldlast); + _STD _Destroy_range(_Whereptr, _Whereptr + _Count, _Al); _TRY_BEGIN - _Uninitialized_copy_n(_STD move(_First), _Count, _Whereptr, _Al); + _STD _Uninitialized_copy_n(_STD move(_First), _Count, _Whereptr, _Al); _CATCH_ALL // glue the broken pieces back together _TRY_BEGIN - _Uninitialized_move(_Whereptr + _Count, _Whereptr + 2 * _Count, _Whereptr, _Al); + _STD _Uninitialized_move(_Whereptr + _Count, _Whereptr + 2 * _Count, _Whereptr, _Al); _CATCH_ALL // vaporize the detached piece _Orphan_range(_Whereptr, _Oldlast); - _Destroy_range(_Whereptr + _Count, _Mylast, _Al); + _STD _Destroy_range(_Whereptr + _Count, _Mylast, _Al); _Mylast = _Whereptr; _RERAISE; _CATCH_END _STD _Move_unchecked(_Whereptr + 2 * _Count, _Mylast, _Whereptr + _Count); - _Destroy_range(_Oldlast, _Mylast, _Al); + _STD _Destroy_range(_Oldlast, _Mylast, _Al); _Mylast = _Oldlast; _RERAISE; _CATCH_END } else { // affected elements don't overlap before/after const pointer _Relocated = _Whereptr + _Count; - _Mylast = _Uninitialized_move(_Whereptr, _Oldlast, _Relocated, _Al); - _Destroy_range(_Whereptr, _Oldlast, _Al); + _Mylast = _STD _Uninitialized_move(_Whereptr, _Oldlast, _Relocated, _Al); + _STD _Destroy_range(_Whereptr, _Oldlast, _Al); _TRY_BEGIN - _Uninitialized_copy_n(_STD move(_First), _Count, _Whereptr, _Al); + _STD _Uninitialized_copy_n(_STD move(_First), _Count, _Whereptr, _Al); _CATCH_ALL // glue the broken pieces back together _TRY_BEGIN - _Uninitialized_move(_Relocated, _Mylast, _Whereptr, _Al); + _STD _Uninitialized_move(_Relocated, _Mylast, _Whereptr, _Al); _CATCH_ALL // vaporize the detached piece _Orphan_range(_Whereptr, _Oldlast); - _Destroy_range(_Relocated, _Mylast, _Al); + _STD _Destroy_range(_Relocated, _Mylast, _Al); _Mylast = _Whereptr; _RERAISE; _CATCH_END - _Destroy_range(_Relocated, _Mylast, _Al); + _STD _Destroy_range(_Relocated, _Mylast, _Al); _Mylast = _Oldlast; _RERAISE; _CATCH_END @@ -1227,17 +1227,17 @@ public: "vector insert iterator outside range"); #endif // _ITERATOR_DEBUG_LEVEL == 2 - _Adl_verify_range(_First, _Last); - auto _UFirst = _Get_unwrapped(_First); - auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + auto _UFirst = _STD _Get_unwrapped(_First); + auto _ULast = _STD _Get_unwrapped(_Last); const auto _Whereoff = static_cast(_Whereptr - _Oldfirst); if constexpr (_Is_cpp17_fwd_iter_v<_Iter>) { const auto _Length = static_cast(_STD distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Count = _STD _Convert_size(_Length); _Insert_counted_range(_Where, _UFirst, _Count); #ifdef __cpp_lib_concepts } else if constexpr (forward_iterator<_Iter>) { - const auto _Length = _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); + const auto _Length = _STD _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); const auto _Count = _Convert_size(_Length); _Insert_counted_range(_Where, _UFirst, _Count); #endif // defined(__cpp_lib_concepts) @@ -1388,11 +1388,11 @@ private: if (_Newsize > _Oldcapacity) { _Clear_and_reserve_geometric(_Newsize); if constexpr (_Nothrow_construct) { - _Mylast = _Uninitialized_copy_n(_STD move(_First), _Newsize, _Myfirst, _Al); + _Mylast = _STD _Uninitialized_copy_n(_STD move(_First), _Newsize, _Myfirst, _Al); _ASAN_VECTOR_CREATE; } else { _ASAN_VECTOR_CREATE_GUARD; - _Mylast = _Uninitialized_copy_n(_STD move(_First), _Newsize, _Myfirst, _Al); + _Mylast = _STD _Uninitialized_copy_n(_STD move(_First), _Newsize, _Myfirst, _Al); } return; } @@ -1419,16 +1419,16 @@ private: if constexpr (_Nothrow_construct) { _ASAN_VECTOR_MODIFY(static_cast(_Newsize - _Oldsize)); - _Mylast = _Uninitialized_copy_n(_STD move(_First), _Newsize - _Oldsize, _Mylast, _Al); + _Mylast = _STD _Uninitialized_copy_n(_STD move(_First), _Newsize - _Oldsize, _Mylast, _Al); } else { _ASAN_VECTOR_EXTEND_GUARD(_Newsize); - _Mylast = _Uninitialized_copy_n(_STD move(_First), _Newsize - _Oldsize, _Mylast, _Al); + _Mylast = _STD _Uninitialized_copy_n(_STD move(_First), _Newsize - _Oldsize, _Mylast, _Al); _ASAN_VECTOR_RELEASE_GUARD; } } else { const pointer _Newlast = _Myfirst + _Newsize; - _Copy_n_unchecked4(_STD move(_First), _Newsize, _Myfirst); - _Destroy_range(_Newlast, _Mylast, _Al); + _STD _Copy_n_unchecked4(_STD move(_First), _Newsize, _Myfirst); + _STD _Destroy_range(_Newlast, _Mylast, _Al); _ASAN_VECTOR_MODIFY(static_cast(_Newsize - _Oldsize)); _Mylast = _Newlast; } @@ -1437,17 +1437,17 @@ private: public: template , int> = 0> _CONSTEXPR20 void assign(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - auto _UFirst = _Get_unwrapped(_First); - auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + auto _UFirst = _STD _Get_unwrapped(_First); + auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_cpp17_fwd_iter_v<_Iter>) { const auto _Length = static_cast(_STD distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Count = _STD _Convert_size(_Length); _Assign_counted_range(_UFirst, _Count); #ifdef __cpp_lib_concepts } else if constexpr (forward_iterator<_Iter>) { - const auto _Length = _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Length = _STD _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); + const auto _Count = _STD _Convert_size(_Length); _Assign_counted_range(_UFirst, _Count); #endif // defined(__cpp_lib_concepts) } else { @@ -2070,12 +2070,12 @@ private: _Buy_nonzero(_Count); _Tidy_guard _Guard{this}; if constexpr (sizeof...(_Val) == 0) { - _My_data._Mylast = _Uninitialized_value_construct_n(_My_data._Myfirst, _Count, _Al); + _My_data._Mylast = _STD _Uninitialized_value_construct_n(_My_data._Myfirst, _Count, _Al); } else if constexpr (sizeof...(_Val) == 1) { _STL_INTERNAL_STATIC_ASSERT(is_same_v<_Valty..., const _Ty&>); - _My_data._Mylast = _Uninitialized_fill_n(_My_data._Myfirst, _Count, _Val..., _Al); + _My_data._Mylast = _STD _Uninitialized_fill_n(_My_data._Myfirst, _Count, _Val..., _Al); } else if constexpr (sizeof...(_Val) == 2) { - _My_data._Mylast = _Uninitialized_copy(_STD forward<_Valty>(_Val)..., _My_data._Myfirst, _Al); + _My_data._Mylast = _STD _Uninitialized_copy(_STD forward<_Valty>(_Val)..., _My_data._Myfirst, _Al); } else { static_assert(_Always_false<_Ty>, "Should be unreachable"); } @@ -3331,19 +3331,19 @@ public: template , int> = 0> _CONSTEXPR20 iterator insert(const_iterator _Where, _Iter _First, _Iter _Last) { const difference_type _Saved_offset = _Where - begin(); - _Adl_verify_range(_First, _Last); - auto _UFirst = _Get_unwrapped(_First); - const auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + auto _UFirst = _STD _Get_unwrapped(_First); + const auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_cpp17_fwd_iter_v<_Iter>) { const auto _Length = static_cast(_STD distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Count = _STD _Convert_size(_Length); const auto _Off = static_cast(_Insert_x(_Where, _Count)); _STD _Copy_unchecked(_UFirst, _ULast, begin() + _Off); #ifdef __cpp_lib_concepts } else if constexpr (forward_iterator<_Iter>) { - const auto _Length = _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Length = _STD _To_unsigned_like(_RANGES distance(_UFirst, _ULast)); + const auto _Count = _STD _Convert_size(_Length); const auto _Off = static_cast(_Insert_x(_Where, _Count)); _STD _Copy_unchecked(_UFirst, _ULast, begin() + _Off); #endif // defined(__cpp_lib_concepts) diff --git a/stl/inc/xhash b/stl/inc/xhash index 5a1fe9a406b..a2f8ded5e75 100644 --- a/stl/inc/xhash +++ b/stl/inc/xhash @@ -954,8 +954,8 @@ protected: public: template void insert(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - _Insert_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Insert_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 diff --git a/stl/inc/xmemory b/stl/inc/xmemory index 8e027db3e7e..7d709382ebd 100644 --- a/stl/inc/xmemory +++ b/stl/inc/xmemory @@ -1851,8 +1851,8 @@ _CONSTEXPR20 _Alloc_ptr_t<_Alloc> _Uninitialized_copy( #else // ^^^ defined(__cpp_lib_concepts) / !defined(__cpp_lib_concepts) vvv // In pre-concepts world, _Uninitialized_copy should only ever be called with an iterator // and sentinel of the same type, so `_Get_unwrapped` is fine to call. - auto _UFirst = _Get_unwrapped(_STD move(_First)); - auto _ULast = _Get_unwrapped(_STD move(_Last)); + auto _UFirst = _STD _Get_unwrapped(_STD move(_First)); + auto _ULast = _STD _Get_unwrapped(_STD move(_Last)); #endif // ^^^ !defined(__cpp_lib_concepts) ^^^ constexpr bool _Can_memmove = _Sent_copy_cat::_Bitcopy_constructible @@ -1864,11 +1864,11 @@ _CONSTEXPR20 _Alloc_ptr_t<_Alloc> _Uninitialized_copy( #endif // _HAS_CXX20 { if constexpr (is_same_v) { - _Copy_memmove(_To_address(_UFirst), _To_address(_ULast), _Unfancy(_Dest)); + _STD _Copy_memmove(_STD _To_address(_UFirst), _STD _To_address(_ULast), _STD _Unfancy(_Dest)); _Dest += _ULast - _UFirst; } else { const auto _Count = static_cast(_ULast - _UFirst); - _Copy_memmove_n(_To_address(_UFirst), _Count, _Unfancy(_Dest)); + _STD _Copy_memmove_n(_STD _To_address(_UFirst), _Count, _STD _Unfancy(_Dest)); _Dest += _Count; } return _Dest; @@ -1890,7 +1890,7 @@ _CONSTEXPR20 _Alloc_ptr_t<_Alloc> _Uninitialized_copy_n( // note: only called internally from elsewhere in the STL using _Ptrval = typename _Alloc::value_type*; - auto _UFirst = _Get_unwrapped(_STD move(_First)); + auto _UFirst = _STD _Get_unwrapped(_STD move(_First)); constexpr bool _Can_memmove = conjunction_v::_Bitcopy_constructible>, @@ -1901,7 +1901,7 @@ _CONSTEXPR20 _Alloc_ptr_t<_Alloc> _Uninitialized_copy_n( if (!_STD is_constant_evaluated()) #endif // _HAS_CXX20 { - _Copy_memmove_n(_UFirst, _Count, _Unfancy(_Dest)); + _STD _Copy_memmove_n(_UFirst, _Count, _STD _Unfancy(_Dest)); _Dest += _Count; return _Dest; } diff --git a/stl/inc/xstring b/stl/inc/xstring index 034315462ac..c34ee4fd0ec 100644 --- a/stl/inc/xstring +++ b/stl/inc/xstring @@ -2588,18 +2588,18 @@ public: template , int> = 0> _CONSTEXPR20 basic_string(_Iter _First, _Iter _Last, const _Alloc& _Al = _Alloc()) : _Mypair(_One_then_variadic_args_t{}, _Al) { - _Adl_verify_range(_First, _Last); - auto _UFirst = _Get_unwrapped(_First); - auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + auto _UFirst = _STD _Get_unwrapped(_First); + auto _ULast = _STD _Get_unwrapped(_Last); if (_UFirst == _ULast) { _Construct_empty(); } else { if constexpr (_Is_elem_cptr::value) { _Construct<_Construct_strategy::_From_ptr>( - _UFirst, _Convert_size(static_cast(_ULast - _UFirst))); + _UFirst, _STD _Convert_size(static_cast(_ULast - _UFirst))); } else if constexpr (_Is_cpp17_fwd_iter_v) { const auto _Length = static_cast(_STD distance(_UFirst, _ULast)); - const auto _Count = _Convert_size(_Length); + const auto _Count = _STD _Convert_size(_Length); _Construct_from_iter(_STD move(_UFirst), _STD move(_ULast), _Count); } else { _Construct_from_iter(_STD move(_UFirst), _STD move(_ULast)); @@ -3167,7 +3167,7 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, const initializer_list<_Elem> _Ilist) { // replace with initializer_list - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3357,11 +3357,11 @@ public: template , int> = 0> _CONSTEXPR20 basic_string& append(const _Iter _First, const _Iter _Last) { // append [_First, _Last), input iterators - _Adl_verify_range(_First, _Last); - const auto _UFirst = _Get_unwrapped(_First); - const auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + const auto _UFirst = _STD _Get_unwrapped(_First); + const auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_elem_cptr::value) { - return append(_UFirst, _Convert_size(static_cast(_ULast - _UFirst))); + return append(_UFirst, _STD _Convert_size(static_cast(_ULast - _UFirst))); } else { const basic_string _Right(_UFirst, _ULast, get_allocator()); return append(_Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); @@ -3457,11 +3457,11 @@ public: template , int> = 0> _CONSTEXPR20 basic_string& assign(const _Iter _First, const _Iter _Last) { - _Adl_verify_range(_First, _Last); - const auto _UFirst = _Get_unwrapped(_First); - const auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + const auto _UFirst = _STD _Get_unwrapped(_First); + const auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_elem_cptr::value) { - return assign(_UFirst, _Convert_size(static_cast(_ULast - _UFirst))); + return assign(_UFirst, _STD _Convert_size(static_cast(_ULast - _UFirst))); } else { basic_string _Right(_UFirst, _ULast, get_allocator()); if (_Mypair._Myval2._Myres < _Right._Mypair._Myval2._Myres) { @@ -3630,11 +3630,11 @@ public: _STL_VERIFY(_Where._Getcont() == _STD addressof(_Mypair._Myval2), "string iterator incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 const auto _Off = static_cast(_Unfancy(_Where._Ptr) - _Mypair._Myval2._Myptr()); - _Adl_verify_range(_First, _Last); - const auto _UFirst = _Get_unwrapped(_First); - const auto _ULast = _Get_unwrapped(_Last); + _STD _Adl_verify_range(_First, _Last); + const auto _UFirst = _STD _Get_unwrapped(_First); + const auto _ULast = _STD _Get_unwrapped(_Last); if constexpr (_Is_elem_cptr::value) { - insert(_Off, _UFirst, _Convert_size(static_cast(_ULast - _UFirst))); + insert(_Off, _UFirst, _STD _Convert_size(static_cast(_ULast - _UFirst))); } else { const basic_string _Right(_UFirst, _ULast, get_allocator()); insert(_Off, _Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); @@ -3700,7 +3700,7 @@ public: _CONSTEXPR20 iterator erase(const const_iterator _First, const const_iterator _Last) noexcept /* strengthened */ { - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3858,7 +3858,7 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, const basic_string& _Right) { // replace [_First, _Last) with _Right - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3871,7 +3871,7 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, const _StringViewIsh& _Right) { // replace [_First, _Last) with _Right - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3883,7 +3883,7 @@ public: _CONSTEXPR20 basic_string& replace(const const_iterator _First, const const_iterator _Last, _In_reads_(_Count) const _Elem* const _Ptr, const size_type _Count) { // replace [_First, _Last) with [_Ptr, _Ptr + _Count) - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3894,7 +3894,7 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, _In_z_ const _Elem* const _Ptr) { // replace [_First, _Last) with [_Ptr, ) - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3905,7 +3905,7 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, const size_type _Count, const _Elem _Ch) { // replace [_First, _Last) with _Count * _Ch - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 @@ -3917,17 +3917,18 @@ public: _CONSTEXPR20 basic_string& replace( const const_iterator _First, const const_iterator _Last, const _Iter _First2, const _Iter _Last2) { // replace [_First, _Last) with [_First2, _Last2), input iterators - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 - const auto _Off = static_cast(_Unfancy(_First._Ptr) - _Mypair._Myval2._Myptr()); + const auto _Off = static_cast(_STD _Unfancy(_First._Ptr) - _Mypair._Myval2._Myptr()); const auto _Length = static_cast(_Last._Ptr - _First._Ptr); - _Adl_verify_range(_First2, _Last2); - const auto _UFirst2 = _Get_unwrapped(_First2); - const auto _ULast2 = _Get_unwrapped(_Last2); + _STD _Adl_verify_range(_First2, _Last2); + const auto _UFirst2 = _STD _Get_unwrapped(_First2); + const auto _ULast2 = _STD _Get_unwrapped(_Last2); if constexpr (_Is_elem_cptr::value) { - return replace(_Off, _Length, _UFirst2, _Convert_size(static_cast(_ULast2 - _UFirst2))); + return replace( + _Off, _Length, _UFirst2, _STD _Convert_size(static_cast(_ULast2 - _UFirst2))); } else { const basic_string _Right(_UFirst2, _ULast2, get_allocator()); return replace(_Off, _Length, _Right._Mypair._Myval2._Myptr(), _Right._Mypair._Myval2._Mysize); @@ -3937,7 +3938,7 @@ public: #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 template <_Container_compatible_range<_Elem> _Rng> constexpr basic_string& replace_with_range(const const_iterator _First, const const_iterator _Last, _Rng&& _Range) { - _Adl_verify_range(_First, _Last); + _STD _Adl_verify_range(_First, _Last); #if _ITERATOR_DEBUG_LEVEL != 0 _STL_VERIFY(_First._Getcont() == _STD addressof(_Mypair._Myval2), "string iterators incompatible"); #endif // _ITERATOR_DEBUG_LEVEL != 0 diff --git a/stl/inc/xtree b/stl/inc/xtree index 099401a97dd..ce5f7eabf9a 100644 --- a/stl/inc/xtree +++ b/stl/inc/xtree @@ -1256,8 +1256,8 @@ protected: public: template void insert(_Iter _First, _Iter _Last) { - _Adl_verify_range(_First, _Last); - _Insert_range_unchecked(_Get_unwrapped(_First), _Get_unwrapped(_Last)); + _STD _Adl_verify_range(_First, _Last); + _Insert_range_unchecked(_STD _Get_unwrapped(_First), _STD _Get_unwrapped(_Last)); } #if _HAS_CXX23 && defined(__cpp_lib_concepts) // TRANSITION, GH-395 diff --git a/tests/libcxx/expected_results.txt b/tests/libcxx/expected_results.txt index 66a43575fd1..11217855f72 100644 --- a/tests/libcxx/expected_results.txt +++ b/tests/libcxx/expected_results.txt @@ -504,7 +504,6 @@ std/language.support/cmp/cmp.alg/weak_order.pass.cpp FAIL # GH-1596: : unqualified calls to _Adl_verify_range incorrectly cause instantiation std/algorithms/robust_against_adl.compile.pass.cpp FAIL -std/strings/basic.string/string.modifiers/robust_against_adl.pass.cpp FAIL # GH-3100: etc.: ADL should be avoided when calling _Construct_in_place and its friends std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cpp FAIL diff --git a/tests/std/tests/VSO_0000000_instantiate_containers/test.compile.pass.cpp b/tests/std/tests/VSO_0000000_instantiate_containers/test.compile.pass.cpp index cde888b9623..303c44dace3 100644 --- a/tests/std/tests/VSO_0000000_instantiate_containers/test.compile.pass.cpp +++ b/tests/std/tests/VSO_0000000_instantiate_containers/test.compile.pass.cpp @@ -77,6 +77,22 @@ struct tagged_falsity { } }; +template +struct tagged_less { + template + bool operator()(const U& u, const V& v) const { + return u < v; + } +}; + +template +struct tagged_converter { + template || !is_convertible_v, int> = 0> + operator T() const { + return T{}; + } +}; + template struct holder { T t; @@ -84,7 +100,9 @@ struct holder { struct incomplete; -using validating_falsity = tagged_falsity>; +using validating_falsity = tagged_falsity>; +using validating_less = tagged_less>; +using validating_converter = tagged_converter>; #endif // _M_CEE template @@ -152,9 +170,14 @@ template void construct_from_iterators_test(T value) { auto containers = get_all_iterator_types_for(value); - for_each_tuple_element(containers, [](auto c) { + for_each_tuple_element(containers, [&](auto c) { T another(begin(c), end(c)); - T another2(begin(c), end(c)); + T another2(begin(c), end(c), value.get_allocator()); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + T another_no_adl(+arr, +arr); + T another_no_adl2(+arr, +arr, value.get_allocator()); +#endif // _M_CEE }); } @@ -166,6 +189,12 @@ void construct_tree_containers_from_iterators_test(T value) { T another(begin(c), end(c)); T another2(begin(c), end(c), value.key_comp()); T another3(begin(c), end(c), value.key_comp(), value.get_allocator()); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + T another_no_adl(+arr, +arr); + T another_no_adl2(+arr, +arr, value.key_comp()); + T another_no_adl3(+arr, +arr, value.key_comp(), value.get_allocator()); +#endif // _M_CEE }); } @@ -180,6 +209,15 @@ void construct_hash_containers_from_iterators_test(T value) { T another4(begin(c), end(c), value.bucket_count(), value.hash_function(), value.key_eq()); T another5( begin(c), end(c), value.bucket_count(), value.hash_function(), value.key_eq(), value.get_allocator()); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + T another_no_adl(+arr, +arr); + T another_no_adl2(+arr, +arr, value.bucket_count()); + T another_no_adl3(+arr, +arr, value.bucket_count(), value.hash_function()); + T another_no_adl4(+arr, +arr, value.bucket_count(), value.hash_function(), value.key_eq()); + T another_no_adl5( + +arr, +arr, value.bucket_count(), value.hash_function(), value.key_eq(), value.get_allocator()); +#endif // _M_CEE }); } @@ -226,12 +264,20 @@ template void assign_test(T value) { T another{}; another.assign(begin(value), end(value)); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + another.assign(+arr, +arr); +#endif // _M_CEE } template void insert_with_iterator_test(T value) { T another{}; another.insert(begin(value), end(value)); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + another.insert(+arr, +arr); +#endif // _M_CEE } template @@ -261,6 +307,10 @@ template void insert_with_iterator_specific_location_test(T value) { T another{}; another.insert(cbegin(another), begin(value), end(value)); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + another.insert(cbegin(another), +arr, +arr); +#endif // _M_CEE } template @@ -281,6 +331,13 @@ void list_operation_test(T value) { value.merge(another, pr2); value.merge(move(another), pr2); value.sort(pr2); +#ifndef _M_CEE // TRANSITION, VSO-1659496 + value.remove_if(validating_falsity{}); + value.unique(validating_less{}); + value.merge(another, validating_less{}); + value.merge(move(another), validating_less{}); + value.sort(validating_less{}); +#endif // _M_CEE } template @@ -399,6 +456,11 @@ void forward_list_test() { list_operation_test(value); erase_if_test(value); erase_test(value); + +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + another.insert_after(cbegin(another), +arr, +arr); +#endif // _M_CEE } // Note about hash*_test: @@ -623,6 +685,12 @@ void string_test_impl(const CharType* data) { erase_if_test(value); erase_test(value); + +#ifndef _M_CEE // TRANSITION, VSO-1659496 + validating_converter arr[1]{}; + another.append(+arr, +arr); + another.replace(cbegin(another), cend(another), +arr, +arr); +#endif // _M_CEE } void string_test() {