From 3151dacccc67073d3f4fffb04adb6591c48bcf04 Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@esi-group.com>
Date: Thu, 1 Dec 2022 15:52:10 +0000
Subject: [PATCH] ENH: include <algorithm> in stdFoam.H

- was already included in many places (via UList.C templates), but now
  formalise by placing in stdFoam.H
---
 applications/test/HashSet/Test-hashSet.C                     | 2 --
 applications/test/List2/Test-List2.C                         | 2 --
 applications/test/List3/Test-List3.C                         | 2 --
 applications/test/base64/Test-base64Encoding.C               | 1 -
 applications/test/bitops/Test-bitops.C                       | 1 -
 applications/test/matrices/EigenMatrix/Test-EigenMatrix.C    | 1 -
 applications/test/matrices/Matrix/Test-Matrix.C              | 1 -
 src/OSspecific/POSIX/regExp/regExpPosixI.H                   | 2 +-
 src/OpenFOAM/algorithms/indexedOctree/treeDataCell.C         | 1 -
 src/OpenFOAM/algorithms/indexedOctree/treeDataEdge.C         | 1 -
 src/OpenFOAM/containers/Bits/BitOps/BitOps.C                 | 1 -
 src/OpenFOAM/containers/Bits/BitOps/BitOps.H                 | 3 ---
 src/OpenFOAM/containers/Bits/bitSet/bitSetTemplates.C        | 1 -
 src/OpenFOAM/containers/HashTables/HashOps/HashOps.C         | 2 --
 src/OpenFOAM/containers/HashTables/HashOps/HashOps.H         | 4 ++--
 src/OpenFOAM/containers/HashTables/HashTable/HashTable.H     | 3 +--
 src/OpenFOAM/containers/Lists/FixedList/FixedList.H          | 3 +--
 src/OpenFOAM/containers/Lists/FixedList/FixedListI.H         | 1 -
 src/OpenFOAM/containers/Lists/List/List.C                    | 1 -
 src/OpenFOAM/containers/Lists/List/UList.C                   | 1 -
 src/OpenFOAM/containers/Lists/List/UList.H                   | 3 +--
 src/OpenFOAM/containers/Lists/UniformList/UniformList.H      | 2 +-
 src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H     | 2 --
 src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C           | 1 -
 src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H           | 2 --
 .../containers/PtrLists/PtrListDetail/PtrListDetail.C        | 1 -
 src/OpenFOAM/db/IOstreams/token/tokenI.H                     | 2 +-
 src/OpenFOAM/fields/Fields/Field/FieldOps.C                  | 1 -
 src/OpenFOAM/global/argList/argList.H                        | 5 ++---
 src/OpenFOAM/include/stdFoam.H                               | 1 +
 src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H              | 5 ++---
 src/OpenFOAM/matrices/Matrix/Matrix.C                        | 1 -
 src/OpenFOAM/matrices/Matrix/Matrix.H                        | 4 ++--
 src/OpenFOAM/matrices/Matrix/MatrixIO.C                      | 1 -
 src/OpenFOAM/meshes/meshShapes/face/face.C                   | 1 -
 src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H            | 1 -
 src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C       | 1 -
 src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H      | 2 --
 src/OpenFOAM/primitives/strings/keyType/keyType.C            | 2 +-
 src/OpenFOAM/primitives/strings/stringOps/stringOps.C        | 1 -
 src/OpenFOAM/primitives/strings/stringOps/stringOps.H        | 5 ++---
 src/OpenFOAM/primitives/tuples/Pair.H                        | 2 +-
 src/conversion/vtk/adaptor/foamVtkTools.H                    | 2 --
 src/fileFormats/abaqus/ABAQUSCore.C                          | 1 -
 .../PatchFunction1/MappedFile/MappedFileFilterField.C        | 1 -
 src/meshTools/indexedOctree/treeDataFace.C                   | 1 -
 src/meshTools/indexedOctree/treeDataPrimitivePatch.C         | 1 -
 src/surfMesh/readers/boundary/boundaryDataSurfaceReader.C    | 1 -
 .../readers/boundary/boundaryDataSurfaceReaderTemplates.C    | 1 -
 .../lumpedPointMotion/bridge/code/polynomial-motion.C        | 1 -
 50 files changed, 19 insertions(+), 70 deletions(-)

