mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: add bitSet::operator() for predicate use (as per HashSet)
This commit is contained in:
@ -493,6 +493,10 @@ public:
|
||||
|
||||
// Member Operators
|
||||
|
||||
//- Test value at specified position, same as test()
|
||||
// Enables use as a predicate
|
||||
inline bool operator()(const label pos) const;
|
||||
|
||||
//- Identical to get() - get value at index.
|
||||
// Never auto-vivify entries.
|
||||
inline unsigned int operator[](const label i) const;
|
||||
|
||||
@ -621,6 +621,12 @@ inline Foam::bitSet& Foam::bitSet::extend(const bitSet& other)
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Operators * * * * * * * * * * * * * //
|
||||
|
||||
inline bool Foam::bitSet::operator()(const label pos) const
|
||||
{
|
||||
return test(pos);
|
||||
}
|
||||
|
||||
|
||||
inline unsigned int Foam::bitSet::operator[](const label i) const
|
||||
{
|
||||
return get(i);
|
||||
|
||||
Reference in New Issue
Block a user