.clear()

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...

Contributors

Interested in helping build Docs? Read the Contribution Guide or share your thoughts in this feedback form.

Learn C++ on Codecademy