48 int main(
int argc,
char **argv)
58 JParser<> zap(
"Example program to test hash set.");
66 catch(
const exception &error) {
67 FATAL(error.what() << endl);
77 if (inputFile !=
"") {
79 DEBUG(
"Reading " << inputFile <<
"... " << flush);
91 for (
int i = 1<<10; i != 0; i >>= 1) {
92 buffer.insert(__A__(i));
95 buffer.erase(buffer.find(1<<2), buffer.find(1<<4));
97 if (!buffer.erase(1<<4)) {
98 FATAL(
"Erasing value failed." << endl);
102 for (hash_set::const_iterator i = buffer.begin(); i != buffer.end(); ++i) {
104 cout << setw(4) << *i;
107 hash_set::const_iterator p = buffer.find(*i);
109 if (p != buffer.end())
110 cout << setw(4) << *p << endl;
112 FATAL(
"Inconsistent has set at " << *i << endl);