STYLE: qualify Swap with Foam:: prefix (visibility)

- drop unnecessary Foam::Swap specializations when MoveConstructible
  and MoveAssignable already apply. The explicit redirect to swap
  member functions was needed before proper move semantics where
  added.

  Removed specializations: autoPtr, refPtr, tmp, UList.
  Retained specialization: DynamicList, FixedList.

     Special handling for DynamicList is only to accommodate dissimilar
     sizing template parameters (which probably doesn't occur in
     practice).
     Special handling for FixedList to apply element-wise swapping.

- use std::swap for primitives. No need to mask with Foam::Swap wrapper
This commit is contained in:
Mark Olesen
2023-08-11 13:25:51 +02:00
parent fabd3f4e0c
commit eeb9d144e3
22 changed files with 94 additions and 88 deletions

View File

@ -143,10 +143,10 @@ void Foam::fileFormats::ensightMeshReader::setHandedness
// if (((x ^ y) & z) < 0)
// {
// // Flipped hex
// Swap(verts[0], verts[4]);
// Swap(verts[1], verts[5]);
// Swap(verts[2], verts[6]);
// Swap(verts[3], verts[7]);
// std::swap(verts[0], verts[4]);
// std::swap(verts[1], verts[5]);
// std::swap(verts[2], verts[6]);
// std::swap(verts[3], verts[7]);
// }
// }
@ -155,27 +155,27 @@ void Foam::fileFormats::ensightMeshReader::setHandedness
if (verts.size() == 8)
{
// Flipped hex
Swap(verts[0], verts[4]);
Swap(verts[1], verts[5]);
Swap(verts[2], verts[6]);
Swap(verts[3], verts[7]);
std::swap(verts[0], verts[4]);
std::swap(verts[1], verts[5]);
std::swap(verts[2], verts[6]);
std::swap(verts[3], verts[7]);
}
else if (verts.size() == 4)
{
// Flipped tet. Change orientation of base
Swap(verts[0], verts[1]);
std::swap(verts[0], verts[1]);
}
else if (verts.size() == 5)
{
// Flipped pyr. Change orientation of base
Swap(verts[1], verts[3]);
std::swap(verts[1], verts[3]);
}
else if (verts.size() == 6)
{
// Flipped prism.
Swap(verts[0], verts[3]);
Swap(verts[1], verts[4]);
Swap(verts[2], verts[5]);
std::swap(verts[0], verts[3]);
std::swap(verts[1], verts[4]);
std::swap(verts[2], verts[5]);
}
}
}