diff --git a/applications/test/HashSet/Test-hashSet.C b/applications/test/HashSet/Test-hashSet.C
index c84231f91f1..c412b26523c 100644
--- a/applications/test/HashSet/Test-hashSet.C
+++ b/applications/test/HashSet/Test-hashSet.C
@@ -37,8 +37,6 @@ Description
 #include "labelPairHashes.H"
 #include "FlatOutput.H"
 
-#include <algorithm>
-
 using namespace Foam;
 
 template<class Iter>
diff --git a/applications/test/List2/Test-List2.C b/applications/test/List2/Test-List2.C
index f080ead62c7..b0546178449 100644
--- a/applications/test/List2/Test-List2.C
+++ b/applications/test/List2/Test-List2.C
@@ -40,8 +40,6 @@ Description
 #include "OFstream.H"
 #include "cpuTime.H"
 
-#include <initializer_list>
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 using namespace Foam;
diff --git a/applications/test/List3/Test-List3.C b/applications/test/List3/Test-List3.C
index e23b36579be..c3aaaa4d221 100644
--- a/applications/test/List3/Test-List3.C
+++ b/applications/test/List3/Test-List3.C
@@ -40,8 +40,6 @@ Description
 #include "OFstream.H"
 #include "cpuTime.H"
 
-#include <initializer_list>
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 using namespace Foam;
diff --git a/applications/test/base64/Test-base64Encoding.C b/applications/test/base64/Test-base64Encoding.C
index 7da1707cb87..74dc48894a7 100644
--- a/applications/test/base64/Test-base64Encoding.C
+++ b/applications/test/base64/Test-base64Encoding.C
@@ -39,7 +39,6 @@ Description
 #include "Pair.H"
 
 #include <sstream>
-#include <initializer_list>
 
 using namespace Foam;
 
diff --git a/applications/test/bitops/Test-bitops.C b/applications/test/bitops/Test-bitops.C
index 6f77af14b7d..a198ac5a51e 100644
--- a/applications/test/bitops/Test-bitops.C
+++ b/applications/test/bitops/Test-bitops.C
@@ -33,7 +33,6 @@ Description
 #include "IOstreams.H"
 #include "stdFoam.H"
 
-#include <algorithm>
 #include <type_traits>
 #include <limits>
 
diff --git a/applications/test/matrices/EigenMatrix/Test-EigenMatrix.C b/applications/test/matrices/EigenMatrix/Test-EigenMatrix.C
index c99686591c4..0b7ad7d2f64 100644
--- a/applications/test/matrices/EigenMatrix/Test-EigenMatrix.C
+++ b/applications/test/matrices/EigenMatrix/Test-EigenMatrix.C
@@ -43,7 +43,6 @@ Description
 #include "IOmanip.H"
 #include "EigenMatrix.H"
 #include "TestTools.H"
-#include <algorithm>
 
 using namespace Foam;
 
diff --git a/applications/test/matrices/Matrix/Test-Matrix.C b/applications/test/matrices/Matrix/Test-Matrix.C
index 43115df8713..73d23b5fced 100644
--- a/applications/test/matrices/Matrix/Test-Matrix.C
+++ b/applications/test/matrices/Matrix/Test-Matrix.C
@@ -32,7 +32,6 @@ License
 #include "Random.H"
 #include "SortList.H"
 #include "Switch.H"
-#include <algorithm>
 
 using namespace Foam;
 using namespace Foam::MatrixTools;
diff --git a/src/OSspecific/POSIX/regExp/regExpPosixI.H b/src/OSspecific/POSIX/regExp/regExpPosixI.H
index 4217350c694..a7a97c80d70 100644
--- a/src/OSspecific/POSIX/regExp/regExpPosixI.H
+++ b/src/OSspecific/POSIX/regExp/regExpPosixI.H
@@ -25,7 +25,7 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include <algorithm>
+#include <utility>  // For std::swap
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/algorithms/indexedOctree/treeDataCell.C b/src/OpenFOAM/algorithms/indexedOctree/treeDataCell.C
index f405624f6a2..2a93ba71949 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/treeDataCell.C
+++ b/src/OpenFOAM/algorithms/indexedOctree/treeDataCell.C
@@ -29,7 +29,6 @@ License
 #include "treeDataCell.H"
 #include "indexedOctree.H"
 #include "polyMesh.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/algorithms/indexedOctree/treeDataEdge.C b/src/OpenFOAM/algorithms/indexedOctree/treeDataEdge.C
index 64474327b36..e6f97656302 100644
--- a/src/OpenFOAM/algorithms/indexedOctree/treeDataEdge.C
+++ b/src/OpenFOAM/algorithms/indexedOctree/treeDataEdge.C
@@ -28,7 +28,6 @@ License
 
 #include "treeDataEdge.H"
 #include "indexedOctree.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Bits/BitOps/BitOps.C b/src/OpenFOAM/containers/Bits/BitOps/BitOps.C
index f313812acdb..da0eedc7d6c 100644
--- a/src/OpenFOAM/containers/Bits/BitOps/BitOps.C
+++ b/src/OpenFOAM/containers/Bits/BitOps/BitOps.C
@@ -30,7 +30,6 @@ License
 #include "HashSet.H"
 #include "List.H"
 #include "labelRange.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * * * * BitOps  * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Bits/BitOps/BitOps.H b/src/OpenFOAM/containers/Bits/BitOps/BitOps.H
index 1f57396c389..79ae909c508 100644
--- a/src/OpenFOAM/containers/Bits/BitOps/BitOps.H
+++ b/src/OpenFOAM/containers/Bits/BitOps/BitOps.H
@@ -46,13 +46,10 @@ Description
 #ifndef Foam_BitOps_H
 #define Foam_BitOps_H
 
-#include "label.H"
 #include "UList.H"
 #include "HashSet.H"
 #include "Ostream.H"
-#include <algorithm>
 #include <limits>
-#include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSetTemplates.C b/src/OpenFOAM/containers/Bits/bitSet/bitSetTemplates.C
index b8bc37db865..69cc216d51b 100644
--- a/src/OpenFOAM/containers/Bits/bitSet/bitSetTemplates.C
+++ b/src/OpenFOAM/containers/Bits/bitSet/bitSetTemplates.C
@@ -25,7 +25,6 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include <algorithm>
 #include "FixedList.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/containers/HashTables/HashOps/HashOps.C b/src/OpenFOAM/containers/HashTables/HashOps/HashOps.C
index abd8016acb0..ad70f1c6606 100644
--- a/src/OpenFOAM/containers/HashTables/HashOps/HashOps.C
+++ b/src/OpenFOAM/containers/HashTables/HashOps/HashOps.C
@@ -28,8 +28,6 @@ License
 #include "HashOps.H"
 #include "bitSet.H"
 
-#include <algorithm>
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 Foam::labelHashSet Foam::HashSetOps::used(const bitSet& select)
diff --git a/src/OpenFOAM/containers/HashTables/HashOps/HashOps.H b/src/OpenFOAM/containers/HashTables/HashOps/HashOps.H
index ba54b61440e..73a64f7af8d 100644
--- a/src/OpenFOAM/containers/HashTables/HashOps/HashOps.H
+++ b/src/OpenFOAM/containers/HashTables/HashOps/HashOps.H
@@ -40,8 +40,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef HashOps_H
-#define HashOps_H
+#ifndef Foam_HashOps_H
+#define Foam_HashOps_H
 
 #include "HashSet.H"
 #include "List.H"
diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
index 4f2f17b49d2..2e4549e471a 100644
--- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
+++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H
@@ -84,15 +84,14 @@ SourceFiles
 #ifndef Foam_HashTable_H
 #define Foam_HashTable_H
 
+#include "stdFoam.H"
 #include "word.H"
 #include "zero.H"
 #include "Hash.H"
 #include "HashTableDetail.H"
 #include "HashTableCore.H"
 
-#include <initializer_list>
 #include <iterator>
-#include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
index 2f2d7b2148f..6d172d0df4a 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H
@@ -51,10 +51,9 @@ SourceFiles
 #include "SLListFwd.H"
 #include "ListPolicy.H"
 
-#include <initializer_list>
 #include <iterator>
-#include <type_traits>
 #include <limits>
+#include <type_traits>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
index f2617b3d4e6..c2718e2abae 100644
--- a/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
+++ b/src/OpenFOAM/containers/Lists/FixedList/FixedListI.H
@@ -28,7 +28,6 @@ License
 
 #include "UList.H"
 #include "SLList.H"
-#include <utility>
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 427218b5f03..7286e7054ff 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -32,7 +32,6 @@ License
 #include "PtrList.H"
 #include "SLList.H"
 #include "contiguous.H"
-#include <utility>
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/List/UList.C b/src/OpenFOAM/containers/Lists/List/UList.C
index 6a75e4b6ba1..b4b83b902c5 100644
--- a/src/OpenFOAM/containers/Lists/List/UList.C
+++ b/src/OpenFOAM/containers/Lists/List/UList.C
@@ -31,7 +31,6 @@ License
 #include "contiguous.H"
 #include "labelRange.H"
 
