libstdc++
GNU C++ library
Loading...
Searching...
No Matches

◆ _S_copy_chars() [2/6]

template<typename _CharT, typename _Traits, typename _Alloc>
template<class _Iterator>
constexpr void std::basic_string< _CharT, _Traits, _Alloc >::_S_copy_chars ( _CharT * __p,
_Iterator __k1,
_Iterator __k2 )
inlinestaticconstexprprivate

Definition at line 487 of file basic_string.h.

488 {
489#if __cplusplus >= 201103L
490 using _IterBase = decltype(std::__niter_base(__k1));
494#if __cpp_lib_concepts
495 else if constexpr (requires {
499 })
500 {
501 const auto __d = __k2 - __k1;
502 (void) (__k1 + __d); // See P3349R1
503 _S_copy(__p, std::to_address(__k1), static_cast<size_type>(__d));
504 }
505#endif
506 else
507#endif
508 for (; __k1 != __k2; ++__k1, (void)++__p)
509 traits_type::assign(*__p, static_cast<_CharT>(*__k1));
510 }
constexpr _Tp * to_address(_Tp *__ptr) noexcept
Obtain address referenced by a pointer to an object.
Definition ptr_traits.h:232
constexpr decltype(std::__niter_base(std::declval< _Ite >())) __niter_base(const ::__gnu_debug::_Safe_iterator< _Ite, _Seq, std::random_access_iterator_tag > &__it) noexcept(std::is_nothrow_copy_constructible< _Ite >::value)
_Alloc_traits::size_type size_type
static constexpr void _S_copy(_CharT *__d, const _CharT *__s, size_type __n)
Managing sequences of characters and character-like objects.

Referenced by std::basic_string< _CharT >::_S_copy_chars(), and std::basic_string< _CharT >::_S_copy_chars().

Here is the caller graph for this function: