Added FastSet/Map exists function
parent
957afb4835
commit
5b15b11261
|
|
@ -58,6 +58,9 @@ public:
|
||||||
return std::map<KEY,VALUE>(this->begin(), this->end());
|
return std::map<KEY,VALUE>(this->begin(), this->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Handy 'exists' function */
|
||||||
|
bool exists(const KEY& e) const { return find(e) != end(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
|
|
|
||||||
|
|
@ -91,6 +91,9 @@ public:
|
||||||
return std::set<VALUE>(this->begin(), this->end());
|
return std::set<VALUE>(this->begin(), this->end());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Handy 'exists' function */
|
||||||
|
bool exists(const VALUE& e) const { return find(e) != end(); }
|
||||||
|
|
||||||
/** Print to implement Testable */
|
/** Print to implement Testable */
|
||||||
void print(const std::string& str = "") const { FastSetTestableHelper<VALUE>::print(*this, str); }
|
void print(const std::string& str = "") const { FastSetTestableHelper<VALUE>::print(*this, str); }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue