std::char_t...aits::move,(3)

πŸ“¦ version 2024.07.05, in nixpkgs unstable, opensuse-leap 16.0

🌸 NAME 🌸

okay so hiii bestie πŸ’– this page is from the C++ Standard Libary manual, and the header title is std::char_t...aits::move,(3) β€” yes, the title got a lil abbreviated, we’re keeping it cute and exact.

the NAME line literally reads:

std::char_traits::move,std::char_traits::move, -
std::char_traits::move,std::char_traits::move,

slay, no edits, no cap πŸ’…

πŸ¦‹ Synopsis πŸ¦‹

this is the whole signature vibe for std::char_traits<char32_t>::move, bestie:

                                    std::char_traits<char32_t>::move

          static char_type*
              move( char_type* dest, const char_type* src,
       (constexpr since C++20)
          std::size_t count );

it copies count characters from the character string pointed to by src to the character string pointed to by dest πŸ’–

and the iconic part? it performs correctly even if the ranges [src, src + count) and [dest, dest + count) overlap. overlap? not a problem, we ate πŸ”₯

see CharTraits for the general requirements on character traits for X::move.

🌸 Parameters 🌸

  • dest β€” pointer to a character string to copy to
  • src β€” pointer to a character string to copy from
  • count β€” the number of characters to copy

πŸ’– Return value πŸ’–

dest β€” that’s the return, bestie 🫢

πŸ™ˆ Exceptions πŸ™ˆ

throws nothing. literally nothing. silent treatment, but polite πŸ’€

πŸ”₯ Complexity πŸ”₯

linear in count. so yeah, it scales with how many characters you’re moving ✨

πŸŽ€ Defect reports πŸŽ€

the following behavior-changing defect reports were applied retroactively to previously published C++ standards:

  • LWG 7 β€” applied to C++98.
    • behavior as published: the copy was guaranteed to perform correctly if src is in [dest, dest + count), but not the other way round (i.e. dest is in [src, src + count)).
    • correct behavior: also guaranteed.

and that’s the page, bestie 🫢 β€” source/version/date sign-off: http://cppreference.com, 2024.06.10, footer title std::char_t...aits::move,(3). periodt πŸ’…

πŸ“¦ where this page comes from