Skip to content

Commit 59c04ab

Browse files
committed
Qualify format calls due to ADL with C++20 std::format
1 parent c42bdfd commit 59c04ab

4 files changed

Lines changed: 139 additions & 150 deletions

File tree

palace/drivers/electrostaticsolver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@ void ElectrostaticSolver::PostprocessTerminals(
145145
return;
146146
}
147147
using VT = Units::ValueType;
148-
using fmt::format;
149148

150149
// Write capacitance matrix data.
151150
auto PrintMatrix = [&terminal_sources, this](const std::string &file,
@@ -158,11 +157,12 @@ void ElectrostaticSolver::PostprocessTerminals(
158157
int j = 0;
159158
for (const auto &[idx2, data2] : terminal_sources)
160159
{
161-
output.table.insert(format("i2{}", idx2), format("{}[i][{}] {}", name, idx2, unit));
160+
output.table.insert(fmt::format("i2{}", idx2),
161+
fmt::format("{}[i][{}] {}", name, idx2, unit));
162162
// Use the fact that iterator over i and j is the same span.
163163
output.table["i"] << idx2;
164164

165-
auto &col = output.table[format("i2{}", idx2)];
165+
auto &col = output.table[fmt::format("i2{}", idx2)];
166166
for (std::size_t i = 0; i < terminal_sources.size(); i++)
167167
{
168168
col << mat(i, j) * scale;

palace/drivers/magnetostaticsolver.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,6 @@ void MagnetostaticSolver::PostprocessTerminals(
151151
{
152152
return;
153153
}
154-
using fmt::format;
155154

156155
// Write inductance matrix data.
157156
auto PrintMatrix = [&surf_j_op, this](const std::string &file, const std::string &name,
@@ -163,11 +162,12 @@ void MagnetostaticSolver::PostprocessTerminals(
163162
int j = 0;
164163
for (const auto &[idx2, data2] : surf_j_op)
165164
{
166-
output.table.insert(format("i2{}", idx2), format("{}[i][{}] {}", name, idx2, unit));
165+
output.table.insert(fmt::format("i2{}", idx2),
166+
fmt::format("{}[i][{}] {}", name, idx2, unit));
167167
// Use the fact that iterator over i and j is the same span.
168168
output.table["i"] << idx2;
169169

170-
auto &col = output.table[format("i2{}", idx2)];
170+
auto &col = output.table[fmt::format("i2{}", idx2)];
171171
for (std::size_t i = 0; i < surf_j_op.Size(); i++)
172172
{
173173
col << mat(i, j) * scale;

palace/models/postoperator.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,7 +1000,6 @@ void PostOperator<solver_t>::MeasureSParameter() const
10001000
// Depends on LumpedPorts, WavePorts.
10011001
if constexpr (solver_t == ProblemType::DRIVEN)
10021002
{
1003-
using fmt::format;
10041003
using std::complex_literals::operator""i;
10051004

10061005
// Don't measure S-Matrix unless there is only one excitation per port. Also, we current
@@ -1034,7 +1033,7 @@ void PostOperator<solver_t>::MeasureSParameter() const
10341033
}
10351034

10361035
Mpi::Print(" {0} = {1:+.3e}{2:+.3e}i, |{0}| = {3:+.3e}, arg({0}) = {4:+.3e}\n",
1037-
format("S[{}][{}]", idx, drive_port_idx), vi.S.real(), vi.S.imag(),
1036+
fmt::format("S[{}][{}]", idx, drive_port_idx), vi.S.real(), vi.S.imag(),
10381037
Measurement::Magnitude(vi.S), Measurement::Phase(vi.S));
10391038
}
10401039
for (const auto &[idx, data] : fem_op->GetWavePortOp())
@@ -1055,7 +1054,7 @@ void PostOperator<solver_t>::MeasureSParameter() const
10551054
vi.S *= std::exp(1i * data.kn0 * data.d_offset);
10561055

10571056
Mpi::Print(" {0} = {1:+.3e}{2:+.3e}i, |{0}| = {3:+.3e}, arg({0}) = {4:+.3e}\n",
1058-
format("S[{}][{}]", idx, drive_port_idx), vi.S.real(), vi.S.imag(),
1057+
fmt::format("S[{}][{}]", idx, drive_port_idx), vi.S.real(), vi.S.imag(),
10591058
Measurement::Magnitude(vi.S), Measurement::Phase(vi.S));
10601059
}
10611060
}
@@ -1152,8 +1151,6 @@ void PostOperator<solver_t>::MeasureProbes() const
11521151
#endif
11531152
}
11541153

1155-
using fmt::format;
1156-
11571154
template <ProblemType solver_t>
11581155
template <ProblemType U>
11591156
auto PostOperator<solver_t>::MeasureAndPrintAll(int ex_idx, int step,

0 commit comments

Comments
 (0)