std::char_traits<CharT>::assign (3) - Linux Man Pages

std::char_traits<CharT>::assign: std::char_traits<CharT>::assign

NAME

std::char_traits<CharT>::assign - std::char_traits<CharT>::assign

Synopsis


static void assign( char_type& r, const char_type& a ); (until C++11)
static void assign( char_type& r, const char_type& a ) noexcept; (since C++11)
                                                                                   (until C++17)
static constexpr void assign( char_type& r, const char_type& a ) noexcept; (1) (since C++17)
static char_type* assign( char_type* p, std::size_t count, char_type a ); (until C++20)
static constexpr char_type* assign( char_type* p, (2) (since C++20)
std::size_t count, char_type a );


Assigns a character.
1) Assigns character a to character r.
2) Assigns character a to each character in count characters in the character sequence pointed to by p.

Parameters


a - character value to assign
r - character to assign to
p - pointer to a character sequence to assign to
count - the length of the character sequence

Return value


1) (none)
2) p

Complexity


1) Constant.
2) Linear in count