hidl_enum_iterator: deprecate w/ message
Add a helpful message when the old type is used to use the new type.
Change-Id: I806d9fc9a185dc0c9e31c4503c442e8060b6a5e3
Fixes: 78573628
Test: manual
diff --git a/base/include/hidl/HidlSupport.h b/base/include/hidl/HidlSupport.h
index 71d0c7f..8c93998 100644
--- a/base/include/hidl/HidlSupport.h
+++ b/base/include/hidl/HidlSupport.h
@@ -993,17 +993,15 @@
* Every HIDL generated enum generates an implementation of this function.
* E.x.: for(const auto v : hidl_enum_range<Enum>) { ... }
*/
-template <typename>
+template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
struct hidl_enum_range;
-/**
- * Deprecated
- *
- * TODO(b/78573628): remove. This type is technically not an iterator but
- * is a range/iterable type.
- */
-template <typename T>
-using hidl_enum_iterator = hidl_enum_range<T>;
+template <typename T, typename = std::enable_if_t<std::is_enum<T>::value>>
+struct hidl_enum_iterator {
+ static_assert(!std::is_enum<T>::value,
+ "b/78573628: hidl_enum_iterator was renamed to hidl_enum_range because it is not "
+ "actually an iterator. Please use that type instead.");
+};
/**
* Bitfields in HIDL are the underlying type of the enumeration.