-#include <algorithm>
 #include <random>
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
diff --git a/src/OpenFOAM/containers/Lists/List/UList.H b/src/OpenFOAM/containers/Lists/List/UList.H
index fa511bc9d9e..a2a7ed77c88 100644
--- a/src/OpenFOAM/containers/Lists/List/UList.H
+++ b/src/OpenFOAM/containers/Lists/List/UList.H
@@ -56,10 +56,9 @@ SourceFiles
 #include "Hash.H"
 #include "ListPolicy.H"
 
-#include <initializer_list>
 #include <iterator>
 #include <type_traits>
-#include <vector>
+#include <vector>  // i.e, std::vector
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/Lists/UniformList/UniformList.H b/src/OpenFOAM/containers/Lists/UniformList/UniformList.H
index b3f6a370385..67f6041417e 100644
--- a/src/OpenFOAM/containers/Lists/UniformList/UniformList.H
+++ b/src/OpenFOAM/containers/Lists/UniformList/UniformList.H
@@ -40,7 +40,7 @@ Note
 #define Foam_UniformList_H
 
 #include "labelFwd.H"
-#include <utility>
+#include <utility>  // For std::move
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H
index e22efa3a46b..587bb9163b0 100644
--- a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H
+++ b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H
@@ -43,8 +43,6 @@ SourceFiles
 
 #include "PtrList.H"
 #include <type_traits>
-#include <memory>
-#include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C
index 7df86c8da32..0fe24b1d49f 100644
--- a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C
+++ b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.C
@@ -28,7 +28,6 @@ License
 
 #include "PtrList.H"
 #include "SLPtrList.H"
-#include <utility>
 
 // * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H
index 1c0963a0b41..a7deaa6423b 100644
--- a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H
+++ b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H
@@ -48,8 +48,6 @@ SourceFiles
 
 #include "UPtrList.H"
 #include "SLPtrListFwd.H"
-#include <memory>
-#include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/containers/PtrLists/PtrListDetail/PtrListDetail.C b/src/OpenFOAM/containers/PtrLists/PtrListDetail/PtrListDetail.C
index 0b23ec6e8c1..d236b19b788 100644
--- a/src/OpenFOAM/containers/PtrLists/PtrListDetail/PtrListDetail.C
+++ b/src/OpenFOAM/containers/PtrLists/PtrListDetail/PtrListDetail.C
@@ -26,7 +26,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "PtrListDetail.H"
-#include <utility>
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H
index e863649b733..fe1a5355657 100644
--- a/src/OpenFOAM/db/IOstreams/token/tokenI.H
+++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H
@@ -26,7 +26,7 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include <algorithm>
+#include <utility>  // For std::move, std::swap
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/fields/Fields/Field/FieldOps.C b/src/OpenFOAM/fields/Fields/Field/FieldOps.C
index 4da68f50286..c50b64023a9 100644
--- a/src/OpenFOAM/fields/Fields/Field/FieldOps.C
+++ b/src/OpenFOAM/fields/Fields/Field/FieldOps.C
@@ -27,7 +27,6 @@ License
 
 #include "Pstream.H"
 #include "ops.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/global/argList/argList.H b/src/OpenFOAM/global/argList/argList.H
index bbf4f0f6fbe..ebc3bf836a3 100644
--- a/src/OpenFOAM/global/argList/argList.H
+++ b/src/OpenFOAM/global/argList/argList.H
@@ -96,8 +96,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef argList_H
-#define argList_H
+#ifndef Foam_argList_H
+#define Foam_argList_H
 
 #include "stringList.H"
 #include "SLList.H"
@@ -107,7 +107,6 @@ SourceFiles
 #include "ITstream.H"
 #include "dlLibraryTable.H"
 #include "OSspecific.H"
-#include <utility>
 
 // Transitional features - older style access (including 1712 release)
 #define Foam_argList_1712
diff --git a/src/OpenFOAM/include/stdFoam.H b/src/OpenFOAM/include/stdFoam.H
index 103de7ce456..877c5ef9680 100644
--- a/src/OpenFOAM/include/stdFoam.H
+++ b/src/OpenFOAM/include/stdFoam.H
@@ -32,6 +32,7 @@ Description
 #ifndef Foam_stdFoam_H
 #define Foam_stdFoam_H
 
+#include <algorithm>
 #include <initializer_list>
 #include <memory>
 #include <utility>
