You can get these estimates without modifying the source code of std::set. In order to count copying and compare operations, enrich the class you're using as element in the set like follows:
class element_set
{
public:
static unsigned no_of_copying_ops;
static unsigned no_of_compare_ops;
element_set(const element_set& x)
{
++unsigned no_of_copying_ops;
...
}
bool operator<(const element_set& x)const
{
++no_of_compare_ops;
...
}
...
};
unsigned element_set::no_of_copying_ops=0;
unsigned element_set::no_of_compare_ops=0;
Hope this helps, good luck. Joaquín M López Muñoz Telefónica, Investigación y Desarrollo