PackedList bugfix, HashTable tweak

- it was possible to create a PackedList::iterator from a
  PackedList::const_iterator and violate const-ness

- added HashTable::printInfo for emitting some information

- changed default table sizes from 100 -> 128 in preparation for future
  2^n table sizes
This commit is contained in:
Mark Olesen
2009-02-26 15:32:47 +01:00
parent e562aecb73
commit 2aeee852e8
17 changed files with 159 additions and 34 deletions

View File

@ -38,10 +38,11 @@ int main(int argc, char *argv[])
{
string test("$HOME kjhkjhkjh \" \\$HOME/tyetyery ${FOAM_RUN} \n ; hkjh ;$");
Info<< test << endl;
Info<< "string:" << test << nl << "hash:"
<< unsigned(string::hash()(test)) << endl;
// test sub-strings via iterators
string::const_iterator iter = test.end();
string::const_iterator iter = test.end();
string::const_iterator iter2 = test.end();
string::size_type fnd = test.find('\\');
@ -77,6 +78,8 @@ int main(int argc, char *argv[])
cout<< "output string with " << s2.length() << " characters\n";
cout<< "ostream<< >" << s2 << "<\n";
Info<< "Ostream<< >" << s2 << "<\n";
Info<< "hash:" << unsigned(string::hash()(s2)) << endl;
Info << "End\n" << endl;