fixed_point: Use variable templates and concepts where applicable

Makes a few things a little less noisy and removes the need for SFINAE
in quite a few functions.
This commit is contained in:
Lioncash 2022-10-18 12:54:53 -04:00
parent 8649c46c74
commit 5000d814af
2 changed files with 56 additions and 72 deletions

View file

@ -34,4 +34,12 @@ concept DerivedFrom = requires {
template <typename From, typename To>
concept ConvertibleTo = std::is_convertible_v<From, To>;
// No equivalents in the stdlib
template <typename T>
concept IsArithmetic = std::is_arithmetic_v<T>;
template <typename T>
concept IsIntegral = std::is_integral_v<T>;
} // namespace Common