diff --git a/src/OpenFOAM/primitives/enums/Enum.H b/src/OpenFOAM/primitives/enums/Enum.H index 7d97a89c75..0209099310 100644 --- a/src/OpenFOAM/primitives/enums/Enum.H +++ b/src/OpenFOAM/primitives/enums/Enum.H @@ -101,8 +101,11 @@ public: // Access + //- True if the enumeration list is empty. + inline bool empty() const noexcept; + //- The number of name/value pairs for the enumeration. - inline label size() const; + inline label size() const noexcept; //- The list of enum names, in construction order. Same as toc() inline const List& names() const; diff --git a/src/OpenFOAM/primitives/enums/EnumI.H b/src/OpenFOAM/primitives/enums/EnumI.H index 0b990bed67..9c2e1520c1 100644 --- a/src/OpenFOAM/primitives/enums/EnumI.H +++ b/src/OpenFOAM/primitives/enums/EnumI.H @@ -28,7 +28,14 @@ License // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -inline Foam::label Foam::Enum::size() const +inline bool Foam::Enum::empty() const noexcept +{ + return keys_.empty(); +} + + +template +inline Foam::label Foam::Enum::size() const noexcept { return keys_.size(); }