Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
string::resize (2 of 2 overloads)

Change the size of the string.

Synopsis
void
resize(
    std::size_t count,
    char ch);
Description

Resizes the string to contain count characters. If count > size(), copies of ch are appended. Otherwise, size() is reduced to count.

Parameters

Name

Description

count

The size to resize the string to.

ch

The characters to append if the size increases.

Exceptions

Type

Thrown On

std::out_of_range

count > max_size()


PrevUpHomeNext