From Jason Turner

[string::assign]

Diff to HTML by rtfpessoa

Files changed (1) hide show
  1. tmp/tmpjmnw7peg/{from.md → to.md} +0 -85
tmp/tmpjmnw7peg/{from.md → to.md} RENAMED
@@ -1,85 +0,0 @@
1
- #### `basic_string::assign` <a id="string::assign">[[string::assign]]</a>
2
-
3
- ``` cpp
4
- basic_string& assign(const basic_string& str);
5
- ```
6
-
7
- *Effects:* Equivalent to `assign(str, 0, npos)`.
8
-
9
- *Returns:* `*this`.
10
-
11
- ``` cpp
12
- basic_string& assign(basic_string&& str) noexcept;
13
- ```
14
-
15
- *Effects:* The function replaces the string controlled by `*this` with a
16
- string of length `str.size()` whose elements are a copy of the string
17
- controlled by `str`. A valid implementation is `swap(str)`.
18
-
19
- *Returns:* `*this`.
20
-
21
- ``` cpp
22
- basic_string&
23
- assign(const basic_string& str, size_type pos,
24
- size_type n = npos);
25
- ```
26
-
27
- *Requires:* `pos <= str.size()`
28
-
29
- *Throws:* `out_of_range` if `pos > str.size()`.
30
-
31
- *Effects:* Determines the effective length `rlen` of the string to
32
- assign as the smaller of `n` and `str``.size() - ``pos` and calls
33
- `assign(str.data() + pos rlen)`.
34
-
35
- *Returns:* `*this`.
36
-
37
- ``` cpp
38
- basic_string& assign(const charT* s, size_type n);
39
- ```
40
-
41
- *Requires:* `s` points to an array of at least `n` elements of `charT`.
42
-
43
- *Throws:* `length_error` if `n > max_size()`.
44
-
45
- *Effects:* Replaces the string controlled by `*this` with a string of
46
- length `n` whose elements are a copy of those pointed to by `s`.
47
-
48
- *Returns:* `*this`.
49
-
50
- ``` cpp
51
- basic_string& assign(const charT* s);
52
- ```
53
-
54
- *Requires:* `s` points to an array of at least `traits::length(s) + 1`
55
- elements of `charT`.
56
-
57
- *Effects:* Calls `assign(s, traits::length(s))`.
58
-
59
- *Returns:* `*this`.
60
-
61
- ``` cpp
62
- basic_string& assign(initializer_list<charT> il);
63
- ```
64
-
65
- *Effects:* Calls `assign(il.begin(), il.size())`.
66
-
67
- `*this`.
68
-
69
- ``` cpp
70
- basic_string& assign(size_type n, charT c);
71
- ```
72
-
73
- *Effects:* Equivalent to `assign(basic_string(n, c))`.
74
-
75
- *Returns:* `*this`.
76
-
77
- ``` cpp
78
- template<class InputIterator>
79
- basic_string& assign(InputIterator first, InputIterator last);
80
- ```
81
-
82
- *Effects:* Equivalent to `assign(basic_string(first, last))`.
83
-
84
- *Returns:* `*this`.
85
-