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

Commit ad7b9279 authored by Enrico Granata's avatar Enrico Granata
Browse files

Make toInt() a little bit shorter by moving std::underlying_type to a template argument

No feature change.

Bug: b/75328113
Test: build
Change-Id: I262493821da7bb06618680932cf93ec25671cfe4
parent 4bca86e2
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -33,10 +33,9 @@ namespace V2_0 {
constexpr int32_t kAllSupportedAreas = 0;

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

inline constexpr VehiclePropertyType getPropType(int32_t prop) {