mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
HashSet enhancement
- allow insert() and set() from a UList of Key This complements the existing erase(const UList<Key>&) method
This commit is contained in:
@ -92,6 +92,8 @@ int main(int argc, char *argv[])
|
||||
labelHashSet setD(1);
|
||||
setD.insert(11);
|
||||
setD.insert(100);
|
||||
setD.insert(49);
|
||||
setD.insert(36);
|
||||
setD.insert(2008);
|
||||
|
||||
Info<< "setD : " << setD << endl;
|
||||
@ -138,6 +140,17 @@ int main(int argc, char *argv[])
|
||||
// this doesn't work (yet?)
|
||||
// setD[12] = true;
|
||||
|
||||
List<label> someLst(10);
|
||||
forAll(someLst, elemI)
|
||||
{
|
||||
someLst[elemI] = elemI*elemI;
|
||||
}
|
||||
|
||||
label added = setD.set(someLst);
|
||||
Info<< "added " << added << " from " << someLst.size() << endl;
|
||||
Info<< "setD : " << setD << endl;
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user