Commit 2c44ac29 authored by Mark Olesen's avatar Mark Olesen
Browse files

ENH: add bitSet::operator() for predicate use (as per HashSet)

parent 2fb382bf
......@@ -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);
......
Markdown is supported
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