aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/util/ConstBuffer.hxx10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/util/ConstBuffer.hxx b/src/util/ConstBuffer.hxx
index 319102126..db8e64df0 100644
--- a/src/util/ConstBuffer.hxx
+++ b/src/util/ConstBuffer.hxx
@@ -138,6 +138,16 @@ struct ConstBuffer {
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 {
return data;
}