Skip to content

Commit

Permalink
fmt tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
phdum-a committed Feb 27, 2025
1 parent 839a276 commit b7fbb68
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions palace/utils/configfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "configfile.hpp"

#include <algorithm>
#include <fmt/ranges.h>
#include <mfem.hpp>
#include <nlohmann/json.hpp>

Expand Down Expand Up @@ -189,32 +190,14 @@ void ParseElementData(json &elem, const std::string &name, bool required,
template <typename T>
std::ostream &operator<<(std::ostream &os, const std::vector<T> &data)
{
bool first = true;
for (const auto &x : data)
{
if (!first)
{
os << ' ';
}
os << x;
first = false;
}
os << fmt::format("{}", fmt::join(data, " "));
return os;
}

template <typename T, std::size_t N>
std::ostream &operator<<(std::ostream &os, const std::array<T, N> &data)
{
bool first = true;
for (const auto &x : data)
{
if (!first)
{
os << ' ';
}
os << x;
first = false;
}
os << fmt::format("{}", fmt::join(data, " "));
return os;
}

Expand Down

0 comments on commit b7fbb68

Please sign in to comment.