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:
Mark Olesen
2009-01-27 21:55:03 +01:00
parent c048dd88c7
commit c6e9b323f5
3 changed files with 37 additions and 1 deletions

View File

@ -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;
}