diff --git a/src/OSspecific/POSIX/regExp/regExpPosix.H b/src/OSspecific/POSIX/regExp/regExpPosix.H index 86c6147538..84808e8d76 100644 --- a/src/OSspecific/POSIX/regExp/regExpPosix.H +++ b/src/OSspecific/POSIX/regExp/regExpPosix.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2004-2011, 2017-2018 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2004-2011, 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2017 OpenFOAM Foundation @@ -125,14 +125,15 @@ public: // Access //- Return true if a precompiled expression does not exist - inline bool empty() const; + inline bool empty() const noexcept; //- Return true if a precompiled expression exists - inline bool exists() const; + inline bool exists() const noexcept; //- The number of capture groups for a non-empty expression inline unsigned ngroups() const; + // Editing //- Clear expression. @@ -150,6 +151,7 @@ public: // \return True if the pattern was compiled bool set(const std::string& pattern, bool ignoreCase=false); + // Matching/Searching //- Find position within the text. diff --git a/src/OSspecific/POSIX/regExp/regExpPosixI.H b/src/OSspecific/POSIX/regExp/regExpPosixI.H index 75f8482506..cd134153bc 100644 --- a/src/OSspecific/POSIX/regExp/regExpPosixI.H +++ b/src/OSspecific/POSIX/regExp/regExpPosixI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -98,15 +98,15 @@ inline Foam::regExpPosix::~regExpPosix() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -inline bool Foam::regExpPosix::empty() const +inline bool Foam::regExpPosix::empty() const noexcept { return !preg_; } -inline bool Foam::regExpPosix::exists() const +inline bool Foam::regExpPosix::exists() const noexcept { - return preg_ ? true : false; + return preg_; } diff --git a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H index fe9f32e6f7..8e3b25a962 100644 --- a/src/OpenFOAM/containers/Bits/PackedList/PackedList.H +++ b/src/OpenFOAM/containers/Bits/PackedList/PackedList.H @@ -283,7 +283,7 @@ public: //- Number of entries. inline label size() const noexcept; - //- Return true if the list is empty (ie, size() is zero). + //- True if the list is empty (ie, size() is zero). inline bool empty() const noexcept; //- The number of elements that can be stored with reallocating diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H index 84a643a649..e138e3ff50 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTable.H @@ -233,13 +233,13 @@ public: // Access //- The size of the underlying table - inline label capacity() const; + inline label capacity() const noexcept; - //- Return number of elements in table - inline label size() const; + //- The number of elements in table + inline label size() const noexcept; - //- Return true if the hash table is empty - inline bool empty() const; + //- True if the hash table is empty + inline bool empty() const noexcept; //- Find and return a hashed entry. FatalError if it does not exist. inline T& at(const Key& key); diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.H index 7e02b89f9c..4bee86d202 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCore.H @@ -62,8 +62,7 @@ struct HashTableCore static label canonicalSize(const label requested_size); //- Construct null - HashTableCore() - {} + HashTableCore() = default; //- Define template name and debug ClassName("HashTable"); @@ -105,8 +104,8 @@ struct HashTableCore inline const_iterator_pair(const TableType& tbl); - inline label size() const; - inline bool empty() const; + label size() const noexcept { return size_; } + bool empty() const noexcept { return !size_; } inline IteratorType begin() const; inline IteratorType cbegin() const; diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCoreI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCoreI.H index 1e59a0baa5..6e1e1f7922 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableCoreI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableCoreI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2017 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2017-2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -73,22 +73,6 @@ inline Foam::HashTableCore::const_iterator_pair {} -template -inline Foam::label -Foam::HashTableCore::const_iterator_pair::size() const -{ - return size_; -} - - -template -inline bool -Foam::HashTableCore::const_iterator_pair::empty() const -{ - return !size_; -} - - template inline IteratorType Foam::HashTableCore::const_iterator_pair < diff --git a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H index d2b70816d2..250dae6515 100644 --- a/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H +++ b/src/OpenFOAM/containers/HashTables/HashTable/HashTableI.H @@ -41,21 +41,21 @@ Foam::HashTable::hashKeyIndex(const Key& key) const // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::label Foam::HashTable::capacity() const +inline Foam::label Foam::HashTable::capacity() const noexcept { return capacity_; } template -inline Foam::label Foam::HashTable::size() const +inline Foam::label Foam::HashTable::size() const noexcept { return size_; } template -inline bool Foam::HashTable::empty() const +inline bool Foam::HashTable::empty() const noexcept { return !size_; } diff --git a/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectList.H b/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectList.H index 833445c82b..6d5307d1d0 100644 --- a/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectList.H +++ b/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -83,11 +83,11 @@ public: // Access - //- Return the number of elements in the list - inline label size() const; + //- The number of elements in the list + inline label size() const noexcept; - //- Return true if the list is empty (ie, size() is zero). - inline bool empty() const; + //- True if the list is empty (ie, size() is zero). + inline bool empty() const noexcept; inline const UList& posList() const; inline const UList& negList() const; diff --git a/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectListI.H b/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectListI.H index c930e522e9..5c3572eb04 100644 --- a/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectListI.H +++ b/src/OpenFOAM/containers/IndirectLists/BiIndirectList/BiIndirectListI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -74,14 +74,14 @@ inline Foam::BiIndirectList::BiIndirectList // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::label Foam::BiIndirectList::size() const +inline Foam::label Foam::BiIndirectList::size() const noexcept { return addressing_.size(); } template -inline bool Foam::BiIndirectList::empty() const +inline bool Foam::BiIndirectList::empty() const noexcept { return addressing_.empty(); } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H index e6bb07cd9f..33f1047a31 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBase.H @@ -153,11 +153,11 @@ public: // Member Functions - //- Return number of elements in list - inline label size() const; + //- The number of elements in list + inline label size() const noexcept; - //- Return true if the list is empty - inline bool empty() const; + //- True if the list is empty + inline bool empty() const noexcept; //- Return first entry inline link* first(); diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H index 4317b0ccad..dcf8fa4f4a 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/DLListBase/DLListBaseI.H @@ -110,13 +110,13 @@ inline void Foam::DLListBase::link::deregister() } -inline Foam::label Foam::DLListBase::size() const +inline Foam::label Foam::DLListBase::size() const noexcept { return size_; } -inline bool Foam::DLListBase::empty() const +inline bool Foam::DLListBase::empty() const noexcept { return !size_; } diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H index c48913e399..b39c28d646 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBase.H @@ -141,11 +141,11 @@ public: // Member Functions - //- Return number of elements in list - inline label size() const; + //- The number of elements in list + inline label size() const noexcept; - //- Return true if the list is empty - inline bool empty() const; + //- True if the list is empty + inline bool empty() const noexcept; //- Return first entry inline link* first(); diff --git a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H index 761c6ae72a..1cb940765d 100644 --- a/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H +++ b/src/OpenFOAM/containers/LinkedLists/linkTypes/SLListBase/SLListBaseI.H @@ -69,13 +69,13 @@ inline IteratorType Foam::SLListBase::iterator_last() const // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -inline Foam::label Foam::SLListBase::size() const +inline Foam::label Foam::SLListBase::size() const noexcept { return size_; } -inline bool Foam::SLListBase::empty() const +inline bool Foam::SLListBase::empty() const noexcept { return !size_; } diff --git a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.H b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.H index db45421c7e..35406b920a 100644 --- a/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.H +++ b/src/OpenFOAM/containers/Lists/CompactListList/CompactListList.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | + \\ / A nd | Copyright (C) 2019 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- | Copyright (C) 2011-2016 OpenFOAM Foundation @@ -141,11 +141,11 @@ public: // Access - //- Return the primary size, i.e. the number of rows - inline label size() const; + //- The primary size (the number of rows) + inline label size() const noexcept; - //- Return true if the number of rows is zero - inline bool empty() const; + //- True if the number of rows is zero + inline bool empty() const noexcept; //- Return the offset table (= size()+1) inline const List