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.

C++, copy set to vector

I need to copy std::set to std::vector: std::set <double> input; input.insert(5); input.insert(6); std::…

c++ copy stdvector stdset
how to find the intersection of two std::set in C++?

I have been trying to find the intersection between two std::set in C++, but I keep getting an error. …

c++ std stl-algorithm stdset
How to get the elements in a set in C++?

I am confused as to how to get the elements in the set. I think I have to use the …

c++ set stdset
advantages of std::set vs vectors or maps

This may be a stupid question, I am quite new to C++ and programming in general. I wish to understand …

c++ stdvector stdmap stdset
c++ STL set difference

Does the C++ STL set data structure have a set difference operator?

c++ stl set stdset set-difference
How do I find the largest int in a std::set<int>?

I have a std::set<int>, what's the proper way to find the largest int in this set?

c++ stl stdset
Is the C++ std::set thread-safe?

I've a question about the thread safety of std::set. As far as I know I can iterate over a …

c++ stl std stdset
How to remove duplicates from unsorted std::vector while keeping the original ordering using algorithms?

I have an array of integers that I need to remove duplicates from while maintaining the order of the first …

c++ duplicates stdvector stl-algorithm stdset
Set detect insertion failure

Is there a simple way to detect when a set insert does not occur because the item being inserted already …

c++ set stdset
C++ std::map or std::set - efficiently insert duplicates

I have a bunch of data full of duplicates and I want to eliminate the duplicates. You know, e.g. [1, 1, 3, 5, 5, 5, 7] …

c++ performance stdmap stdset