Added FastSet/Map exists function

release/4.3a0
Richard Roberts 2013-08-08 21:41:23 +00:00
parent 957afb4835
commit 5b15b11261
2 changed files with 6 additions and 0 deletions

View File

@ -58,6 +58,9 @@ public:
return std::map<KEY,VALUE>(this->begin(), this->end());
}
/** Handy 'exists' function */
bool exists(const KEY& e) const { return find(e) != end(); }
private:
/** Serialization function */
friend class boost::serialization::access;

View File

@ -91,6 +91,9 @@ public:
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 */
void print(const std::string& str = "") const { FastSetTestableHelper<VALUE>::print(*this, str); }