@@ -349,7 +349,7 @@ namespace half_float
349349 struct binary_t {};
350350
351351 // / Tag for binary construction.
352- HALF_CONSTEXPR_CONST binary_t binary = binary_t ();
352+ static HALF_CONSTEXPR_CONST binary_t binary = binary_t ();
353353
354354 // / Temporary half-precision expression.
355355 // / This class represents a half-precision expression which just stores a single-precision value internally.
@@ -1172,7 +1172,8 @@ namespace half_float
11721172 // / Constructor.
11731173 // / \param bits binary representation to set half to
11741174 CAFFE_UTIL_HD
1175- HALF_CONSTEXPR half (detail::binary_t , detail::uint16 bits) : data_(bits) {}
1175+ HALF_CONSTEXPR half (detail::binary_t , unsigned int bits) HALF_NOEXCEPT
1176+ : data_(static_cast <detail::uint16>(bits)) {}
11761177
11771178 // / Internal binary representation
11781179 detail::uint16 data_;
@@ -3067,32 +3068,32 @@ namespace std
30673068 static HALF_CONSTEXPR_CONST int max_exponent10 = 4 ;
30683069
30693070 // / Smallest positive normal value.
3070- static HALF_CONSTEXPR half_float::half min () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x0400 ) ; }
3071+ static HALF_CONSTEXPR half_float::half min () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x0400 } ; }
30713072
30723073 // / Smallest finite value.
3073- static HALF_CONSTEXPR half_float::half lowest () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0xFBFF ) ; }
3074+ static HALF_CONSTEXPR half_float::half lowest () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0xFBFF } ; }
30743075
30753076 // / Largest finite value.
3076- static HALF_CONSTEXPR half_float::half max () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7BFF ) ; }
3077+ static HALF_CONSTEXPR half_float::half max () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7BFF } ; }
30773078
30783079 // / Difference between one and next representable value.
3079- static HALF_CONSTEXPR half_float::half epsilon () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x1400 ) ; }
3080+ static HALF_CONSTEXPR half_float::half epsilon () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x1400 } ; }
30803081
30813082 // / Maximum rounding error.
30823083 static HALF_CONSTEXPR half_float::half round_error () HALF_NOTHROW
3083- { return half_float::half ( half_float::detail::binary, (round_style==std::round_to_nearest) ? 0x3800 : 0x3C00 ) ; }
3084+ { return half_float::half{ half_float::detail::binary, (round_style==std::round_to_nearest) ? 0x3800 : 0x3C00 } ; }
30843085
30853086 // / Positive infinity.
3086- static HALF_CONSTEXPR half_float::half infinity () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7C00 ) ; }
3087+ static HALF_CONSTEXPR half_float::half infinity () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7C00 } ; }
30873088
30883089 // / Quiet NaN.
3089- static HALF_CONSTEXPR half_float::half quiet_NaN () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7FFF ) ; }
3090+ static HALF_CONSTEXPR half_float::half quiet_NaN () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7FFF } ; }
30903091
30913092 // / Signalling NaN.
3092- static HALF_CONSTEXPR half_float::half signaling_NaN () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x7DFF ) ; }
3093+ static HALF_CONSTEXPR half_float::half signaling_NaN () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x7DFF } ; }
30933094
30943095 // / Smallest positive subnormal value.
3095- static HALF_CONSTEXPR half_float::half denorm_min () HALF_NOTHROW { return half_float::half ( half_float::detail::binary, 0x0001 ) ; }
3096+ static HALF_CONSTEXPR half_float::half denorm_min () HALF_NOTHROW { return half_float::half{ half_float::detail::binary, 0x0001 } ; }
30963097 };
30973098
30983099
0 commit comments