COMP: fixup test applications

This commit is contained in:
Mark Olesen
2022-11-30 11:36:40 +00:00
parent f9191b9377
commit 8d4e32da22
12 changed files with 59 additions and 60 deletions

View File

@ -5,7 +5,7 @@
\\ / A nd | www.openfoam.com
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2020 OpenCFD Ltd.
Copyright (C) 2020-2022 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -165,24 +165,24 @@ int main(int argc, char *argv[])
// Use predicate, or test() method
if (list2(1))
if (list2.test(1))
{
Info<< "1 is on (original)" << nl;
}
if (!list2(2))
if (!list2.test(2))
{
Info<< "2 is off (original)" << nl;
}
if (!list2(100))
if (!list2.test(100))
{
Info<< "100 is off (original)" << nl;
}
if (wrapper(1))
if (wrapper.test(1))
{
Info<< "1 is on (wrapped)" << nl;
}
if (!wrapper(2))
if (!wrapper.test(2))
{
Info<< "2 is off (wrapped)" << nl;
}

View File

@ -72,13 +72,13 @@ public:
// Member Functions
//- Is empty
bool empty() const
bool empty() const noexcept
{
return bits_.empty() && bools_.empty();
}
//- Size
label size() const
label size() const noexcept
{
return bits_.size() + bools_.size();
}
@ -93,7 +93,7 @@ public:
bool operator()(const label i) const
{
// Can also use test(i) etc...
return bits_(i) || bools_(i);
return bits_.test(i) || bools_.test(i);
}
};