diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H index 47525c617e..f4d01f94dd 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -105,7 +105,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations template class PackedList; class labelRange; @@ -230,7 +230,7 @@ public: // Constructors - //- Null constructor + //- Default construct, zero-sized and no allocation inline constexpr PackedList() noexcept; //- Construct for given number of elements, initializes values to 0 @@ -451,6 +451,7 @@ public: class reference { protected: + friend class PackedList; // Access for parent void operator&() = delete; // Refuse to provide its address @@ -472,10 +473,16 @@ public: public: + //- Copy construct + reference(const reference&) = default; + + //- Move construct + reference(reference&&) = default; + //- Value assignment inline void operator=(const reference& other); - //- Value assignment. + //- Value assignment inline void operator=(const unsigned int val); //- Conversion operator. diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H index a617a9434d..076e4e97a6 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H @@ -5,7 +5,7 @@ \\ / A nd | www.openfoam.com \\/ M anipulation | ------------------------------------------------------------------------------- - Copyright (C) 2018-2019 OpenCFD Ltd. + Copyright (C) 2018-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -54,7 +54,7 @@ See also namespace Foam { -// Forward declarations +// Forward Declarations class bitSet; class labelRange; @@ -131,13 +131,14 @@ public: class const_iterator; typedef unsigned int const_reference; - //- Define class name and debug + + //- Declare type-name (with debug switch) ClassName("bitSet"); // Constructors - //- Construct an empty, zero-sized set + //- Default construct an empty, zero-sized set inline bitSet() noexcept; //- Construct from Istream @@ -438,6 +439,7 @@ public: public PackedList<1>::reference { protected: + friend class bitSet; // Access for parent void operator&() = delete; // Refuse to provide its address @@ -447,6 +449,12 @@ public: public: + //- Copy construct + reference(const reference&) = default; + + //- Move construct + reference(reference&&) = default; + //- Flip the bit at the position, no range-checking inline void flip(); @@ -474,7 +482,7 @@ public: //- Global position of the current \a on bit label pos_; - //- Construct null - an end iterator + //- Default construct - an end iterator inline const_iterator() noexcept; //- Construct begin iterator diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 9fc07ea5e8..3f15e87c25 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -206,7 +206,7 @@ public: // Constructors - //- Construct null with default (128) table capacity + //- Default construct with default (128) table capacity HashTable(); //- Construct given initial table capacity @@ -550,6 +550,7 @@ protected: class Iterator { public: + // Typedefs using iterator_category = std::forward_iterator_tag; using difference_type = this_type::difference_type; @@ -671,6 +672,7 @@ public: public Iterator { public: + // Typedefs using iterator_category = std::forward_iterator_tag; using difference_type = this_type::difference_type; @@ -684,8 +686,8 @@ public: // Constructors - //- Construct null (end iterator) - inline iterator() = default; + //- Default construct (end iterator) + iterator() = default; //- Copy construct from similar access type inline explicit iterator(const Iterator& iter) @@ -729,6 +731,7 @@ public: public Iterator { public: + // Typedefs using iterator_category = std::forward_iterator_tag; using difference_type = this_type::difference_type; @@ -741,8 +744,11 @@ public: // Constructors - //- Construct null (end iterator) - inline const_iterator() = default; + //- Default construct (end iterator) + const_iterator() = default; + + //- Copy construct + const_iterator(const const_iterator&) = default; //- Copy construct from similar access type inline explicit const_iterator(const Iterator& iter) @@ -781,8 +787,10 @@ public: inline const_iterator& operator++(); inline const_iterator operator++(int); + // Assignment + //- Copy assignment const_iterator& operator=(const const_iterator&) = default; // Allow assign from iterator to const_iterator @@ -805,6 +813,7 @@ public: public Iter { public: + using value_type = this_type::key_type; using reference = const Key&; diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H index 3c8bff4203..54f6a6276c 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -72,7 +72,7 @@ public: //- Pointer to next entry in list link* next_ = nullptr; - //- Null construct + //- Default construct link() = default; //- Check if the node is registered with the list @@ -85,7 +85,7 @@ public: private: - // Private Member Data + // Private Data //- Pointer to first element link *first_ = nullptr; @@ -97,15 +97,6 @@ private: label size_ = 0; - // Private Member Functions - - //- No copy construct - DLListBase(const DLListBase&) = delete; - - //- No copy assignment - void operator=(const DLListBase&) = delete; - - protected: // Protected Member Functions @@ -142,14 +133,19 @@ public: friend class const_iterator; - // Constructors + // Generated Methods - //- Null construct + //- Default construct DLListBase() = default; + //- No copy construct + DLListBase(const DLListBase&) = delete; - //- Destructor - ~DLListBase() = default; + //- No copy assignment + void operator=(const DLListBase&) = delete; + + //- Destructor + ~DLListBase() = default; // Member Functions @@ -233,6 +229,9 @@ public: public: + //- Copy construct + iterator(const iterator&) = default; + //- Construct for a node on a list inline iterator(DLListBase* list, link* item); @@ -280,15 +279,15 @@ public: public: + //- Copy construct + const_iterator(const const_iterator&) = default; + //- Construct for a node on a list inline const_iterator(const DLListBase* list, const link* item); //- Copy construct from a non-const iterator inline const_iterator(const DLListBase::iterator& iter); - //- Copy construct - const_iterator(const const_iterator&) = default; - //- The storage node inline const link* get_node() const; @@ -308,6 +307,7 @@ public: //- Move forward through list inline void next(); + //- Copy assignment const_iterator& operator=(const const_iterator&) = default; inline bool operator==(const const_iterator&) const; diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H index ccc7c9ab97..53e2b16da6 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -69,14 +69,14 @@ public: //- Pointer to next entry in list link* next_ = nullptr; - //- Null construct + //- Default construct link() = default; }; private: - // Private Member Data + // Private Data //- A pointer to the last element. // last_->next_ points to first element, i.e. circular storage @@ -86,15 +86,6 @@ private: label size_ = 0; - // Private Member Functions - - //- No copy construct - SLListBase(const SLListBase&) = delete; - - //- No copy assignment - void operator=(const SLListBase&) = delete; - - protected: // Protected Member Functions @@ -130,14 +121,19 @@ public: friend class const_iterator; - // Constructors + // Generated Methods - //- Null construct + //- Default construct SLListBase() = default; + //- No copy construct + SLListBase(const SLListBase&) = delete; - //- Destructor - ~SLListBase() = default; + //- No copy assignment + void operator=(const SLListBase&) = delete; + + //- Destructor + ~SLListBase() = default; // Member Functions @@ -209,6 +205,9 @@ public: public: + //- Copy construct + iterator(const iterator&) = default; + //- Construct for a node on the list inline iterator(SLListBase* list, link* item); @@ -231,6 +230,7 @@ public: //- Move forward through list inline void next(); + //- Copy assignment inline void operator=(const iterator& iter); inline bool operator==(const iterator& iter) const; @@ -254,15 +254,15 @@ public: public: + //- Copy construct + const_iterator(const const_iterator&) = default; + //- Construct for a node on the list inline const_iterator(const SLListBase* list, const link* item); //- Construct from a non-const iterator inline const_iterator(const SLListBase::iterator& iter); - //- Copy construct - const_iterator(const const_iterator&) = default; - //- The storage node inline const link* get_node() const; @@ -282,6 +282,7 @@ public: //- Move forward through list inline void next(); + //- Copy assignment const_iterator& operator=(const const_iterator&) = default; inline bool operator==(const const_iterator& iter) const; @@ -306,7 +307,6 @@ public: //- No reverse iteration const const_iterator& crend() const = delete; - }; diff --git a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H index 2f5e0b1e95..5c7ef7f958 100644 --- a/src/OpenFOAM/containers/Lists/FixedList/FixedList.H +++ b/src/OpenFOAM/containers/Lists/FixedList/FixedList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -135,7 +135,7 @@ public: typedef std::reverse_iterator const_reverse_iterator; - // Static Member Functions + // Static Functions //- Return a null FixedList inline static const FixedList& null(); @@ -143,8 +143,8 @@ public: // Constructors - //- Null constructor - inline FixedList() = default; + //- Default construct + FixedList() = default; //- Construct and initialize all entries to given value inline explicit FixedList(const T& val); @@ -155,7 +155,7 @@ public: //- Copy construct from C-array inline explicit FixedList(const T list[N]); - //- Copy constructor + //- Copy construct inline FixedList(const FixedList& list); //- Move construct by using move assignment for the individual diff --git a/src/OpenFOAM/containers/Lists/SubList/SubList.H b/src/OpenFOAM/containers/Lists/SubList/SubList.H index 4d9773d706..02ab2d896e 100644 --- a/src/OpenFOAM/containers/Lists/SubList/SubList.H +++ b/src/OpenFOAM/containers/Lists/SubList/SubList.H @@ -6,7 +6,7 @@ \\/ M anipulation | ------------------------------------------------------------------------------- Copyright (C) 2011-2016 OpenFOAM Foundation - Copyright (C) 2017-2019 OpenCFD Ltd. + Copyright (C) 2017-2020 OpenCFD Ltd. ------------------------------------------------------------------------------- License This file is part of OpenFOAM. @@ -50,7 +50,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations template class SubList; // Common list types @@ -70,12 +70,18 @@ class SubList { public: - // Static Member Functions + // Static Functions //- Return a null SubList inline static const SubList& null(); + // Generated Methods + + //- Copy construct + SubList(const SubList&) = default; + + // Constructors //- Construct from UList, the entire size @@ -122,7 +128,7 @@ public: //- Copy assign entries from given sub-list inline void operator=(const SubList& list); - //- Copy assign entries to the given list + //- Copy assign entries from given list inline void operator=(const UList& list); //- Assign all entries to the given value diff --git a/src/OpenFOAM/containers/Lists/UList/UList.H b/src/OpenFOAM/containers/Lists/UList/UList.H index 3ce31eb20b..c8c131ba85 100644 --- a/src/OpenFOAM/containers/Lists/UList/UList.H +++ b/src/OpenFOAM/containers/Lists/UList/UList.H @@ -66,7 +66,7 @@ SourceFiles namespace Foam { -// Forward declarations +// Forward Declarations class labelRange; template class List; template class SubList; @@ -87,7 +87,7 @@ typedef UList