std::char_t...ts::assign,(3)

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

πŸ’– std::char_traits::assign πŸ’–

okay bestie, we're in the C++ Standard Libary section of the manual, and this page is all about std::char_traits::assign β€” the assignment bestie of character traits ✨ No cap, it's a short one, but we're still gonna give every deet its moment.


πŸŽ€ NAME πŸŽ€

std::char_traits::assign,std::char_traits::assign, - std::char_traits::assign,std::char_traits::assign,

✨ Synopsis ✨

Here's the whole signature situation, copied exactly so nobody comes for me:

                                   std::char_traits<char32_t>::assign

          static void assign( char_type& c1, const char_type& c2   (1)
       (noexcept since C++11)
          );
       (constexpr since C++17)
          static char_type* assign( char_type* ptr, std::size_t    (2)
       (constexpr since C++20)
          count, char_type c2 );

1) Drops c2 into c1 β€” behavior is identical to c1 = c2, fr.

2) Drops c2 into each character in count characters in the character sequence pointed to by ptr. Like, every single one, bestie.

See CharTraits for the general requirements on character traits for X::assign.

🌸 Parameters 🌸

  • c1 β€” the character to assign to.
  • c2 β€” the character value to assign.
  • ptr β€” pointer to a character sequence to assign to.
  • count β€” the length of the character sequence.

🫢 Return value 🫢

  • 1) (none) β€” literally no return value, just vibes.
  • 2) ptr β€” the same pointer comes back to you.

πŸ”₯ Complexity πŸ”₯

  • 1) Constant.
  • 2) Linear in count.

Footer check, bestie: the source/version is http://cppreference.com, the date is 2024.06.10, and the footer label is std::char_t...ts::assign,(3). That's the whole sign-off, mwah πŸ’‹βœ¨

πŸ“¦ where this page comes from