Bimap compare function

3 May
2012
3 May
'12
9:30 p.m.
I noticed that the comparator for a bimap can only be a Functor Type. It does not appear that I can pass a function object or a function pointer, as a STL Set would allow. Is this correct or did I miss something. For my application I could really use the ability to pass in comparator which is decided at runtime. Does anyone have any suggestions on a work around?

5 May
5 May
3:38 a.m.
I'm not familiar with bimap, but is there a reason you can't wrap a function pointer (that can change at runtime) in a functor? Something like: typedef int (*function_type)(int); struct my_functor { function_type f; // change this at runtime int operator()(int i) { return f(i); } }; Regards, Nate
4747
Age (days ago)
4749
Last active (days ago)
2 comments
3 participants
participants (3)
-
Edward Diener
-
Nathan Ridge
-
Tyler Conant