ENH: add bitSet found() method - method name compatibility with HashSet

This commit is contained in:
Mark Olesen
2020-11-17 10:42:38 +01:00
parent 146a1d1b67
commit 54139592b9
2 changed files with 12 additions and 1 deletions

View File

@ -244,6 +244,11 @@ public:
// \note Method name compatibility with std::bitset
inline bool test(const label pos) const;
//- Test value at specified position, never auto-vivify entries.
//
// \note Method name compatibility with HashSet
inline bool found(const label pos) const;
//- Locate the first bit that is set.
// \return the location or -1 if there are no bits set.
//

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018-2019 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -515,6 +515,12 @@ inline bool Foam::bitSet::test(const label pos) const
}
inline bool Foam::bitSet::found(const label pos) const
{
return get(pos);
}
inline Foam::labelList Foam::bitSet::sortedToc() const
{
return toc();