.clear()

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:

us
Visit us
code
Hide code
Code
Output
Hide output
Hide output
Loading...

All contributors

Looking to contribute?

Learn C++ on Codecademy