Skip to content

Commit 9862f4a

Browse files
committed
Use conditional_function in tombstone_traits<integer>
1 parent 7463eda commit 9862f4a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

source/bounded/integer_tombstone_traits.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export module bounded.integer_tombstone_traits;
1212
import bounded.arithmetic.operators;
1313
import bounded.bounded_integer;
1414
import bounded.comparison;
15+
import bounded.conditional_function;
1516
import bounded.integer;
1617
import bounded.literal;
1718
import bounded.tombstone_traits;
@@ -32,14 +33,14 @@ struct tombstone_traits<T> {
3233
static constexpr auto spare_below = numeric_traits::min_value<T> - underlying_min;
3334
static constexpr auto spare_above = underlying_max - numeric_traits::max_value<T>;
3435
public:
35-
static constexpr auto spare_representations = BOUNDED_CONDITIONAL(std::is_empty_v<T>,
36+
static constexpr auto spare_representations = conditional_function<std::is_empty_v<T>>(
3637
constant<0>,
3738
spare_below + spare_above
3839
);
3940

4041
template<bounded_integer Index> requires(Index() < spare_representations)
4142
static constexpr auto make(Index const index) noexcept {
42-
auto const value = BOUNDED_CONDITIONAL(index < spare_below,
43+
auto const value = conditional_function<index < spare_below>(
4344
index + underlying_min,
4445
index - spare_below + numeric_traits::max_value<T> + constant<1>
4546
);

0 commit comments

Comments
 (0)