File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -251,20 +251,23 @@ using parse_options = parse_options_t<char>;
251251#endif
252252
253253namespace fast_float {
254+ #if FASTFLOAT_HAS_BIT_CAST
254255template <typename To, typename From>
255256fastfloat_really_inline constexpr To bit_cast (const From &from) noexcept {
256- #if FASTFLOAT_HAS_BIT_CAST
257257 return std::bit_cast<To>(from);
258+ }
258259#else
260+ template <typename To, typename From>
261+ fastfloat_really_inline To bit_cast (const From &from) noexcept {
259262 // Implementation of std::bit_cast for pre-C++20.
260263 static_assert (sizeof (To) == sizeof (From),
261264 " bit_cast requires source and destination to be the same size" );
262265 auto to = To ();
263266 // The cast suppresses a bogus -Wclass-memaccess on GCC.
264267 std::memcpy (static_cast <void *>(&to), &from, sizeof (to));
265268 return to;
266- #endif
267269}
270+ #endif
268271
269272fastfloat_really_inline constexpr bool cpp20_and_in_constexpr () noexcept {
270273#if FASTFLOAT_HAS_IS_CONSTANT_EVALUATED
You can’t perform that action at this time.
0 commit comments