cpp/string/basic string/basic string

Constructs new string from a variety of data sources and optionally using user supplied allocator.

@1@ Default constructor. Constructs empty string (zero size and unspecified capacity). If no allocator is supplied, allocator is obtained from a default-constructed instance. @2@ Constructs the string with copies of character. @3@ Constructs the string with a substring of. If, if is not specified, or if the requested substring lasts past the end of the string, the resulting substring is. @4@ Constructs the string with the first characters of character string pointed to by. can contain null characters. The length of the string is. The behavior is undefined if is not a valid range. @5@ Constructs the string with the contents initialized with a copy of the null-terminated character string pointed to by. The length of the string is determined by the first null character. The behavior is undefined if is not a valid range (for example, if  is a null pointer). @6@ Constructs the string with the contents of the range.

@7@ Copy constructor. Constructs the string with a copy of the contents of. @8@ Move constructor. Constructs the string with the contents of using move semantics. is left in valid, but unspecified state. @9@ Constructs the string with the contents of the initializer list. @10@ @11@ @12@  cannot be constructed from. @13@ Constructs the string with the values contained in the range.

Complexity
@1@ Constant. @2-4@ Linear in. @5@ Linear in length of. @6@ Linear in distance between and. @7@ Linear in size of. @8@ Constant. If is given and, then linear. @9@ Linear in size of. @13@ Linear in size of.

Exceptions
@3@ std if. @8@ Throws nothing if. @11@ std if is out of range.

Throws std if the length of the constructed string would exceed max_size (for example, if for ). Calls to may throw.