c++ check if set contains code example
Example: check if set contains element c++
set<T>::iterator it = theSet.find(element);
if (it != theSet.end())
{
// The element was found
}
else
{
// The element was not found
}
set<T>::iterator it = theSet.find(element);
if (it != theSet.end())
{
// The element was found
}
else
{
// The element was not found
}