Skip to content
Snippets Groups Projects
Commit 622808c7 authored by Mark OLESEN's avatar Mark OLESEN
Browse files

ENH: add empty() member for Enum

parent e247e063
No related branches found
No related tags found
No related merge requests found
...@@ -101,8 +101,11 @@ public: ...@@ -101,8 +101,11 @@ public:
// Access // Access
//- True if the enumeration list is empty.
inline bool empty() const noexcept;
//- The number of name/value pairs for the enumeration. //- 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() //- The list of enum names, in construction order. Same as toc()
inline const List<word>& names() const; inline const List<word>& names() const;
......
...@@ -28,7 +28,14 @@ License ...@@ -28,7 +28,14 @@ License
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
template<class EnumType> template<class EnumType>
inline Foam::label Foam::Enum<EnumType>::size() const inline bool Foam::Enum<EnumType>::empty() const noexcept
{
return keys_.empty();
}
template<class EnumType>
inline Foam::label Foam::Enum<EnumType>::size() const noexcept
{ {
return keys_.size(); return keys_.size();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment