Просмотр исходного кода

Common: Clean up meta-template logic in BitField

Yuri Kunde Schlesner 9 лет назад
Родитель
Сommit
c1a9e94068
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      src/common/bit_field.h

+ 3 - 3
src/common/bit_field.h

@@ -121,11 +121,11 @@ private:
     // T is an enumeration. Note that T is wrapped within an enable_if in the
     // former case to workaround compile errors which arise when using
     // std::underlying_type<T>::type directly.
-    typedef typename std::conditional<std::is_enum<T>::value, std::underlying_type<T>,
-                                      std::enable_if<true, T>>::type::type StorageType;
+    using StorageType = typename std::conditional_t<std::is_enum<T>::value, std::underlying_type<T>,
+                                                    std::enable_if<true, T>>::type;
 
     // Unsigned version of StorageType
-    typedef typename std::make_unsigned<StorageType>::type StorageTypeU;
+    using StorageTypeU = std::make_unsigned_t<StorageType>;
 
 public:
     /// Constants to allow limited introspection of fields if needed