Quote:
Originally posted by ygfperson
I have two classes: Function and Function_Definition. The class Function_Definition contains a static member of a vector of Function_Definition pointers. Every function has a name (in the form of a string), and so do the function_definitions. Every function_definition name is unique.
How do I connect a function to a function_definition based on the name? I feel like I need a global set of names, but that seems... not elegant.
Sounds like a job for std::map. You could do std::map<std::string, int>, int being index into the vector of Function_Definition pointers, or you could even map a string to a function pointer if you wanted.