|
From: David M. <ci...@ya...> - 2003-06-30 15:26:54
|
Ok, here is a question for all you STL users out there. I have a map which uses a string as the key and the data object is a function pointer (I am yet to implement this so don't ask me how I did it). What I would need (please don't ask me why, it is the request of another member of our team) but I also need to do a reverse-lookup (for a given function pointer address what strings are assigned). For the curious this is for a dynamic command system. When the user enters a command we look up what function is assigned to that command. For now you can assume that it is a 1:1 relationship, no more than one command is mapped to a particular function. This might change in the future (should we start implementing aliases) so a solution that would solve this as well would be quite helpful. So far the only solutions I see is to set up 2 maps (2nd one for the reverse lookup would have to be a multimap if more than one command can be mapped to a particular function). To make sure everything is kept in sync I would probably have to encapsulate it and over-ride some operators. Thanks in advance __________________________________ Do you Yahoo!? SBC Yahoo! DSL - Now only $29.95 per month! http://sbc.yahoo.com |