[range] contains method.

This commit is contained in:
Joe Thornber 2013-05-17 11:14:12 +01:00
parent b98dac8978
commit 7f3a269757

View File

@ -21,6 +21,16 @@ namespace base {
return (begin_ == r.begin_ && end_ == r.end_);
}
bool contains(T const &v) const {
if (begin_ && v < *begin_)
return false;
if (end_ && v >= *end_)
return false;
return true;
}
maybe begin_;
maybe end_;
};