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
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 55f21ea..79dd992 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -326,6 +326,8 @@
template<typename T>
struct hidl_vec {
+ using value_type = T;
+
hidl_vec()
: mBuffer(nullptr),
mSize(0),
@@ -789,7 +791,7 @@
// 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;