summaryrefslogtreecommitdiff
path: root/base
diff options
context:
space:
mode:
authorSteven Moreland <smoreland@google.com>2019-05-06 09:39:47 -0700
committerSteven Moreland <smoreland@google.com>2019-05-06 17:15:14 +0000
commitb37de4a863c1410982861658be26795c5c49296a (patch)
treec556dc49c06d0bec80c231f3d147ad563c12fd7f /base
parent4d05bb92982e9dd19d6886d7706362832ecc716a (diff)
downloadlibhidl-b37de4a863c1410982861658be26795c5c49296a.tar.gz
hidl_vec/hidl_array add value_type
Note: this only adds value_type to single dimensional hidl_array since the multi-dimensional hidl_array only has a view returned from operator=. Waiting for more usecases before creating a value_type there. Bug: 130662871 Test: N/A Change-Id: Ie693199271267c239e657e99511ea2605d062187 Merged-In: Ie693199271267c239e657e99511ea2605d062187
Diffstat (limited to 'base')
-rw-r--r--base/include/hidl/HidlSupport.h4
1 files changed, 3 insertions, 1 deletions
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 93a6251..4c133c1 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -326,6 +326,8 @@ protected:
template<typename T>
struct hidl_vec {
+ using value_type = T;
+
hidl_vec() {
static_assert(hidl_vec<T>::kOffsetOfBuffer == 0, "wrong offset");
@@ -793,7 +795,7 @@ private:
// An array of T's. Assumes that T::operator=(const T &) is defined.
template<typename T, size_t SIZE1>
struct hidl_array<T, SIZE1> {
-
+ using value_type = T;
using std_array_type = typename details::std_array<T, SIZE1>::type;
hidl_array() = default;