mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-23 01:21:42 +00:00
[wpimath] Templatize formatters (#6535)
This is required for compatibility with libc++'s std::format.
This commit is contained in:
@@ -18,11 +18,13 @@ template <typename Derived, typename CharT>
|
||||
requires std::derived_from<Derived, Eigen::DenseBase<Derived>> ||
|
||||
std::derived_from<Derived, Eigen::SparseCompressedBase<Derived>>
|
||||
struct fmt::formatter<Derived, CharT> {
|
||||
constexpr auto parse(fmt::format_parse_context& ctx) {
|
||||
template <typename ParseContext>
|
||||
constexpr auto parse(ParseContext& ctx) {
|
||||
return m_underlying.parse(ctx);
|
||||
}
|
||||
|
||||
auto format(const Derived& mat, fmt::format_context& ctx) const {
|
||||
template <typename FmtContext>
|
||||
auto format(const Derived& mat, FmtContext& ctx) const {
|
||||
auto out = ctx.out();
|
||||
|
||||
for (int row = 0; row < mat.rows(); ++row) {
|
||||
|
||||
Reference in New Issue
Block a user