Merge "stagefright/foundation: fix ALookup for same types" into nyc-dev
diff --git a/include/media/stagefright/foundation/ALookup.h b/include/media/stagefright/foundation/ALookup.h
index 571eda2..d8af407 100644
--- a/include/media/stagefright/foundation/ALookup.h
+++ b/include/media/stagefright/foundation/ALookup.h
@@ -29,8 +29,12 @@
bool lookup(const T& from, U *to);
bool rlookup(const U& from, T *to);
- inline bool map(const T& from, U *to) { return lookup(from, to); }
- inline bool map(const U& from, T *to) { return rlookup(from, to); }
+
+ template<typename V, typename = typename std::enable_if<!std::is_same<T, V>::value>::type>
+ inline bool map(const T& from, V *to) { return lookup(from, to); }
+
+ template<typename V, typename = typename std::enable_if<!std::is_same<T, V>::value>::type>
+ inline bool map(const V& from, T *to) { return rlookup(from, to); }
private:
std::vector<std::pair<T, U>> mTable;