string::string

Default constructor.

Synopsis

string(); (1)

string(
    pilfered< string > other) noexcept; (2)

explicit
string(
    storage_ptr sp); (3)

explicit
string(
    std::size_t count,
    char ch,
    storage_ptr sp = {}); (4)

string(
    char const* s,
    storage_ptr sp = {}); (5)

explicit
string(
    char const* s,
    std::size_t count,
    storage_ptr sp = {}); (6)

template<
    class InputIt>
explicit
string(
    InputIt first,
    InputIt last,
    storage_ptr sp = {}); (7)

explicit
string(
    string const& other,
    storage_ptr sp); (8)

explicit
string(
    string&& other,
    storage_ptr sp); (9)

string(
    string_view s,
    storage_ptr sp = {}); (10)

string(
    string const& other); (11)

string(
    string&& other) noexcept; (12)

Description

The string will have a zero size and a non-zero, unspecified capacity, using the default memory resource.

Complexity

Constant.

Template Parameters

Type Description

InputIt

The type of the iterators.

Parameters

Name Description

other

The value to pilfer. After pilfer construction, other is not in a usable state and may only be destroyed.

sp

A pointer to the boost::container::pmr::memory_resource to use. The container will acquire shared ownership of the memory resource.

count

The size of the resulting string.

ch

The value to initialize characters of the string with.

s

A pointer to a character string used to copy from.

first

An input iterator pointing to the first character to insert, or pointing to the end of the range.

last

An input iterator pointing to the end of the range.

Exceptions

Type Thrown On

boost::system::system_error

count > max_size().