diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H index 73527710283236696752e2f3b49690e26910811b..ac5fbbd738d9f670841425de2e1ab45e1b9a3388 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSet.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSet.H @@ -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; diff --git a/src/OpenFOAM/containers/Bits/bitSet/bitSetI.H b/src/OpenFOAM/containers/Bits/bitSet/bitSetI.H index 454fc2b76c69e43e8f0fa3663e93487b28f8084b..f2e648ca3ff1449fda1fb27957e1fcf061def172 100644 --- a/src/OpenFOAM/containers/Bits/bitSet/bitSetI.H +++ b/src/OpenFOAM/containers/Bits/bitSet/bitSetI.H @@ -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);