A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://timsong-cpp.github.io/cppwp/n4140/string::assign below:

[string::assign]

21.4.6.3 basic_string::assign [string::assign]

basic_string& assign(const basic_string& str);

Effects: Equivalent to assign(str, 0, npos).

basic_string& assign(basic_string&& str) noexcept;

Effects: The function replaces the string controlled by *this with a string of length str.size() whose elements are a copy of the string controlled by str. [ Note: A valid implementation is swap(str).  — end note ]

basic_string& assign(const basic_string& str, size_type pos, size_type n = npos);

Requires: pos <= str.size()

Throws: out_of_range if pos > str.size().

Effects: Determines the effective length rlen of the string to assign as the smaller of n and str.size() - pos and calls assign(str.data() + pos rlen).

basic_string& assign(const charT* s, size_type n);

Requires: s points to an array of at least n elements of charT.

Throws: length_error if n > max_size().

Effects: Replaces the string controlled by *this with a string of length n whose elements are a copy of those pointed to by s.

basic_string& assign(const charT* s);

Requires: s points to an array of at least traits::length(s) + 1 elements of charT.

Effects: Calls assign(s, traits::length(s)).

basic_string& assign(initializer_list<charT> il);

Effects: Calls assign(il.begin(), il.size()).

basic_string& assign(size_type n, charT c);

Effects: Equivalent to assign(basic_string(n, c)).

template<class InputIterator> basic_string& assign(InputIterator first, InputIterator last);

Effects: Equivalent to assign(basic_string(first, last)).


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4