Fix character types in math primitive formatters
This commit is contained in:
parent
3a22c74ce5
commit
03af0a7099
5 changed files with 16 additions and 16 deletions
|
|
@ -354,9 +354,9 @@ namespace std
|
|||
|
||||
template <typename T, std::size_t N, typename Char>
|
||||
struct formatter<::psemek::math::box<T, N>, Char>
|
||||
: formatter<::psemek::math::interval<T>>
|
||||
: formatter<::psemek::math::interval<T>, Char>
|
||||
{
|
||||
using formatter<::psemek::math::interval<T>>::parse;
|
||||
using formatter<::psemek::math::interval<T>, Char>::parse;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(::psemek::math::box<T, N> const & b, FormatContext & ctx) const
|
||||
|
|
@ -364,7 +364,7 @@ namespace std
|
|||
for (std::size_t i = 0; i < b.dimension(); ++i)
|
||||
{
|
||||
if (i > 0) ctx.advance_to(std::format_to(ctx.out(), "x"));
|
||||
ctx.advance_to(formatter<::psemek::math::interval<T>>::format(b[i], ctx));
|
||||
ctx.advance_to(formatter<::psemek::math::interval<T>, Char>::format(b[i], ctx));
|
||||
}
|
||||
return ctx.out();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,17 +341,17 @@ namespace std
|
|||
|
||||
template <typename T, typename Char>
|
||||
struct formatter<::psemek::math::interval<T>, Char>
|
||||
: formatter<T>
|
||||
: formatter<T, Char>
|
||||
{
|
||||
using formatter<T>::parse;
|
||||
using formatter<T, Char>::parse;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(::psemek::math::interval<T> const & i, FormatContext & ctx) const
|
||||
{
|
||||
ctx.advance_to(std::format_to(ctx.out(), "["));
|
||||
ctx.advance_to(formatter<T>::format(i.min, ctx));
|
||||
ctx.advance_to(formatter<T, Char>::format(i.min, ctx));
|
||||
ctx.advance_to(std::format_to(ctx.out(), " .. "));
|
||||
ctx.advance_to(formatter<T>::format(i.max, ctx));
|
||||
ctx.advance_to(formatter<T, Char>::format(i.max, ctx));
|
||||
return std::format_to(ctx.out(), "]");
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -553,9 +553,9 @@ namespace std
|
|||
|
||||
template <typename T, std::size_t R, std::size_t C, typename Char>
|
||||
struct formatter<::psemek::math::matrix<T, R, C>, Char>
|
||||
: formatter<T>
|
||||
: formatter<T, Char>
|
||||
{
|
||||
using formatter<T>::parse;
|
||||
using formatter<T, Char>::parse;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(::psemek::math::matrix<T, R, C> const & m, FormatContext & ctx) const
|
||||
|
|
@ -564,7 +564,7 @@ namespace std
|
|||
{
|
||||
for (std::size_t j = 0; j < m.columns(); ++j)
|
||||
{
|
||||
ctx.advance_to(formatter<T>::format(m[i][j], ctx));
|
||||
ctx.advance_to(formatter<T, Char>::format(m[i][j], ctx));
|
||||
ctx.advance_to(std::format_to(ctx.out(), " "));
|
||||
}
|
||||
ctx.advance_to(std::format_to(ctx.out(), "\n"));
|
||||
|
|
|
|||
|
|
@ -308,9 +308,9 @@ namespace std
|
|||
|
||||
template <typename T, std::size_t N, typename Char>
|
||||
struct formatter<::psemek::math::point<T, N>, Char>
|
||||
: formatter<T>
|
||||
: formatter<T, Char>
|
||||
{
|
||||
using formatter<T>::parse;
|
||||
using formatter<T, Char>::parse;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(::psemek::math::point<T, N> const & p, FormatContext & ctx) const
|
||||
|
|
@ -325,7 +325,7 @@ namespace std
|
|||
for (std::size_t i = 0; i < p.dimension(); ++i)
|
||||
{
|
||||
if (i > 0) ctx.advance_to(std::format_to(ctx.out(), ", "));
|
||||
ctx.advance_to(formatter<T>::format(p[i], ctx));
|
||||
ctx.advance_to(formatter<T, Char>::format(p[i], ctx));
|
||||
}
|
||||
return std::format_to(ctx.out(), ")");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -548,9 +548,9 @@ namespace std
|
|||
|
||||
template <typename T, std::size_t N, typename Char>
|
||||
struct formatter<::psemek::math::vector<T, N>, Char>
|
||||
: formatter<T>
|
||||
: formatter<T, Char>
|
||||
{
|
||||
using formatter<T>::parse;
|
||||
using formatter<T, Char>::parse;
|
||||
|
||||
template <typename FormatContext>
|
||||
auto format(::psemek::math::vector<T, N> const & v, FormatContext & ctx) const
|
||||
|
|
@ -565,7 +565,7 @@ namespace std
|
|||
for (std::size_t i = 0; i < v.dimension(); ++i)
|
||||
{
|
||||
if (i > 0) ctx.advance_to(std::format_to(ctx.out(), ", "));
|
||||
ctx.advance_to(formatter<T>::format(v[i], ctx));
|
||||
ctx.advance_to(formatter<T, Char>::format(v[i], ctx));
|
||||
}
|
||||
return std::format_to(ctx.out(), ")");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue