소스 검색

bugfix: use explicit cast to underlying_type

Sam Jaffe 2 년 전
부모
커밋
974596108e
1개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  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_);
+    }
   };
 }