cpp/string/basic string/operator=

Replaces the contents of the string.

@1@ Replaces the contents with a copy of. If and  are the same object, this function has no effect.

@2@ Replaces the contents with those of using move semantics. is in a valid but unspecified state afterwards. If is, the allocator of  is replaced by a copy of that of. If it is and the allocators of  and  do not compare equal,  cannot take ownership of the memory owned by  and must assign each character individually, allocating additional memory using its own allocator as needed. Unlike other container move assignments, references, pointers, and iterators to may be invalidated. @3@ Replaces the contents with those of null-terminated character string pointed to by as if by. @4@ Replaces the contents with character as if by. @5@ Replaces the contents with those of the initializer list as if by. @6@ @7@ cannot be assigned from.

Complexity
@1@ Linear in size of.

@2@ Linear in the size of (formally, each  has to be destroyed). If allocators do not compare equal and do not propagate, then also linear in the size of (copy must be made).

@3@ Linear in size of.

@4@ Constant.

@5@ Linear in size of.

Exceptions
If the operation would result in, throws std.