mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add empty() member for Enum
This commit is contained in:
@ -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<word>& names() const;
|
||||
|
||||
@ -28,7 +28,14 @@ License
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user