ENH: add no-op methods to Nullobject
- empty(), size(), toc(), sortedToc()
This commit is contained in:
parent
fb09f56aba
commit
0ccc005fe6
@ -48,10 +48,9 @@ SourceFiles
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// Forward declarations
|
||||
// Forward Declarations
|
||||
class Istream;
|
||||
class Ostream;
|
||||
|
||||
class NullObject;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
@ -111,6 +110,30 @@ public:
|
||||
{
|
||||
return data_[0].val;
|
||||
}
|
||||
|
||||
//- No elements
|
||||
inline constexpr bool empty() const
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
//- Zero elements
|
||||
inline constexpr label size() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
//- No-op method (for HashTable replacement)
|
||||
inline const NullObject& toc() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
|
||||
//- No-op method (for HashTable replacement)
|
||||
inline const NullObject& sortedToc() const
|
||||
{
|
||||
return *this;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user