forked from mpusz/mp-units
refactor: example applications refactored to a new formatting syntax
This commit is contained in:
@@ -63,11 +63,11 @@ template<typename T, auto Min, auto Max>
|
||||
inline constexpr bool mp_units::treat_as_floating_point<ranged_representation<T, Min, Max>> =
|
||||
mp_units::treat_as_floating_point<T>;
|
||||
|
||||
template<typename T, auto Min, auto Max>
|
||||
struct MP_UNITS_STD_FMT::formatter<ranged_representation<T, Min, Max>> : formatter<T> {
|
||||
template<typename T, auto Min, auto Max, typename Char>
|
||||
struct MP_UNITS_STD_FMT::formatter<ranged_representation<T, Min, Max>, Char> : formatter<T, Char> {
|
||||
template<typename FormatContext>
|
||||
auto format(const ranged_representation<T, Min, Max>& v, FormatContext& ctx)
|
||||
auto format(const ranged_representation<T, Min, Max>& v, FormatContext& ctx) const -> decltype(ctx.out())
|
||||
{
|
||||
return formatter<T>::format(v.value(), ctx);
|
||||
return formatter<T, Char>::format(v.value(), ctx);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user