O'Reilly logo

Mastering C++ Programming by Jeganathan Swaminathan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Commonly used APIs in a set

The following table describes the commonly used set APIs:

API

Description

insert( value )

This inserts a value into the set

clear()

This clears all the values in the set

size()

This returns the total number of entries present in the set

empty()

This will print true if the set is empty, and returns false otherwise

find()

This finds the element with the specified key and returns the iterator position

equal_range()

This returns the range of elements matching a specific key

lower_bound()

This returns an iterator to the first element not less than the given key

upper_bound()

This returns an iterator to the first element greater than the given key

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required