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)
|
||||
{
|
||||
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
|
||||
{
|
||||
for (const auto& val : v) file<< token::TAB << val;
|
||||
file<< token::TAB << v;
|
||||
}
|
||||
},
|
||||
value
|
||||
@ -311,16 +314,19 @@ bool Foam::functionObjects::fieldStatistics::write()
|
||||
(
|
||||
[name](const auto& v)
|
||||
{
|
||||
if constexpr (std::is_same_v<std::decay_t<decltype(v)>, scalar>)
|
||||
{
|
||||
Info<< ' ' << name << tab << v << nl;
|
||||
}
|
||||
else
|
||||
if constexpr
|
||||
(
|
||||
is_vectorspace_v<std::decay_t<decltype(v)>>
|
||||
)
|
||||
{
|
||||
Info<< ' ' << name << tab;
|
||||
for (const auto& val : v) Info<< val << tab;
|
||||
Info<< nl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< tab << name << tab << v << nl;
|
||||
}
|
||||
},
|
||||
value
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user