Sfoglia il codice sorgente

bugfix: use explicit cast to underlying_type

Sam Jaffe 2 anni fa
parent
commit
974596108e
1 ha cambiato i file con 3 aggiunte e 1 eliminazioni
  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_);
+    }
   };
 }