ENH: relocate sortedOrder from ListOps.H to List.H

- commonly used, only depends on routines defined in UList
  (don't need the rest of ListOps for it).

ENH: implement boolList::operator() const

- allows use as a predicate functor, as per bitSet and labelHashSet

GIT: combine SubList, UList into List directory (intertwined concepts)

STYLE: default initialize DynamicList instead of with size 0
This commit is contained in:
Mark Olesen
2022-05-04 00:33:53 +02:00
parent cb6f908798
commit bf0b3d8872
26 changed files with 200 additions and 147 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.
@ -32,8 +32,8 @@ Description
\*---------------------------------------------------------------------------*/
#ifndef bitSetOrBoolList_H
#define bitSetOrBoolList_H
#ifndef Foam_bitSetOrBoolList_H
#define Foam_bitSetOrBoolList_H
#include "bitSet.H"
#include "boolList.H"
@ -88,6 +88,13 @@ public:
{
return bits_.test(i) || bools_.test(i);
}
//- Test predicate
bool operator()(const label i) const
{
// Can also use test(i) etc...
return bits_(i) || bools_(i);
}
};