Forráskód Böngészése

bugfix: use explicit cast to underlying_type

Sam Jaffe 2 éve
szülő
commit
974596108e
1 módosított fájl, 3 hozzáadás és 1 törlés
  1. 3 1
      include/opaque_typedef/opaque_typedef.hpp

+ 3 - 1
include/opaque_typedef/opaque_typedef.hpp

@@ -115,6 +115,8 @@ namespace types {
      */
     constexpr value_type const & get() const { return value_; }
     constexpr explicit operator value_type const &() const { return value_; }
-    constexpr underlying_type operator*() const { return value_; }
+    constexpr underlying_type operator*() const {
+      return static_cast<underlying_type>(value_);
+    }
   };
 }