Sorry gents but I'm still not clear how the bool operator function relates to the <map> container class. I understand the common element between them is the class X but fail to see how the <map> operates on the bool operator function. The compiler freeks if I remove comment out the bool operator function??
std::map is an associative array that uses an internal binary tree. It must keep all pairs sorted by the key value. Therefore whatever you use as the key_type, in this case the X type, the std::map must be able to compare instances of type X against one another. You'd have the same problem with the std::set if you wanted to fill it with X objects. Read std::map's documentation more closely and study the examples provided on this site.