Associative containers and Two comparison Functions

Hi Item 19 of effective STL advices us to learn the difference between the equivalence and equality in STL containers.

In short, the author says that, equivalence is based on the comparison functions and therefore if two elements in an associative container is to be called equivalent, then both of them have to be in the same position. In other words, the locality of the objects are same both. a is equivalent to b if a = b not by state but say they are refences

By equality, the say a and b could be pointers to different elements and a is equal to b if their states are exactly same

Then they go on to describe the disadvantages of an associative container having two different functions for comparison (equivalence) and equality

they say set<string, Comparionfunction,equalityfunction> will cause a lot of problems. I am not able to understand what problems would such a container leads to.

Would be great if someone could help!
The problem is that it would mess with the container's ability to do what you want. Read more:
http://hi.baidu.com/yesbaba/blog/item/572ec08b2cbc647b9e2fb4fb.html
(Good luck!)
Topic archived. No new replies allowed.