.clear()

Christine_Yang's avatar
Published May 4, 2022Updated Dec 21, 2022
Contribute to Docs

The .clear() method removes all values from a set. This will destroy every value and the container will be of size 0.

Syntax

setName.clear();

Codebyte Example

The following shows the .clear() method being used on the composers set:

Code
Output
Loading...

All contributors

Contribute to Docs

Learn C++ on Codecademy