refactor: example applications refactored to a new formatting syntax

This commit is contained in:
Mateusz Pusz
2024-01-23 21:49:17 +01:00
parent 24e5ca8ad9
commit a9deec9d59
14 changed files with 118 additions and 115 deletions
+4 -4
View File
@@ -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);
}
};