Add container-like value_type alias to hidl_enum_range.
This allows instantiations like
::testing::ValuesIn(hidl_enum_range<Foo>()).
Test: make
Test: atest VtsHalDumpstateV1_1TargetTest
Change-Id: I1313a67c152ff830ca5ab9a7285b6e9fcb539444
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 1b91c26..9343f0f 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -1044,6 +1044,9 @@
*/
template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
struct hidl_enum_range {
+ // Container-like associated type.
+ using value_type = T;
+
constexpr auto begin() const { return std::begin(details::hidl_enum_values<T>); }
constexpr auto cbegin() const { return begin(); }
constexpr auto rbegin() const { return std::rbegin(details::hidl_enum_values<T>); }