ENH: add bitSet::null() and clarify some documentation

- the NullObject singleton can also be cast to a bitSet
  (sufficient size and bit-pattern). Useful for places that
  need to hold a reference on construction
This commit is contained in:
Mark Olesen
2020-12-04 15:53:47 +01:00
parent 08efeb1a03
commit a939042e1b
6 changed files with 228 additions and 2 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2018 OpenCFD Ltd.
Copyright (C) 2018-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -164,6 +164,23 @@ inline bool compare
int main(int argc, char *argv[])
{
Info<< "bitSet::null()" << nl
<< "sizeof : " << sizeof(bitSet::null()) << " bytes" << nl;
info(bitSet::null());
{
bitSet emptySet;
info(emptySet);
extent(emptySet);
emptySet.resize(10);
info(emptySet);
extent(emptySet);
}
Info<< nl << "Tests" << nl;
bitSet list1(22);
// Set every third one on
forAll(list1, i)