 |
vrpRouting
0.3
|
Go to the documentation of this file.
35 #ifndef INCLUDE_CPP_COMMON_IDENTIFIERS_HPP_
36 #define INCLUDE_CPP_COMMON_IDENTIFIERS_HPP_
53 typedef typename std::set<T>::iterator
iterator;
70 std::generate_n(std::inserter(
m_ids,
m_ids.end()), number, [&]{ return m_ids.size(); });
100 bool has(
const T other)
const {
143 m_ids.insert(element);
165 std::set_intersection(
168 std::inserter(result, result.begin()));
178 *
this = *
this * other;
189 m_ids.insert(element);
215 std::inserter(result, result.begin()));
227 *
this = *
this - other;
236 m_ids.erase(element);
247 for (
auto identifier : identifiers.
m_ids) {
248 os << identifier <<
", ";
255 #endif // INCLUDE_CPP_COMMON_IDENTIFIERS_HPP_
Identifiers< T > & operator*=(const Identifiers< T > &other)
coumpound set INTERSECTION set
friend Identifiers< T > operator-(const Identifiers< T > &lhs, const Identifiers< T > &rhs)
friend Identifiers< T > operator+(const Identifiers< T > &lhs, const Identifiers< T > &rhs)
set UNION set
friend Identifiers< T > operator*(const Identifiers< T > &lhs, const Identifiers< T > &rhs)
set INTERSECTION
const_iterator begin() const
Identifiers< T > & operator+=(const Identifiers< T > &other)
compound set UNION set
std::set< T >::iterator iterator
const_iterator end() const
bool has(const T other) const
true ids() has element
friend std::ostream & operator<<(std::ostream &os, const Identifiers< T > &identifiers)
Prints the set of identifiers.
bool operator==(const Identifiers< T > &rhs) const
true when both sets are equal
Identifiers< T > & operator-=(const Identifiers< T > &other)
compound set DIFFERENCE set
std::set< T >::const_iterator const_iterator