Skip to content
Snippets Groups Projects
Commit 0ccc005f authored by Mark OLESEN's avatar Mark OLESEN Committed by Andrew Heather
Browse files

ENH: add no-op methods to Nullobject

- empty(), size(), toc(), sortedToc()
parent fb09f56a
Branches
Tags
No related merge requests found
......@@ -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;
}
};
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment