Top "Stdset" questions

In C++, `std::set`s are a kind of associative container that stores unique elements, and in which the elements themselves are the keys.

Why does std::set not have a "contains" member function?

I'm heavily using std::set<int> and often I simply need to check if such a set contains …

c++ stl stdset
Efficiently initialise std::set with a sequence of numbers

An obvious (naive?) approach would be: std::set<int> s; for (int i = 0; i < SIZE; ++i) { s.…

c++ stl initialization stdset
Is there a difference between using .begin() vs .end() for std::inserter for std::set?

If there is any difference between it1 and it2? std::set<sometype> s; auto it1 = std::inserter(s, …

c++ stl stdset insert-iterator
C++ set search for pair element?

So I have a set of pairs<string ,string> And I want to use find() to search for …

c++ search stl std-pair stdset
How can I get a std::set of characters in a string, as strings?

I have a std::string. I want the set of unique characters in it, with each character represented as a …

c++ string stdset
C++ std::set Find function overloading == operator

I am using sets. I use a custom struct as the key. I am inserting a value and trying to …

c++ set stdset
C++ feature, like std::set, which allows duplicates

I have an std::set, which stores std::pairs of two integers. The std::set is also sorted, by allowing …

c++ list c++11 std-pair stdset