Explorar o código

bugfix: use explicit cast to underlying_type

Sam Jaffe %!s(int64=2) %!d(string=hai) anos
pai
achega
974596108e
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  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_);
+    }
   };
 }