Constrain strictly_increasing to signed values

This commit is contained in:
Chip Hogg
2022-01-10 14:27:04 -05:00
parent c64f392dc3
commit 4f90302dd7

View File

@@ -211,6 +211,7 @@ pairwise_all(T) -> pairwise_all<T>;
// Check whether a sequence of (possibly heterogeneously typed) values are strictly increasing.
template<typename... Ts>
requires ((std::is_signed_v<Ts> && ...))
constexpr bool strictly_increasing(Ts&&... ts) {
return pairwise_all{std::less{}}(std::forward<Ts>(ts)...);
}