Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      std::char_traits<char>::assign,std::char_traits<wchar_t>::assign,std::char_traits<char8_t>::assign,std::char_traits<char16_t>::assign,std::char_traits<char32_t>::assign

      From cppreference.com
      <cpp‎ |string‎ |char traits
       
       
       
       
      staticvoid 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 count, char_type c2);
      (2)(constexpr since C++20)
      1) Assignsc2 toc1, behaves identically toc1= c2.
      2) Assignsc2 to each character incount characters in the character sequence pointed to byptr.

      SeeCharTraits for the general requirements on character traits forX::assign.

      [edit]Parameters

      c1 - character to assign to
      c2 - character value to assign
      ptr - pointer to a character sequence to assign to
      count - the length of the character sequence

      [edit]Return value

      1) (none)
      2)ptr

      [edit]Complexity

      1) Constant.
      2) Linear incount.
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=cpp/string/char_traits/assign&oldid=171370"

      [8]ページ先頭

      ©2009-2025 Movatter.jp