
8 Dec
2006
8 Dec
'06
2:02 p.m.
fungos wrote:
Nice! const_mem_fun worked in this sample. I will try to port my map to multi_index now and see how it performs. But, I dont want to give up without understund why mem_fun doesnt work. Anybody has any theory? :D
IIRC, you are only allowed access to the const interface of items held by multi_index containers. Non-const methods by definition mutate the object upon which they act, which could change the item's state upon which the sort order is based. That is why you must use multi_index's update functions to modify the state of any of it's items. Jeff Flinn