diff --git a/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H b/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H
index 619f88a5fed..aa4a02562fc 100644
--- a/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H
+++ b/src/OpenFOAM/matrices/EigenMatrix/EigenMatrix.H
@@ -137,14 +137,13 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef EigenMatrix_H
-#define EigenMatrix_H
+#ifndef Foam_EigenMatrix_H
+#define Foam_EigenMatrix_H
 
 #include "scalarMatrices.H"
 #include "DiagonalMatrix.H"
 #include "SquareMatrix.H"
 #include "complex.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.C b/src/OpenFOAM/matrices/Matrix/Matrix.C
index 0ba61688884..a0234a9d391 100644
--- a/src/OpenFOAM/matrices/Matrix/Matrix.C
+++ b/src/OpenFOAM/matrices/Matrix/Matrix.C
@@ -28,7 +28,6 @@ License
 
 #include "Matrix.H"
 #include <functional>
-#include <algorithm>
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/matrices/Matrix/Matrix.H b/src/OpenFOAM/matrices/Matrix/Matrix.H
index eb34e064d31..235625db3da 100644
--- a/src/OpenFOAM/matrices/Matrix/Matrix.H
+++ b/src/OpenFOAM/matrices/Matrix/Matrix.H
@@ -47,8 +47,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef Matrix_H
-#define Matrix_H
+#ifndef Foam_Matrix_H
+#define Foam_Matrix_H
 
 #include "uLabel.H"
 #include "Pair.H"
diff --git a/src/OpenFOAM/matrices/Matrix/MatrixIO.C b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
index cc3446be1ad..b937e5e393e 100644
--- a/src/OpenFOAM/matrices/Matrix/MatrixIO.C
+++ b/src/OpenFOAM/matrices/Matrix/MatrixIO.C
@@ -32,7 +32,6 @@ License
 #include "token.H"
 #include "contiguous.H"
 #include "ListPolicy.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.C b/src/OpenFOAM/meshes/meshShapes/face/face.C
index f1fe690f301..470e4b7b476 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/face.C
+++ b/src/OpenFOAM/meshes/meshShapes/face/face.C
@@ -31,7 +31,6 @@ License
 #include "triangle.H"
 #include "mathematicalConstants.H"
 #include "Circulator.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H
index fecdf95beec..ea0698f070c 100644
--- a/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H
+++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFaceI.H
@@ -28,7 +28,6 @@ License
 
 #include "IOstreams.H"
 #include "face.H"
-#include <algorithm>  // For std::swap
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C
index bf96a5dd481..c9f47203e52 100644
--- a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C
+++ b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRange.C
@@ -29,7 +29,6 @@ License
 #include "FixedList.H"
 #include "List.H"
 #include "token.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H
index d2445381fe1..b2ae2c151ba 100644
--- a/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H
+++ b/src/OpenFOAM/primitives/ranges/sliceRange/sliceRangeI.H
@@ -25,8 +25,6 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include <algorithm>
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 inline constexpr Foam::sliceRange::sliceRange() noexcept
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyType.C b/src/OpenFOAM/primitives/strings/keyType/keyType.C
index 6749afe42df..15decfb7715 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyType.C
+++ b/src/OpenFOAM/primitives/strings/keyType/keyType.C
@@ -30,7 +30,7 @@ License
 #include "regExp.H"
 #include "token.H"
 #include "IOstreams.H"
-#include <algorithm>  // For swap
+#include <utility>  // For std::swap
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
index 0f646b5d7f7..7947676d983 100644
--- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
+++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
@@ -33,7 +33,6 @@ License
 #include "StringStream.H"
 #include "OSstream.H"
 #include "OSspecific.H"
-#include <algorithm>
 #include <cctype>
 
 // * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
index 29d26b2beeb..14f9c743cec 100644
--- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
+++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
@@ -36,8 +36,8 @@ SourceFiles
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef stringOps_H
-#define stringOps_H
+#ifndef Foam_stringOps_H
+#define Foam_stringOps_H
 
 #include "scalar.H"
 #include "string.H"
@@ -48,7 +48,6 @@ SourceFiles
 #include "stringOpsSort.H"
 #include "stringOpsEvaluate.H"
 #include "wordRes.H"
