set_utils.hpp

Tools to save and load data from classes.

Note

Status: ALPHA

Functions

template<typename T>
void insert(std::set<T> &s1, const std::set<T> &s2)

Insert the full contents of s2 into s1.

template<typename T, typename H, typename V>
bool Has(const std::set<T, H> &s, const V &val)

Test if an std::set has a particular element without modifying the set in any way.

template<typename T, typename H, typename V>
bool Has(const std::multiset<T, H> &s, const V &val)

Test if an std::multiset has a particular element without modifying the set in any way.

template<typename T, typename H, typename V>
bool Has(const std::unordered_set<T, H> &s, const V &val)

Test if an std::unordered_set has a particular element without modifying the set in any way.

template<typename T, typename H, typename V>
bool Has(const std::unordered_multiset<T, H> &s, const V &val)

Test if an std::unordered_multiset has a particular element without modifying the set in any way.

template<typename T>
std::set<T> difference(std::set<T> &s1, std::set<T> &s2)

Compute the set difference of s1 and s2 (elements that are in S1 but no S2)

template<typename T>
std::set<T> difference(vector<T> s1, vector<T> s2)

Compute the set difference of s1 and s2 (elements that are in S1 but no S2)

template<typename T>
std::set<T> difference(std::set<T> &s1, vector<T> s2)

Compute the set difference of s1 and s2 (elements that are in S1 but not S2)

template<typename T>
std::set<T> difference(vector<T> s1, std::set<T> &s2)

Compute the set difference of s1 and s2 (elements that are in S1 but no S2)

template<typename T>
std::set<T> intersection(std::set<T> &s1, std::set<T> &s2)

Compute the set intersection of s1 and s2 (elements that are in both S1 and S2)

template<typename T>
std::set<T> intersection(vector<T> s1, vector<T> s2)

Compute the set intersection of s1 and s2 (elements that are in both S1 and S2)

template<typename T>
std::set<T> intersection(std::set<T> &s1, vector<T> s2)

Compute the set intersection of s1 and s2 (elements that are in both S1 and S2)

template<typename T>
std::set<T> intersection(vector<T> s1, std::set<T> &s2)

Compute the set intersection of s1 and s2 (elements that are in both S1 and S2)

template<typename T>
std::set<T> set_union(std::set<T> &s1, std::set<T> &s2)

Compute the set union of s1 and s2 (elements that are in either S1 or S2)

template<typename T>
std::set<T> set_union(vector<T> s1, vector<T> s2)

Compute the set union of s1 and s2 (elements that are in either S1 or S2)

template<typename T>
std::set<T> set_union(std::set<T> &s1, vector<T> s2)

Compute the set union of s1 and s2 (elements that are in either S1 or S2)

template<typename T>
std::set<T> set_union(vector<T> s1, std::set<T> &s2)

Compute the set union of s1 and s2 (elements that are in either S1 or S2)

template<typename T>
std::set<T> symmetric_difference(std::set<T> &s1, std::set<T> &s2)

Compute the set symmetric_difference of s1 and s2 (elements that are in either S1 or S2 but not both)

template<typename T>
std::set<T> symmetric_difference(vector<T> s1, vector<T> s2)

Compute the set symmetric_difference of s1 and s2 (elements that are in either S1 or S2 but not both)

template<typename T>
std::set<T> symmetric_difference(std::set<T> &s1, vector<T> s2)

Compute the set symmetric_difference of s1 and s2 (elements that are in either S1 or S2 but not both)

template<typename T>
std::set<T> symmetric_difference(vector<T> s1, std::set<T> &s2)

Compute the set symmetric_difference of s1 and s2 (elements that are in either S1 or S2 but not both)