@@ -138,7 +138,7 @@ namespace type_safe
138138 TYPE_SAFE_FORCE_INLINE static constexpr T do_addition (const T& a, const T& b) noexcept
139139 {
140140 return detail::will_addition_error (detail::arithmetic_tag_for<T>{}, a, b) ?
141- (DEBUG_UNREACHABLE (detail::assert_handler {},
141+ (DEBUG_UNREACHABLE (detail::precondition_error_handler {},
142142 " addition will result in overflow" ),
143143 a) :
144144 a + b;
@@ -148,7 +148,7 @@ namespace type_safe
148148 TYPE_SAFE_FORCE_INLINE static constexpr T do_subtraction (const T& a, const T& b) noexcept
149149 {
150150 return detail::will_subtraction_error (detail::arithmetic_tag_for<T>{}, a, b) ?
151- (DEBUG_UNREACHABLE (detail::assert_handler {},
151+ (DEBUG_UNREACHABLE (detail::precondition_error_handler {},
152152 " subtraction will result in underflow" ),
153153 a) :
154154 a - b;
@@ -158,7 +158,7 @@ namespace type_safe
158158 TYPE_SAFE_FORCE_INLINE static constexpr T do_multiplication (const T& a, const T& b) noexcept
159159 {
160160 return detail::will_multiplication_error (detail::arithmetic_tag_for<T>{}, a, b) ?
161- (DEBUG_UNREACHABLE (detail::assert_handler {},
161+ (DEBUG_UNREACHABLE (detail::precondition_error_handler {},
162162 " multiplication will result in overflow" ),
163163 a) :
164164 a * b;
@@ -168,7 +168,8 @@ namespace type_safe
168168 TYPE_SAFE_FORCE_INLINE static constexpr T do_division (const T& a, const T& b) noexcept
169169 {
170170 return detail::will_division_error (detail::arithmetic_tag_for<T>{}, a, b) ?
171- (DEBUG_UNREACHABLE (detail::assert_handler{}, " division by zero/overflow" ),
171+ (DEBUG_UNREACHABLE (detail::precondition_error_handler{},
172+ " division by zero/overflow" ),
172173 a) :
173174 a / b;
174175 }
@@ -177,7 +178,8 @@ namespace type_safe
177178 TYPE_SAFE_FORCE_INLINE static constexpr T do_modulo (const T& a, const T& b) noexcept
178179 {
179180 return detail::will_modulo_error (detail::arithmetic_tag_for<T>{}, a, b) ?
180- (DEBUG_UNREACHABLE (detail::assert_handler{}, " modulo by zero" ), a) :
181+ (DEBUG_UNREACHABLE (detail::precondition_error_handler{}, " modulo by zero" ),
182+ a) :
181183 a % b;
182184 }
183185 };
@@ -195,7 +197,7 @@ namespace type_safe
195197 error (const char * msg) : std::range_error(msg)
196198 {
197199#if !TYPE_SAFE_USE_EXCEPTIONS
198- DEBUG_UNREACHABLE (detail::assert_handler {}, msg);
200+ DEBUG_UNREACHABLE (detail::precondition_error_handler {}, msg);
199201#endif
200202 }
201203 };
0 commit comments