-#include <utility>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/primitives/tuples/Pair.H b/src/OpenFOAM/primitives/tuples/Pair.H
index eaaf3a93ef0..9548289ac77 100644
--- a/src/OpenFOAM/primitives/tuples/Pair.H
+++ b/src/OpenFOAM/primitives/tuples/Pair.H
@@ -44,7 +44,7 @@ See also
 
 #include "FixedList.H"
 #include "Istream.H"
-#include <utility>
+#include <utility>  // For std::move
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/conversion/vtk/adaptor/foamVtkTools.H b/src/conversion/vtk/adaptor/foamVtkTools.H
index 6a20fe1c74b..4a1a1b3641a 100644
--- a/src/conversion/vtk/adaptor/foamVtkTools.H
+++ b/src/conversion/vtk/adaptor/foamVtkTools.H
@@ -61,8 +61,6 @@ SourceFiles
 #include "vtkPoints.h"
 #include "vtkPolyData.h"
 
-#include <utility>
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // Forward Declarations
diff --git a/src/fileFormats/abaqus/ABAQUSCore.C b/src/fileFormats/abaqus/ABAQUSCore.C
index 056a1891c65..bc478cfa066 100644
--- a/src/fileFormats/abaqus/ABAQUSCore.C
+++ b/src/fileFormats/abaqus/ABAQUSCore.C
@@ -31,7 +31,6 @@ License
 #include "stringOps.H"
 #include "UIListStream.H"
 #include "cellModel.H"
-#include <algorithm>
 #include <cctype>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
diff --git a/src/meshTools/PatchFunction1/MappedFile/MappedFileFilterField.C b/src/meshTools/PatchFunction1/MappedFile/MappedFileFilterField.C
index 59cde08c01e..fd738efbcbe 100644
--- a/src/meshTools/PatchFunction1/MappedFile/MappedFileFilterField.C
+++ b/src/meshTools/PatchFunction1/MappedFile/MappedFileFilterField.C
@@ -31,7 +31,6 @@ License
 #include "MinMax.H"
 #include "indexedOctree.H"
 #include "treeDataPoint.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/meshTools/indexedOctree/treeDataFace.C b/src/meshTools/indexedOctree/treeDataFace.C
index d410b52094f..7be1099a865 100644
--- a/src/meshTools/indexedOctree/treeDataFace.C
+++ b/src/meshTools/indexedOctree/treeDataFace.C
@@ -29,7 +29,6 @@ License
 #include "treeDataFace.H"
 #include "polyMesh.H"
 #include "triangle.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
index 62fac283e6c..74d7a764485 100644
--- a/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
+++ b/src/meshTools/indexedOctree/treeDataPrimitivePatch.C
@@ -31,7 +31,6 @@ License
 #include "triangle.H"
 #include "triSurfaceTools.H"
 #include "triFace.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
diff --git a/src/surfMesh/readers/boundary/boundaryDataSurfaceReader.C b/src/surfMesh/readers/boundary/boundaryDataSurfaceReader.C
index 2f51ee0383b..14030e12050 100644
--- a/src/surfMesh/readers/boundary/boundaryDataSurfaceReader.C
+++ b/src/surfMesh/readers/boundary/boundaryDataSurfaceReader.C
@@ -30,7 +30,6 @@ License
 #include "argList.H"
 #include "Time.H"
 #include "addToRunTimeSelectionTable.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/surfMesh/readers/boundary/boundaryDataSurfaceReaderTemplates.C b/src/surfMesh/readers/boundary/boundaryDataSurfaceReaderTemplates.C
index 84940997381..66b7bb226b5 100644
--- a/src/surfMesh/readers/boundary/boundaryDataSurfaceReaderTemplates.C
+++ b/src/surfMesh/readers/boundary/boundaryDataSurfaceReaderTemplates.C
@@ -29,7 +29,6 @@ License
 #include "rawIOField.H"
 #include "argList.H"
 #include "Time.H"
-#include <algorithm>
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
diff --git a/tutorials/incompressible/lumpedPointMotion/bridge/code/polynomial-motion.C b/tutorials/incompressible/lumpedPointMotion/bridge/code/polynomial-motion.C
index 5c78be00cc8..0a5ba420df5 100644
--- a/tutorials/incompressible/lumpedPointMotion/bridge/code/polynomial-motion.C
+++ b/tutorials/incompressible/lumpedPointMotion/bridge/code/polynomial-motion.C
@@ -45,7 +45,6 @@ Note
 #include "lumpedPointTools.H"
 #include "lumpedPointState.H"
 #include "lumpedPointIOMovement.H"
-#include <algorithm>
 
 using namespace Foam;
 
-- 
GitLab