C++ Pre Defined Libraries and Classes?

JC724

Weaksauce
Joined
Jan 20, 2016
Messages
118
Is there a pre defined Set Class in C++. Like when you are dealing with sets like {a,b,c}?

Are there set operations in C++ like

{a,b} U {c,a} = {a,b,c} or {a,b} - {b} = {a}??
 
I'd suggest looking at the <set> class for ordered collections, <vector> or <unordered_set> class for unordered collections, and <tuple> class for heterogenous collections. Those are about as close as you're going to get in the STL unless you build your own. In <algorithm> there are utilities such as set_union, set_intersection, set_difference, etc. that will operate on two collections and return a (sorted) collection result.
 
Back
Top