@@ -83,85 +83,93 @@ constexpr auto from_bits_d128(detail::uint128_t bits) noexcept -> decimal128
8383}
8484#endif
8585
86- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid_d128f (decimal128_fast val) noexcept -> detail::uint128
86+ constexpr auto to_bid_d128f (decimal128_fast val) noexcept -> detail::uint128
8787{
8888 const decimal128 compliant_val {val};
89- const auto bits {detail::bit_cast<detail::uint128>(compliant_val)};
90- return bits;
89+ return to_bid_d128 (compliant_val);
9190}
9291
93- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid_d128f (detail::uint128 bits) noexcept -> decimal128_fast
92+ constexpr auto from_bid_d128f (detail::uint128 bits) noexcept -> decimal128_fast
9493{
95- const auto compliant_val {detail::bit_cast<decimal128> (bits)};
94+ const auto compliant_val {from_bid_d128 (bits)};
9695 const decimal128_fast val {compliant_val};
9796 return val;
9897}
9998
100- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal32 val) noexcept -> std::uint32_t
99+ #ifdef BOOST_DECIMAL_HAS_INT128
100+ constexpr auto from_bid_d128f (detail::uint128_t bits) noexcept -> decimal128_fast
101+ {
102+ const auto compliant_val {from_bid_d128 (bits)};
103+ const decimal128_fast val {compliant_val};
104+ return val;
105+ }
106+ #endif
107+
108+ constexpr auto to_bid (decimal32 val) noexcept -> std::uint32_t
101109{
102110 return to_bid_d32 (val);
103111}
104112
105- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal32_fast val) noexcept -> std::uint32_t
113+ constexpr auto to_bid (decimal32_fast val) noexcept -> std::uint32_t
106114{
107115 return to_bid_d32f (val);
108116}
109117
110- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal64 val) noexcept -> std::uint64_t
118+ constexpr auto to_bid (decimal64 val) noexcept -> std::uint64_t
111119{
112120 return to_bid_d64 (val);
113121}
114122
115- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal64_fast val) noexcept -> std::uint64_t
123+ constexpr auto to_bid (decimal64_fast val) noexcept -> std::uint64_t
116124{
117125 return to_bid_d64f (val);
118126}
119127
120- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal128 val) noexcept -> detail::uint128
128+ constexpr auto to_bid (decimal128 val) noexcept -> detail::uint128
121129{
122130 return to_bid_d128 (val);
123131}
124132
125- BOOST_DECIMAL_CXX20_CONSTEXPR auto to_bid (decimal128_fast val) noexcept -> detail::uint128
133+ constexpr auto to_bid (decimal128_fast val) noexcept -> detail::uint128
126134{
127135 return to_bid_d128f (val);
128136}
129137
130138template <typename T = decimal32_fast>
131- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid (std::uint32_t bits) noexcept
139+ constexpr auto from_bid (std::uint32_t bits) noexcept
132140 BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
133141{
134142 return from_bid_d32f (bits);
135143}
136144
137145template <>
138- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid<decimal32>(std::uint32_t bits) noexcept -> decimal32
146+ constexpr auto from_bid<decimal32>(std::uint32_t bits) noexcept -> decimal32
139147{
140148 return from_bid_d32 (bits);
141149}
142150
143151template <typename T = decimal64_fast>
144- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid (std::uint64_t bits) noexcept
152+ constexpr auto from_bid (std::uint64_t bits) noexcept
145153 BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
146154{
147155 return from_bid_d64f (bits);
148156}
149157
150158template <>
151- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid<decimal64>(std::uint64_t bits) noexcept -> decimal64
159+ constexpr auto from_bid<decimal64>(std::uint64_t bits) noexcept -> decimal64
152160{
153161 return from_bid_d64 (bits);
154162}
155163
156164template <typename T = decimal128_fast>
157- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid (detail::uint128 bits) noexcept
165+ constexpr auto from_bid (detail::uint128 bits) noexcept
158166 BOOST_DECIMAL_REQUIRES(detail::is_decimal_floating_point_v, T)
159167{
160168 return from_bid_d128f (bits);
161169}
162170
163171template <>
164- BOOST_DECIMAL_CXX20_CONSTEXPR auto from_bid<decimal128>(detail::uint128 bits) noexcept -> decimal128
172+ constexpr auto from_bid<decimal128>(detail::uint128 bits) noexcept -> decimal128
165173{
166174 return from_bid_d128 (bits);
167175}
0 commit comments