Namespaces
Variants
Views
Actions

std::char_traits::assign

From cppreference.com
< cpp‎ | string‎ | char traits
Revision as of 23:53, 24 February 2013 by 2hertz (Talk | contribs)

Template:ddcl list begin <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
static void assign( char_type& r, const char_type& a );
</td>

<td > (1) </td> <td > (until C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
static void assign( char_type& r, const char_type& a ) noexcept;
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
static char_type* assign( char_type* p, std::size_t count, char_type a );
</td>

<td > (2) </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

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.

Contents

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

Exceptions

1)
noexcept specification:  
noexcept
  
2) (none)

Complexity

1) Constant.
2) Linear in count