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|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#### General <a id="basic.string.general">[[basic.string.general]]</a>
|
| 2 |
+
|
| 3 |
+
The class template `basic_string` describes objects that can store a
|
| 4 |
+
sequence consisting of a varying number of arbitrary char-like objects
|
| 5 |
+
with the first element of the sequence at position zero. Such a sequence
|
| 6 |
+
is also called a “string” if the type of the char-like objects that it
|
| 7 |
+
holds is clear from context. In the rest of [[basic.string]], the type
|
| 8 |
+
of the char-like objects held in a `basic_string` object is designated
|
| 9 |
+
by `charT`.
|
| 10 |
+
|
| 11 |
+
A specialization of `basic_string` is a contiguous container
|
| 12 |
+
[[container.reqmts]].
|
| 13 |
+
|
| 14 |
+
In all cases, \[`data()`, `data() + size()`\] is a valid range,
|
| 15 |
+
`data() + size()` points at an object with value `charT()` (a “null
|
| 16 |
+
terminator”), and `size() <= capacity()` is `true`.
|
| 17 |
+
|
| 18 |
+
``` cpp
|
| 19 |
+
namespace std {
|
| 20 |
+
template<class charT, class traits = char_traits<charT>,
|
| 21 |
+
class Allocator = allocator<charT>>
|
| 22 |
+
class basic_string {
|
| 23 |
+
public:
|
| 24 |
+
// types
|
| 25 |
+
using traits_type = traits;
|
| 26 |
+
using value_type = charT;
|
| 27 |
+
using allocator_type = Allocator;
|
| 28 |
+
using size_type = typename allocator_traits<Allocator>::size_type;
|
| 29 |
+
using difference_type = typename allocator_traits<Allocator>::difference_type;
|
| 30 |
+
using pointer = typename allocator_traits<Allocator>::pointer;
|
| 31 |
+
using const_pointer = typename allocator_traits<Allocator>::const_pointer;
|
| 32 |
+
using reference = value_type&;
|
| 33 |
+
using const_reference = const value_type&;
|
| 34 |
+
|
| 35 |
+
using iterator = implementation-defined // type of basic_string::iterator; // see [container.requirements]
|
| 36 |
+
using const_iterator = implementation-defined // type of basic_string::const_iterator; // see [container.requirements]
|
| 37 |
+
using reverse_iterator = std::reverse_iterator<iterator>;
|
| 38 |
+
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
|
| 39 |
+
static constexpr size_type npos = size_type(-1);
|
| 40 |
+
|
| 41 |
+
// [string.cons], construct/copy/destroy
|
| 42 |
+
constexpr basic_string() noexcept(noexcept(Allocator())) : basic_string(Allocator()) { }
|
| 43 |
+
constexpr explicit basic_string(const Allocator& a) noexcept;
|
| 44 |
+
constexpr basic_string(const basic_string& str);
|
| 45 |
+
constexpr basic_string(basic_string&& str) noexcept;
|
| 46 |
+
constexpr basic_string(const basic_string& str, size_type pos,
|
| 47 |
+
const Allocator& a = Allocator());
|
| 48 |
+
constexpr basic_string(const basic_string& str, size_type pos, size_type n,
|
| 49 |
+
const Allocator& a = Allocator());
|
| 50 |
+
constexpr basic_string(basic_string&& str, size_type pos,
|
| 51 |
+
const Allocator& a = Allocator());
|
| 52 |
+
constexpr basic_string(basic_string&& str, size_type pos, size_type n,
|
| 53 |
+
const Allocator& a = Allocator());
|
| 54 |
+
template<class T>
|
| 55 |
+
constexpr basic_string(const T& t, size_type pos, size_type n,
|
| 56 |
+
const Allocator& a = Allocator());
|
| 57 |
+
template<class T>
|
| 58 |
+
constexpr explicit basic_string(const T& t, const Allocator& a = Allocator());
|
| 59 |
+
constexpr basic_string(const charT* s, size_type n, const Allocator& a = Allocator());
|
| 60 |
+
constexpr basic_string(const charT* s, const Allocator& a = Allocator());
|
| 61 |
+
basic_string(nullptr_t) = delete;
|
| 62 |
+
constexpr basic_string(size_type n, charT c, const Allocator& a = Allocator());
|
| 63 |
+
template<class InputIterator>
|
| 64 |
+
constexpr basic_string(InputIterator begin, InputIterator end,
|
| 65 |
+
const Allocator& a = Allocator());
|
| 66 |
+
template<container-compatible-range<charT> R>
|
| 67 |
+
constexpr basic_string(from_range_t, R&& rg, const Allocator& a = Allocator());
|
| 68 |
+
constexpr basic_string(initializer_list<charT>, const Allocator& = Allocator());
|
| 69 |
+
constexpr basic_string(const basic_string&, const Allocator&);
|
| 70 |
+
constexpr basic_string(basic_string&&, const Allocator&);
|
| 71 |
+
constexpr ~basic_string();
|
| 72 |
+
|
| 73 |
+
constexpr basic_string& operator=(const basic_string& str);
|
| 74 |
+
constexpr basic_string& operator=(basic_string&& str)
|
| 75 |
+
noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
|
| 76 |
+
allocator_traits<Allocator>::is_always_equal::value);
|
| 77 |
+
template<class T>
|
| 78 |
+
constexpr basic_string& operator=(const T& t);
|
| 79 |
+
constexpr basic_string& operator=(const charT* s);
|
| 80 |
+
basic_string& operator=(nullptr_t) = delete;
|
| 81 |
+
constexpr basic_string& operator=(charT c);
|
| 82 |
+
constexpr basic_string& operator=(initializer_list<charT>);
|
| 83 |
+
|
| 84 |
+
// [string.iterators], iterators
|
| 85 |
+
constexpr iterator begin() noexcept;
|
| 86 |
+
constexpr const_iterator begin() const noexcept;
|
| 87 |
+
constexpr iterator end() noexcept;
|
| 88 |
+
constexpr const_iterator end() const noexcept;
|
| 89 |
+
|
| 90 |
+
constexpr reverse_iterator rbegin() noexcept;
|
| 91 |
+
constexpr const_reverse_iterator rbegin() const noexcept;
|
| 92 |
+
constexpr reverse_iterator rend() noexcept;
|
| 93 |
+
constexpr const_reverse_iterator rend() const noexcept;
|
| 94 |
+
|
| 95 |
+
constexpr const_iterator cbegin() const noexcept;
|
| 96 |
+
constexpr const_iterator cend() const noexcept;
|
| 97 |
+
constexpr const_reverse_iterator crbegin() const noexcept;
|
| 98 |
+
constexpr const_reverse_iterator crend() const noexcept;
|
| 99 |
+
|
| 100 |
+
// [string.capacity], capacity
|
| 101 |
+
constexpr size_type size() const noexcept;
|
| 102 |
+
constexpr size_type length() const noexcept;
|
| 103 |
+
constexpr size_type max_size() const noexcept;
|
| 104 |
+
constexpr void resize(size_type n, charT c);
|
| 105 |
+
constexpr void resize(size_type n);
|
| 106 |
+
template<class Operation> constexpr void resize_and_overwrite(size_type n, Operation op);
|
| 107 |
+
constexpr size_type capacity() const noexcept;
|
| 108 |
+
constexpr void reserve(size_type res_arg);
|
| 109 |
+
constexpr void shrink_to_fit();
|
| 110 |
+
constexpr void clear() noexcept;
|
| 111 |
+
[[nodiscard]] constexpr bool empty() const noexcept;
|
| 112 |
+
|
| 113 |
+
// [string.access], element access
|
| 114 |
+
constexpr const_reference operator[](size_type pos) const;
|
| 115 |
+
constexpr reference operator[](size_type pos);
|
| 116 |
+
constexpr const_reference at(size_type n) const;
|
| 117 |
+
constexpr reference at(size_type n);
|
| 118 |
+
|
| 119 |
+
constexpr const charT& front() const;
|
| 120 |
+
constexpr charT& front();
|
| 121 |
+
constexpr const charT& back() const;
|
| 122 |
+
constexpr charT& back();
|
| 123 |
+
|
| 124 |
+
// [string.modifiers], modifiers
|
| 125 |
+
constexpr basic_string& operator+=(const basic_string& str);
|
| 126 |
+
template<class T>
|
| 127 |
+
constexpr basic_string& operator+=(const T& t);
|
| 128 |
+
constexpr basic_string& operator+=(const charT* s);
|
| 129 |
+
constexpr basic_string& operator+=(charT c);
|
| 130 |
+
constexpr basic_string& operator+=(initializer_list<charT>);
|
| 131 |
+
constexpr basic_string& append(const basic_string& str);
|
| 132 |
+
constexpr basic_string& append(const basic_string& str, size_type pos, size_type n = npos);
|
| 133 |
+
template<class T>
|
| 134 |
+
constexpr basic_string& append(const T& t);
|
| 135 |
+
template<class T>
|
| 136 |
+
constexpr basic_string& append(const T& t, size_type pos, size_type n = npos);
|
| 137 |
+
constexpr basic_string& append(const charT* s, size_type n);
|
| 138 |
+
constexpr basic_string& append(const charT* s);
|
| 139 |
+
constexpr basic_string& append(size_type n, charT c);
|
| 140 |
+
template<class InputIterator>
|
| 141 |
+
constexpr basic_string& append(InputIterator first, InputIterator last);
|
| 142 |
+
template<container-compatible-range<charT> R>
|
| 143 |
+
constexpr basic_string& append_range(R&& rg);
|
| 144 |
+
constexpr basic_string& append(initializer_list<charT>);
|
| 145 |
+
|
| 146 |
+
constexpr void push_back(charT c);
|
| 147 |
+
|
| 148 |
+
constexpr basic_string& assign(const basic_string& str);
|
| 149 |
+
constexpr basic_string& assign(basic_string&& str)
|
| 150 |
+
noexcept(allocator_traits<Allocator>::propagate_on_container_move_assignment::value ||
|
| 151 |
+
allocator_traits<Allocator>::is_always_equal::value);
|
| 152 |
+
constexpr basic_string& assign(const basic_string& str, size_type pos, size_type n = npos);
|
| 153 |
+
template<class T>
|
| 154 |
+
constexpr basic_string& assign(const T& t);
|
| 155 |
+
template<class T>
|
| 156 |
+
constexpr basic_string& assign(const T& t, size_type pos, size_type n = npos);
|
| 157 |
+
constexpr basic_string& assign(const charT* s, size_type n);
|
| 158 |
+
constexpr basic_string& assign(const charT* s);
|
| 159 |
+
constexpr basic_string& assign(size_type n, charT c);
|
| 160 |
+
template<class InputIterator>
|
| 161 |
+
constexpr basic_string& assign(InputIterator first, InputIterator last);
|
| 162 |
+
template<container-compatible-range<charT> R>
|
| 163 |
+
constexpr basic_string& assign_range(R&& rg);
|
| 164 |
+
constexpr basic_string& assign(initializer_list<charT>);
|
| 165 |
+
|
| 166 |
+
constexpr basic_string& insert(size_type pos, const basic_string& str);
|
| 167 |
+
constexpr basic_string& insert(size_type pos1, const basic_string& str,
|
| 168 |
+
size_type pos2, size_type n = npos);
|
| 169 |
+
template<class T>
|
| 170 |
+
constexpr basic_string& insert(size_type pos, const T& t);
|
| 171 |
+
template<class T>
|
| 172 |
+
constexpr basic_string& insert(size_type pos1, const T& t,
|
| 173 |
+
size_type pos2, size_type n = npos);
|
| 174 |
+
constexpr basic_string& insert(size_type pos, const charT* s, size_type n);
|
| 175 |
+
constexpr basic_string& insert(size_type pos, const charT* s);
|
| 176 |
+
constexpr basic_string& insert(size_type pos, size_type n, charT c);
|
| 177 |
+
constexpr iterator insert(const_iterator p, charT c);
|
| 178 |
+
constexpr iterator insert(const_iterator p, size_type n, charT c);
|
| 179 |
+
template<class InputIterator>
|
| 180 |
+
constexpr iterator insert(const_iterator p, InputIterator first, InputIterator last);
|
| 181 |
+
template<container-compatible-range<charT> R>
|
| 182 |
+
constexpr iterator insert_range(const_iterator p, R&& rg);
|
| 183 |
+
constexpr iterator insert(const_iterator p, initializer_list<charT>);
|
| 184 |
+
|
| 185 |
+
constexpr basic_string& erase(size_type pos = 0, size_type n = npos);
|
| 186 |
+
constexpr iterator erase(const_iterator p);
|
| 187 |
+
constexpr iterator erase(const_iterator first, const_iterator last);
|
| 188 |
+
|
| 189 |
+
constexpr void pop_back();
|
| 190 |
+
|
| 191 |
+
constexpr basic_string& replace(size_type pos1, size_type n1, const basic_string& str);
|
| 192 |
+
constexpr basic_string& replace(size_type pos1, size_type n1, const basic_string& str,
|
| 193 |
+
size_type pos2, size_type n2 = npos);
|
| 194 |
+
template<class T>
|
| 195 |
+
constexpr basic_string& replace(size_type pos1, size_type n1, const T& t);
|
| 196 |
+
template<class T>
|
| 197 |
+
constexpr basic_string& replace(size_type pos1, size_type n1, const T& t,
|
| 198 |
+
size_type pos2, size_type n2 = npos);
|
| 199 |
+
constexpr basic_string& replace(size_type pos, size_type n1, const charT* s, size_type n2);
|
| 200 |
+
constexpr basic_string& replace(size_type pos, size_type n1, const charT* s);
|
| 201 |
+
constexpr basic_string& replace(size_type pos, size_type n1, size_type n2, charT c);
|
| 202 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2,
|
| 203 |
+
const basic_string& str);
|
| 204 |
+
template<class T>
|
| 205 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2, const T& t);
|
| 206 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2, const charT* s,
|
| 207 |
+
size_type n);
|
| 208 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2, const charT* s);
|
| 209 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2, size_type n, charT c);
|
| 210 |
+
template<class InputIterator>
|
| 211 |
+
constexpr basic_string& replace(const_iterator i1, const_iterator i2,
|
| 212 |
+
InputIterator j1, InputIterator j2);
|
| 213 |
+
template<container-compatible-range<charT> R>
|
| 214 |
+
constexpr basic_string& replace_with_range(const_iterator i1, const_iterator i2, R&& rg);
|
| 215 |
+
constexpr basic_string& replace(const_iterator, const_iterator, initializer_list<charT>);
|
| 216 |
+
|
| 217 |
+
constexpr size_type copy(charT* s, size_type n, size_type pos = 0) const;
|
| 218 |
+
|
| 219 |
+
constexpr void swap(basic_string& str)
|
| 220 |
+
noexcept(allocator_traits<Allocator>::propagate_on_container_swap::value ||
|
| 221 |
+
allocator_traits<Allocator>::is_always_equal::value);
|
| 222 |
+
|
| 223 |
+
// [string.ops], string operations
|
| 224 |
+
constexpr const charT* c_str() const noexcept;
|
| 225 |
+
constexpr const charT* data() const noexcept;
|
| 226 |
+
constexpr charT* data() noexcept;
|
| 227 |
+
constexpr operator basic_string_view<charT, traits>() const noexcept;
|
| 228 |
+
constexpr allocator_type get_allocator() const noexcept;
|
| 229 |
+
|
| 230 |
+
template<class T>
|
| 231 |
+
constexpr size_type find(const T& t, size_type pos = 0) const noexcept(see below);
|
| 232 |
+
constexpr size_type find(const basic_string& str, size_type pos = 0) const noexcept;
|
| 233 |
+
constexpr size_type find(const charT* s, size_type pos, size_type n) const;
|
| 234 |
+
constexpr size_type find(const charT* s, size_type pos = 0) const;
|
| 235 |
+
constexpr size_type find(charT c, size_type pos = 0) const noexcept;
|
| 236 |
+
template<class T>
|
| 237 |
+
constexpr size_type rfind(const T& t, size_type pos = npos) const noexcept(see below);
|
| 238 |
+
constexpr size_type rfind(const basic_string& str, size_type pos = npos) const noexcept;
|
| 239 |
+
constexpr size_type rfind(const charT* s, size_type pos, size_type n) const;
|
| 240 |
+
constexpr size_type rfind(const charT* s, size_type pos = npos) const;
|
| 241 |
+
constexpr size_type rfind(charT c, size_type pos = npos) const noexcept;
|
| 242 |
+
|
| 243 |
+
template<class T>
|
| 244 |
+
constexpr size_type find_first_of(const T& t, size_type pos = 0) const noexcept(see below);
|
| 245 |
+
constexpr size_type find_first_of(const basic_string& str, size_type pos = 0) const noexcept;
|
| 246 |
+
constexpr size_type find_first_of(const charT* s, size_type pos, size_type n) const;
|
| 247 |
+
constexpr size_type find_first_of(const charT* s, size_type pos = 0) const;
|
| 248 |
+
constexpr size_type find_first_of(charT c, size_type pos = 0) const noexcept;
|
| 249 |
+
template<class T>
|
| 250 |
+
constexpr size_type find_last_of(const T& t,
|
| 251 |
+
size_type pos = npos) const noexcept(see below);
|
| 252 |
+
constexpr size_type find_last_of(const basic_string& str,
|
| 253 |
+
size_type pos = npos) const noexcept;
|
| 254 |
+
constexpr size_type find_last_of(const charT* s, size_type pos, size_type n) const;
|
| 255 |
+
constexpr size_type find_last_of(const charT* s, size_type pos = npos) const;
|
| 256 |
+
constexpr size_type find_last_of(charT c, size_type pos = npos) const noexcept;
|
| 257 |
+
|
| 258 |
+
template<class T>
|
| 259 |
+
constexpr size_type find_first_not_of(const T& t,
|
| 260 |
+
size_type pos = 0) const noexcept(see below);
|
| 261 |
+
constexpr size_type find_first_not_of(const basic_string& str,
|
| 262 |
+
size_type pos = 0) const noexcept;
|
| 263 |
+
constexpr size_type find_first_not_of(const charT* s, size_type pos, size_type n) const;
|
| 264 |
+
constexpr size_type find_first_not_of(const charT* s, size_type pos = 0) const;
|
| 265 |
+
constexpr size_type find_first_not_of(charT c, size_type pos = 0) const noexcept;
|
| 266 |
+
template<class T>
|
| 267 |
+
constexpr size_type find_last_not_of(const T& t,
|
| 268 |
+
size_type pos = npos) const noexcept(see below);
|
| 269 |
+
constexpr size_type find_last_not_of(const basic_string& str,
|
| 270 |
+
size_type pos = npos) const noexcept;
|
| 271 |
+
constexpr size_type find_last_not_of(const charT* s, size_type pos, size_type n) const;
|
| 272 |
+
constexpr size_type find_last_not_of(const charT* s, size_type pos = npos) const;
|
| 273 |
+
constexpr size_type find_last_not_of(charT c, size_type pos = npos) const noexcept;
|
| 274 |
+
|
| 275 |
+
constexpr basic_string substr(size_type pos = 0, size_type n = npos) const &;
|
| 276 |
+
constexpr basic_string substr(size_type pos = 0, size_type n = npos) &&;
|
| 277 |
+
|
| 278 |
+
template<class T>
|
| 279 |
+
constexpr int compare(const T& t) const noexcept(see below);
|
| 280 |
+
template<class T>
|
| 281 |
+
constexpr int compare(size_type pos1, size_type n1, const T& t) const;
|
| 282 |
+
template<class T>
|
| 283 |
+
constexpr int compare(size_type pos1, size_type n1, const T& t,
|
| 284 |
+
size_type pos2, size_type n2 = npos) const;
|
| 285 |
+
constexpr int compare(const basic_string& str) const noexcept;
|
| 286 |
+
constexpr int compare(size_type pos1, size_type n1, const basic_string& str) const;
|
| 287 |
+
constexpr int compare(size_type pos1, size_type n1, const basic_string& str,
|
| 288 |
+
size_type pos2, size_type n2 = npos) const;
|
| 289 |
+
constexpr int compare(const charT* s) const;
|
| 290 |
+
constexpr int compare(size_type pos1, size_type n1, const charT* s) const;
|
| 291 |
+
constexpr int compare(size_type pos1, size_type n1, const charT* s, size_type n2) const;
|
| 292 |
+
|
| 293 |
+
constexpr bool starts_with(basic_string_view<charT, traits> x) const noexcept;
|
| 294 |
+
constexpr bool starts_with(charT x) const noexcept;
|
| 295 |
+
constexpr bool starts_with(const charT* x) const;
|
| 296 |
+
constexpr bool ends_with(basic_string_view<charT, traits> x) const noexcept;
|
| 297 |
+
constexpr bool ends_with(charT x) const noexcept;
|
| 298 |
+
constexpr bool ends_with(const charT* x) const;
|
| 299 |
+
|
| 300 |
+
constexpr bool contains(basic_string_view<charT, traits> x) const noexcept;
|
| 301 |
+
constexpr bool contains(charT x) const noexcept;
|
| 302 |
+
constexpr bool contains(const charT* x) const;
|
| 303 |
+
};
|
| 304 |
+
|
| 305 |
+
template<class InputIterator,
|
| 306 |
+
class Allocator = allocator<typename iterator_traits<InputIterator>::value_type>>
|
| 307 |
+
basic_string(InputIterator, InputIterator, Allocator = Allocator())
|
| 308 |
+
-> basic_string<typename iterator_traits<InputIterator>::value_type,
|
| 309 |
+
char_traits<typename iterator_traits<InputIterator>::value_type>,
|
| 310 |
+
Allocator>;
|
| 311 |
+
|
| 312 |
+
template<ranges::input_range R,
|
| 313 |
+
class Allocator = allocator<ranges::range_value_t<R>>>
|
| 314 |
+
basic_string(from_range_t, R&&, Allocator = Allocator())
|
| 315 |
+
-> basic_string<ranges::range_value_t<R>, char_traits<ranges::range_value_t<R>>,
|
| 316 |
+
Allocator>;
|
| 317 |
+
|
| 318 |
+
template<class charT,
|
| 319 |
+
class traits,
|
| 320 |
+
class Allocator = allocator<charT>>
|
| 321 |
+
explicit basic_string(basic_string_view<charT, traits>, const Allocator& = Allocator())
|
| 322 |
+
-> basic_string<charT, traits, Allocator>;
|
| 323 |
+
|
| 324 |
+
template<class charT,
|
| 325 |
+
class traits,
|
| 326 |
+
class Allocator = allocator<charT>>
|
| 327 |
+
basic_string(basic_string_view<charT, traits>,
|
| 328 |
+
typename see below::size_type, typename see below::size_type,
|
| 329 |
+
const Allocator& = Allocator())
|
| 330 |
+
-> basic_string<charT, traits, Allocator>;
|
| 331 |
+
}
|
| 332 |
+
```
|
| 333 |
+
|
| 334 |
+
A `size_type` parameter type in a `basic_string` deduction guide refers
|
| 335 |
+
to the `size_type` member type of the type deduced by the deduction
|
| 336 |
+
guide.
|
| 337 |
+
|
| 338 |
+
The types `iterator` and `const_iterator` meet the constexpr iterator
|
| 339 |
+
requirements [[iterator.requirements.general]].
|
| 340 |
+
|