SQUASH: 970449: use more convenient type trait checks
This commit is contained in:
parent
7765382f13
commit
864c297104
@ -277,13 +277,16 @@ bool Foam::functionObjects::fieldStatistics::write()
|
|||||||
(
|
(
|
||||||
[&file](const auto& v)
|
[&file](const auto& v)
|
||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<std::decay_t<decltype(v)>, scalar>)
|
if constexpr
|
||||||
|
(
|
||||||
|
is_vectorspace_v<std::decay_t<decltype(v)>>
|
||||||
|
)
|
||||||
{
|
{
|
||||||
file<< token::TAB << v;
|
for (const auto& val : v) file<< token::TAB << val;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (const auto& val : v) file<< token::TAB << val;
|
file<< token::TAB << v;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
value
|
value
|
||||||
@ -311,16 +314,19 @@ bool Foam::functionObjects::fieldStatistics::write()
|
|||||||
(
|
(
|
||||||
[name](const auto& v)
|
[name](const auto& v)
|
||||||
{
|
{
|
||||||
if constexpr (std::is_same_v<std::decay_t<decltype(v)>, scalar>)
|
if constexpr
|
||||||
{
|
(
|
||||||
Info<< ' ' << name << tab << v << nl;
|
is_vectorspace_v<std::decay_t<decltype(v)>>
|
||||||
}
|
)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
Info<< ' ' << name << tab;
|
Info<< ' ' << name << tab;
|
||||||
for (const auto& val : v) Info<< val << tab;
|
for (const auto& val : v) Info<< val << tab;
|
||||||
Info<< nl;
|
Info<< nl;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< tab << name << tab << v << nl;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
value
|
value
|
||||||
);
|
);
|
||||||
|
Loading…
Reference in New Issue
Block a user