mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
added HashSet::operator[]() const
- can use the same syntax for boolList, PackedBoolList and labelHashSet
if (myHashedSet[x]) ...
if (myBoolList[x]) ...
if (myPackedList[x]) ...
This commit is contained in:
@ -111,6 +111,33 @@ int main(int argc, char *argv[])
|
||||
Info<< "setD : " << setD << endl;
|
||||
Info<< "setB ^ setC ^ setD : " << (setB ^ setC ^ setD) << endl;
|
||||
|
||||
// test operator[]
|
||||
|
||||
Info<< "setD : " << setD << endl;
|
||||
if (setD[0])
|
||||
{
|
||||
Info<< "setD has 0" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "setD has no 0" << endl;
|
||||
}
|
||||
|
||||
|
||||
if (setD[11])
|
||||
{
|
||||
Info<< "setD has 11" << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "setD has no 0" << endl;
|
||||
}
|
||||
|
||||
Info<< "setD : " << setD << endl;
|
||||
|
||||
// this doesn't work (yet?)
|
||||
// setD[12] = true;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user