> easy. But 2 is not supported as far as I could see. Without knowing the > implementation details, I wonder why. It wouldn't be hard to put "counters" > into the nodes of the red-black-tree, which count the number of children. > But it seems this is not implemented.
why it should be supported - isnt it in the nature of "set" the elements are in no particular order and to offer i-th member API just because set is implemented by rb-tree is imho no good design. unfortunately i'm not aware of any standard stl class offering just 'balanced tree' api which would be enough for your requirements (namely 2). btw why we need (2)? pavel