From 2aaae74ee1ab4f0310d4c445312ea1e263c1f353 Mon Sep 17 00:00:00 2001 From: Mark Olesen <Mark.Olesen@esi-group.com> Date: Wed, 30 May 2018 12:11:13 +0200 Subject: [PATCH] STYLE: consistent ordering of "inline explicit" vs. "explicit inline" - resolve in favour of "inline explicit", which had marginally more uses and provides consistent prefixing for inline methods. --- doc/codingStyleGuide.org | 6 +++--- src/OpenFOAM/containers/Bits/PackedList/PackedList.H | 6 +++--- src/OpenFOAM/containers/Bits/bitSet/bitSet.H | 8 ++++---- .../containers/HashTables/HashPtrTable/HashPtrTable.H | 2 +- .../containers/Lists/DynamicList/DynamicList.H | 8 ++++---- src/OpenFOAM/containers/Lists/FixedList/FixedList.H | 10 +++++----- .../containers/Lists/IndirectList/IndirectList.H | 6 +++--- .../containers/Lists/SortableList/SortableList.H | 2 +- .../containers/PtrLists/PtrDynList/PtrDynList.H | 2 +- src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H | 2 +- src/OpenFOAM/containers/PtrLists/UPtrList/UPtrList.H | 4 ++-- src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H | 8 ++++---- src/OpenFOAM/fields/Fields/Field/SubField.H | 2 +- src/OpenFOAM/meshes/boundBox/boundBox.H | 2 +- src/OpenFOAM/meshes/meshShapes/cell/cell.H | 6 +++--- src/OpenFOAM/meshes/meshShapes/face/face.H | 10 +++++----- .../meshes/meshShapes/labelledTri/labelledTri.H | 4 ++-- src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.H | 2 +- src/OpenFOAM/meshes/meshShapes/triFace/triFace.H | 4 ++-- src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.H | 4 ++-- src/OpenFOAM/primitives/hashes/SHA1/SHA1.H | 4 ++-- .../primitives/ranges/scalarRange/scalarRange.H | 2 +- src/OpenFOAM/primitives/strings/lists/hashedWordList.H | 2 +- 23 files changed, 53 insertions(+), 53 deletions(-) diff --git a/doc/codingStyleGuide.org b/doc/codingStyleGuide.org index b8d1b0d98aa..8714c3373ae 100644 --- a/doc/codingStyleGuide.org +++ b/doc/codingStyleGuide.org @@ -86,7 +86,7 @@ // - 0: different // - +1: identical // - -1: same face, but different orientation - static inline int compare(const triFace&, const triFace&); + static int compare(const triFace&, const triFace&); #+end_src or #+begin_src C++ @@ -95,7 +95,7 @@ // - 0: different // - +1: identical // - -1: same face, but different orientation - static inline int compare(const triFace&, const triFace&); + static int compare(const triFace&, const triFace&); #+end_src *not* #+begin_src C++ @@ -103,7 +103,7 @@ // - 0: different // - +1: identical // - -1: same face, but different orientation - static inline int compare(const triFace&, const triFace&); + static int compare(const triFace&, const triFace&); #+end_src + List can be nested for example #+begin_src C++ diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H index 017d7f8e1b1..700ffb6db52 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H @@ -229,7 +229,7 @@ public: inline constexpr PackedList() noexcept; //- Construct for given number of elements, initializes values to 0 - explicit inline PackedList(const label numElem); + inline explicit PackedList(const label numElem); //- Construct for given number of elements, and the specified //- value for each element @@ -245,10 +245,10 @@ public: inline PackedList(PackedList<Width>&& rhs); //- Construct from a list of values - explicit inline PackedList(const labelUList& values); + inline explicit PackedList(const labelUList& values); //- Construct from a list of values - explicit inline PackedList(const labelUIndList& values); + inline explicit PackedList(const labelUIndList& values); //- Clone inline autoPtr<PackedList<Width>> clone() const; diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H index 38b0181a828..9f033ca2976 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H @@ -142,7 +142,7 @@ public: explicit bitSet(Istream& is); //- Construct with given size, with all bits set to 0 - explicit inline bitSet(const label n); + inline explicit bitSet(const label n); //- Construct with given size and value for all elements inline bitSet(const label n, const bool val); @@ -154,7 +154,7 @@ public: inline bitSet(bitSet&& bitset); //- Construct from a list of bools - explicit inline bitSet(const UList<bool>& bools); + inline explicit bitSet(const UList<bool>& bools); //- Construct with given size with all bits set to 0, //- subsequently add specified locations as 1. @@ -170,11 +170,11 @@ public: //- Construct with automatic sizing (filled with 0), //- and populate with specified locations as 1. - explicit inline bitSet(const labelUList& locations); + inline explicit bitSet(const labelUList& locations); //- Construct with automatic sizing (filled with 0), //- and populate with specified locations as 1. - explicit inline bitSet(const labelUIndList& locations); + inline explicit bitSet(const labelUIndList& locations); //- Clone inline autoPtr<bitSet> clone() const; diff --git a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H index 9dedb2a0ff3..990e8537c21 100644 --- a/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H +++ b/src/OpenFOAM/containers/HashTables/HashPtrTable/HashPtrTable.H @@ -96,7 +96,7 @@ public: inline HashPtrTable(); //- Construct given initial table capacity - explicit inline HashPtrTable(const label size); + inline explicit HashPtrTable(const label size); //- Construct from Istream using given Istream constructor class template<class INew> diff --git a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H index 4fa4a0fbb42..055fd7137cf 100644 --- a/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H +++ b/src/OpenFOAM/containers/Lists/DynamicList/DynamicList.H @@ -118,7 +118,7 @@ public: inline constexpr DynamicList() noexcept; //- Construct an empty list with given reserve size. - explicit inline DynamicList(const label nElem); + inline explicit DynamicList(const label nElem); //- Construct with given size and value for all elements. inline DynamicList(const label nElem, const T& val); @@ -135,7 +135,7 @@ public: //- Construct from UList. Size set to UList size. // Also constructs from DynamicList with different sizing parameters. - explicit inline DynamicList(const UList<T>& lst); + inline explicit DynamicList(const UList<T>& lst); //- Construct from a FixedList template<unsigned FixedSize> @@ -147,10 +147,10 @@ public: inline DynamicList(InputIterator begIter, InputIterator endIter); //- Construct from an initializer list. Size set to list size. - explicit inline DynamicList(std::initializer_list<T> lst); + inline explicit DynamicList(std::initializer_list<T> lst); //- Construct from UIndirectList. Size set to UIndirectList size. - explicit inline DynamicList(const UIndirectList<T>& lst); + inline explicit DynamicList(const UIndirectList<T>& lst); //- Move construct. inline DynamicList(DynamicList<T, SizeMin>&& lst); diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H index b6f25a50211..bf954ce2bf0 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H @@ -162,13 +162,13 @@ public: inline FixedList() = default; //- Construct and initialize all entries to given value - explicit inline FixedList(const T& val); + inline explicit FixedList(const T& val); //- Construct and initialize all entries to zero - explicit inline FixedList(const zero); + inline explicit FixedList(const zero); //- Copy construct from C-array - explicit inline FixedList(const T list[Size]); + inline explicit FixedList(const T list[Size]); //- Copy constructor inline FixedList(const FixedList<T, Size>& list); @@ -186,10 +186,10 @@ public: inline FixedList(std::initializer_list<T> list); //- Construct from UList - explicit inline FixedList(const UList<T>& list); + inline explicit FixedList(const UList<T>& list); //- Construct from SLList - explicit inline FixedList(const SLList<T>& list); + inline explicit FixedList(const SLList<T>& list); //- Construct from Istream FixedList(Istream& is); diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H index 6cb2dc576e2..1944b7b1df7 100644 --- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H +++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H @@ -73,10 +73,10 @@ protected: // Constructors //- Copy construct from addressing array - explicit inline IndirectListAddressing(const labelUList& addr); + inline explicit IndirectListAddressing(const labelUList& addr); //- Move construct from addressing array - explicit inline IndirectListAddressing(List<label>&& addr); + inline explicit IndirectListAddressing(List<label>&& addr); // Member Functions @@ -127,7 +127,7 @@ public: //- Copy construct addressing, shallow copy values list reference //- from UIndirectList - explicit inline IndirectList(const UIndirectList<T>& list); + inline explicit IndirectList(const UIndirectList<T>& list); // Member Functions diff --git a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H index c86656ffff6..fe846ead306 100644 --- a/src/OpenFOAM/containers/Lists/SortableList/SortableList.H +++ b/src/OpenFOAM/containers/Lists/SortableList/SortableList.H @@ -69,7 +69,7 @@ public: //- Construct given size, sort later. // The indices remain empty until the list is sorted - explicit inline SortableList(const label size); + inline explicit SortableList(const label size); //- Construct given size and initial value. Sort later on // The indices remain empty until the list is sorted diff --git a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H index c89d4e9f5dd..f2c653973b7 100644 --- a/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H +++ b/src/OpenFOAM/containers/PtrLists/PtrDynList/PtrDynList.H @@ -75,7 +75,7 @@ public: inline constexpr PtrDynList() noexcept; //- Construct with given capacity. - explicit inline PtrDynList(const label len); + inline explicit PtrDynList(const label len); //- Copy construct using 'clone()' method on each element inline PtrDynList(const PtrDynList<T, SizeMin>& list); diff --git a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H index 7cdf1367a00..4ceda992a31 100644 --- a/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H +++ b/src/OpenFOAM/containers/PtrLists/PtrList/PtrList.H @@ -88,7 +88,7 @@ public: inline constexpr PtrList() noexcept; //- Construct with specified size, each element initialized to nullptr - explicit inline PtrList(const label len); + inline explicit PtrList(const label len); //- Copy construct using 'clone()' method on each element inline PtrList(const PtrList<T>& list); diff --git a/src/OpenFOAM/containers/PtrLists/UPtrList/UPtrList.H b/src/OpenFOAM/containers/PtrLists/UPtrList/UPtrList.H index 212adf26e4f..37bb8d97ec3 100644 --- a/src/OpenFOAM/containers/PtrLists/UPtrList/UPtrList.H +++ b/src/OpenFOAM/containers/PtrLists/UPtrList/UPtrList.H @@ -110,7 +110,7 @@ public: inline constexpr UPtrList() noexcept; //- Construct with specified size, each element initialized to nullptr - explicit inline UPtrList(const label len); + inline explicit UPtrList(const label len); //- Copy construct (shallow copies addresses) inline UPtrList(const UPtrList<T>& list); @@ -129,7 +129,7 @@ public: //- Construct from UList, taking the address of each list element // The argument is non-const to reflect that the UPtrList can change // the values of the original list. - explicit inline UPtrList(UList<T>& list); + inline explicit UPtrList(UList<T>& list); // Member functions diff --git a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H index 18559ad7b64..0d4d7c2d454 100644 --- a/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H +++ b/src/OpenFOAM/fields/Fields/DynamicField/DynamicField.H @@ -103,7 +103,7 @@ public: inline constexpr DynamicField() noexcept; //- Construct empty field with given reserve size. - explicit inline DynamicField(const label len); + inline explicit DynamicField(const label len); //- Construct given size and initial value inline DynamicField(const label len, const T& val); @@ -120,13 +120,13 @@ public: //- Copy construct from UList. Size set to UList size. // Also constructs from DynamicField with different sizing parameters. - explicit inline DynamicField(const UList<T>& list); + inline explicit DynamicField(const UList<T>& list); //- Copy construct from UIndirectList - explicit inline DynamicField(const UIndirectList<T>& list); + inline explicit DynamicField(const UIndirectList<T>& list); //- Move construct from List contents - explicit inline DynamicField(List<T>&& content); + inline explicit DynamicField(List<T>&& content); //- Move construct from dynamic Field contents inline DynamicField(DynamicField<T, SizeMin>&& content); diff --git a/src/OpenFOAM/fields/Fields/Field/SubField.H b/src/OpenFOAM/fields/Fields/Field/SubField.H index 1a7fb9cb913..9509a65499f 100644 --- a/src/OpenFOAM/fields/Fields/Field/SubField.H +++ b/src/OpenFOAM/fields/Fields/Field/SubField.H @@ -75,7 +75,7 @@ public: inline SubField(const SubList<Type>&); //- Construct from a UList\<Type\>, using the entire size - explicit inline SubField(const UList<Type>&); + inline explicit SubField(const UList<Type>&); //- Construct from a UList\<Type\> with a given size inline SubField diff --git a/src/OpenFOAM/meshes/boundBox/boundBox.H b/src/OpenFOAM/meshes/boundBox/boundBox.H index a387e74ab79..abba73f8815 100644 --- a/src/OpenFOAM/meshes/boundBox/boundBox.H +++ b/src/OpenFOAM/meshes/boundBox/boundBox.H @@ -85,7 +85,7 @@ public: inline boundBox(); //- Construct a bounding box containing a single initial point - explicit inline boundBox(const point& pt); + inline explicit boundBox(const point& pt); //- Construct from components inline boundBox(const point& min, const point& max); diff --git a/src/OpenFOAM/meshes/meshShapes/cell/cell.H b/src/OpenFOAM/meshes/meshShapes/cell/cell.H index b1269443f3b..6cba1b88664 100644 --- a/src/OpenFOAM/meshes/meshShapes/cell/cell.H +++ b/src/OpenFOAM/meshes/meshShapes/cell/cell.H @@ -67,13 +67,13 @@ public: inline cell(); //- Construct given size, with invalid point labels (-1) - explicit inline cell(const label sz); + inline explicit cell(const label sz); //- Copy construct from list of labels - explicit inline cell(const labelUList& lst); + inline explicit cell(const labelUList& lst); //- Move construct from list of labels - explicit inline cell(labelList&& lst); + inline explicit cell(labelList&& lst); //- Construct from Istream inline cell(Istream& is); diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H index 2691c30f096..61f2060f10a 100644 --- a/src/OpenFOAM/meshes/meshShapes/face/face.H +++ b/src/OpenFOAM/meshes/meshShapes/face/face.H @@ -148,20 +148,20 @@ public: inline face(); //- Construct given size, with invalid point labels (-1) - explicit inline face(const label sz); + inline explicit face(const label sz); //- Copy construct from list of labels - explicit inline face(const labelUList& lst); + inline explicit face(const labelUList& lst); //- Copy construct from list of labels template<unsigned Size> - explicit inline face(const FixedList<label, Size>& lst); + inline explicit face(const FixedList<label, Size>& lst); //- Copy construct from an initializer list of labels - explicit inline face(std::initializer_list<label> lst); + inline explicit face(std::initializer_list<label> lst); //- Move construct from list of labels - explicit inline face(labelList&& lst); + inline explicit face(labelList&& lst); //- Copy construct from triFace face(const triFace& f); diff --git a/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H b/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H index ad7b55ab6de..3f8bb16b684 100644 --- a/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H +++ b/src/OpenFOAM/meshes/meshShapes/labelledTri/labelledTri.H @@ -97,10 +97,10 @@ public: //- Construct from a list of 3 or 4 labels. // Default region is 0. - explicit inline labelledTri(const labelUList&); + inline explicit labelledTri(const labelUList&); //- Construct from an initializer list of 3 or 4 labels. - explicit inline labelledTri(std::initializer_list<label>); + inline explicit labelledTri(std::initializer_list<label>); //- Construct from Istream inline labelledTri(Istream&); diff --git a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.H b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.H index 0208b85aca5..c66712202c0 100644 --- a/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.H +++ b/src/OpenFOAM/meshes/meshShapes/tetCell/tetCell.H @@ -81,7 +81,7 @@ public: inline tetCell(const FixedList<label, 4>& lst); //- Construct from an initializer list of four point labels - explicit inline tetCell(std::initializer_list<label> lst); + inline explicit tetCell(std::initializer_list<label> lst); //- Construct from Istream inline tetCell(Istream& is); diff --git a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H index 442f1bc16d7..68a41feebd5 100644 --- a/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H +++ b/src/OpenFOAM/meshes/meshShapes/triFace/triFace.H @@ -87,10 +87,10 @@ public: ); //- Copy construct from a list of three point labels. - explicit inline triFace(const labelUList& lst); + inline explicit triFace(const labelUList& lst); //- Construct from an initializer list of three point labels - explicit inline triFace(std::initializer_list<label> lst); + inline explicit triFace(std::initializer_list<label> lst); //- Construct from Istream inline triFace(Istream& is); diff --git a/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.H b/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.H index adcac28e035..7177cb020f8 100644 --- a/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.H +++ b/src/OpenFOAM/meshes/treeBoundBox/treeBoundBox.H @@ -162,10 +162,10 @@ public: inline treeBoundBox(); //- Construct from a boundBox - explicit inline treeBoundBox(const boundBox& bb); + inline explicit treeBoundBox(const boundBox& bb); //- Construct a bounding box containing a single initial point - explicit inline treeBoundBox(const point& pt); + inline explicit treeBoundBox(const point& pt); //- Construct from components inline treeBoundBox(const point& min, const point& max); diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H index dfbd26b2cce..1af8c4a2fc9 100644 --- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H +++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H @@ -108,10 +108,10 @@ public: inline SHA1(); //- Construct null and append initial std::string - explicit inline SHA1(const std::string&); + inline explicit SHA1(const std::string&); //- Construct null and append initial string - explicit inline SHA1(const char*); + inline explicit SHA1(const char*); // Member Functions diff --git a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H index 415673ad992..8ab33c987c5 100644 --- a/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H +++ b/src/OpenFOAM/primitives/ranges/scalarRange/scalarRange.H @@ -92,7 +92,7 @@ public: inline scalarRange(); //- Construct an exact value matcher - explicit inline scalarRange(const scalar value); + inline explicit scalarRange(const scalar value); //- Construct a range from min-value to max-value inline scalarRange(const scalar minVal, const scalar maxVal); diff --git a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H index c7a451942e4..4d4089037e3 100644 --- a/src/OpenFOAM/primitives/strings/lists/hashedWordList.H +++ b/src/OpenFOAM/primitives/strings/lists/hashedWordList.H @@ -92,7 +92,7 @@ public: // This also handles a wordHashSet, which is derived from a HashTable. // The result is similar to a HashTable::sortedToc. template<class AnyType, class AnyHash> - explicit inline hashedWordList + inline explicit hashedWordList ( const HashTable<AnyType, word, AnyHash>& tbl ); -- GitLab