Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a95c0dd6 authored by Enrico Granata's avatar Enrico Granata Committed by android-build-merger
Browse files

Merge "Make toInt() a little bit shorter by moving std::underlying_type to a...

Merge "Make toInt() a little bit shorter by moving std::underlying_type to a template argument" into pi-dev
am: fc40e7d7

Change-Id: I2f70f69c62b4fc70f13f24eced7d1e454f6358e3
parents 2b052d95 fc40e7d7
Loading
Loading
Loading
Loading
+3 −4
Original line number Original line Diff line number Diff line
@@ -33,10 +33,9 @@ namespace V2_0 {
constexpr int32_t kAllSupportedAreas = 0;
constexpr int32_t kAllSupportedAreas = 0;


/** Returns underlying (integer) value for given enum. */
/** Returns underlying (integer) value for given enum. */
template<typename ENUM>
template<typename ENUM, typename U = typename std::underlying_type<ENUM>::type>
inline constexpr typename std::underlying_type<ENUM>::type toInt(
inline constexpr U toInt(ENUM const value) {
        ENUM const value) {
    return static_cast<U>(value);
    return static_cast<typename std::underlying_type<ENUM>::type>(value);
}
}


inline constexpr VehiclePropertyType getPropType(int32_t prop) {
inline constexpr VehiclePropertyType getPropType(int32_t prop) {