forked from mpusz/mp-units
refactor(example): glide computer refactored for V2
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include "validated_type.h"
|
||||
#include <units/bits/external/hacks.h>
|
||||
#include <units/customization_points.h>
|
||||
#include <algorithm>
|
||||
#include <type_traits>
|
||||
|
||||
@@ -42,6 +43,9 @@ public:
|
||||
[[nodiscard]] constexpr ranged_representation operator-() const { return ranged_representation(-this->value()); }
|
||||
};
|
||||
|
||||
template<typename T, auto Min, auto Max>
|
||||
inline constexpr bool units::is_scalar<ranged_representation<T, Min, Max>> = units::is_scalar<T>;
|
||||
|
||||
template<typename T, auto Min, auto Max>
|
||||
struct std::common_type<std::intmax_t, ranged_representation<T, Min, Max>> :
|
||||
std::type_identity<ranged_representation<std::common_type_t<std::intmax_t, T>, Min, Max>> {};
|
||||
|
||||
Reference in New Issue
Block a user