Commit 7213c267 authored by Max Kellermann's avatar Max Kellermann

util/ConstBuffer: add method Contains()

parent fa1fb47d
...@@ -138,6 +138,16 @@ struct ConstBuffer { ...@@ -138,6 +138,16 @@ struct ConstBuffer {
return size == 0; return size == 0;
} }
template<typename U>
gcc_pure
bool Contains(U &&u) const {
for (const auto &i : *this)
if (u == i)
return true;
return false;
}
constexpr iterator begin() const { constexpr iterator begin() const {
return data; return data;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment