Kyle A. answered 05/05/20
Senior Software Engineer Specializing in Systems Programming
Unfortunately the C++ standards group did not include a contains method for the std::set interface. So your code example is the intended way to determine if the set contains an element.
However in C++ 20 there appears to be a new contains method which should be the preferred way going forward.