diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2019-07-24 02:17:59 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2019-07-24 02:17:59 +0000 |
commit | 0d2a0dab0ed58d03368606f0d78aa0361d97e29a (patch) | |
tree | 49ce583c5ea05fb8e8b1b88f557413d6083f4802 /base | |
parent | 6b7c685dac7318d14fe5e97e27e4ff87b1d1e30c (diff) | |
parent | 93f75928d41841e6a8b771442aaa27ba67095471 (diff) | |
download | libhidl-0d2a0dab0ed58d03368606f0d78aa0361d97e29a.tar.gz |
Merge "Implement hidl_vec::find and hidl_vec::contains"
Diffstat (limited to 'base')
-rw-r--r-- | base/include/hidl/HidlSupport.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h index adf86a7..c0ae1c0 100644 --- a/base/include/hidl/HidlSupport.h +++ b/base/include/hidl/HidlSupport.h @@ -585,8 +585,11 @@ public: iterator end() { return data()+mSize; } const_iterator begin() const { return data(); } const_iterator end() const { return data()+mSize; } + iterator find(const T& v) { return std::find(begin(), end(), v); } + const_iterator find(const T& v) const { return std::find(begin(), end(), v); } + bool contains(const T& v) const { return find(v) != end(); } -private: + private: details::hidl_pointer<T> mBuffer; uint32_t mSize; bool mOwnsBuffer; |