Added scapegoat trees and an option to store the hash value in the hook for unordered containers

[SVN r41196]
This commit is contained in:
Ion Gaztañaga
2007-11-18 10:44:56 +00:00
parent f4992b8b14
commit 15de4da451
44 changed files with 1987 additions and 1958 deletions
+3 -5
View File
@@ -37,7 +37,7 @@ class MyClass : public set_base_hook<optimize_size<true> >
{ return a.int_ < b.int_; }
};
//Define an set using the base hook that will store values in reverse order
//Define a set using the base hook that will store values in reverse order
typedef set< MyClass, compare<std::greater<MyClass> > > BaseSet;
//Define an multiset using the member hook
@@ -62,12 +62,10 @@ int main()
assert(sizeof(set_member_hook<>) > 3*sizeof(void*));
//Now insert them in the reverse order in the base hook set
for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it){
baseset.insert(*it);
//Now insert them in the same order as in vector in the member hook set
for(VectIt it(values.begin()), itend(values.end()); it != itend; ++it)
membermultiset.insert(*it);
}
//Now test sets
{