@@ -80,7 +80,7 @@ concept bounded_by_range = overlapping_integer<T, minimum, maximum> and detail::
80
80
81
81
namespace detail {
82
82
83
- export template <integral T, bounded_integer Minimum, bounded_integer Maximum>
83
+ export template <integral T, integral Minimum, integral Maximum>
84
84
constexpr auto assume_in_range_impl (T const value, Minimum, Maximum) {
85
85
return integer<
86
86
normalize<detail::safe_max (builtin_min_value<Minimum>, builtin_min_value<T>)>,
@@ -90,7 +90,7 @@ constexpr auto assume_in_range_impl(T const value, Minimum, Maximum) {
90
90
91
91
} // namespace detail
92
92
93
- export constexpr auto assume_in_range (integral auto const value, bounded_integer auto const minimum, bounded_integer auto const maximum) {
93
+ export constexpr auto assume_in_range (integral auto const value, integral auto const minimum, integral auto const maximum) {
94
94
if (value < minimum or maximum < value) {
95
95
std::unreachable ();
96
96
}
@@ -242,6 +242,7 @@ static_assert(bounded::isomorphic_to_integral<bounded::integer<0, 1>>);
242
242
static_assert (bounded::assume_in_range(bounded::constant<5 >, bounded::constant<0 >, bounded::constant<10 >) == bounded::constant<5 >);
243
243
// This should not compile
244
244
// constexpr auto value2 = bounded::assume_in_range(15, bounded::constant<0>, bounded::constant<10>);
245
+ static_assert (bounded::assume_in_range(2 , 1 , 3 ) == bounded::integer(2 ));
245
246
246
247
static_assert (homogeneous_equals(bounded::normalize<bounded::constant<0 >>, 0 ));
247
248
0 commit comments