Skip to content

Commit c04034a

Browse files
committed
Replace false with impossible condition for older compiler support
1 parent d1c97b6 commit c04034a

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

include/boost/decimal/decimal128_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ BOOST_DECIMAL_EXPORT class decimal128_t final
262262
#else
263263
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
264264
#endif
265-
constexpr decimal128_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
265+
constexpr decimal128_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
266266

267267
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
268268
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>

include/boost/decimal/decimal32_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ BOOST_DECIMAL_EXPORT class decimal32_t final // NOLINT(cppcoreguidelines-special
287287
#else
288288
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
289289
#endif
290-
constexpr decimal32_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
290+
constexpr decimal32_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
291291

292292
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
293293
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>

include/boost/decimal/decimal64_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ BOOST_DECIMAL_EXPORT class decimal64_t final
324324
#else
325325
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
326326
#endif
327-
constexpr decimal64_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
327+
constexpr decimal64_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
328328

329329
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
330330
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>

include/boost/decimal/decimal_fast128_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast128_t final
162162
#else
163163
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
164164
#endif
165-
constexpr decimal_fast128_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
165+
constexpr decimal_fast128_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
166166

167167
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
168168
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>

include/boost/decimal/decimal_fast32_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast32_t final
151151
constexpr decimal_fast32_t(T1 coeff, T2 exp, bool sign = false) noexcept;
152152

153153
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
154-
constexpr decimal_fast32_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
154+
constexpr decimal_fast32_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
155155

156156
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
157157
constexpr decimal_fast32_t(T1 coeff, T2 exp) noexcept;

include/boost/decimal/decimal_fast64_t.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ BOOST_DECIMAL_EXPORT class decimal_fast64_t final
173173
#else
174174
template <typename T1, typename T2, std::enable_if_t<!detail::is_unsigned_v<T1> && detail::is_integral_v<T2>, bool> = true>
175175
#endif
176-
constexpr decimal_fast64_t(T1, T2, bool) noexcept { static_assert(false, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
176+
constexpr decimal_fast64_t(T1, T2, bool) noexcept { static_assert(detail::is_unsigned_v<T1>, "Construction from signed integer, exponent, and sign is ambiguous, so it is disallowed. You must use an Unsigned Integer for the coefficient to construct from {coefficient, exponent, sign}"); }
177177

178178
#ifdef BOOST_DECIMAL_HAS_CONCEPTS
179179
template <BOOST_DECIMAL_SIGNED_INTEGRAL T1, BOOST_DECIMAL_INTEGRAL T2>

0 commit comments

Comments
 (0)