On 16/11/2009 00:16, Steven Schveighoffer wrote:
On Sun, 15 Nov 2009 15:53:08 -0500, BLS <windev...@hotmail.de> wrote:
==
Now : Sorry for my ignorance ... but Why the heck :
struct RBNode(V)
instead of :
struct RBNode(K, V)
It was my way of providing the exact same implementation for TreeMap,
TreeSet, and TreeMultiSet (same deal between HashMap and HashSet, and
HashMultiSet). TreeSet and TreeMultiSet have no keys, so the basic
difference between them is the comparator function for TreeMap (which is
passed in by the class to the impl) compares only the keys.
So hopefully, if you create a specialized implementation for TreeMap, it
can be fed into TreeSet and TreeMultiSet, and you get 3 containers for
the price of one :)
If you can think of a better way, I would be glad to consider it.
-Steve
Ok I see. Becomes also clear : that
struct RBNode(V) : INode(V) would make sense..
-Björn