| Alx101 (73) | |||
|
Hello, i am trying to create a map i which i can store functions that i will call later in another class, however i get an error when trying to assign anything to the map The map code:
This is in another class where i try to add a function to the map funcList[Escape] = defaultQuitKey; //The 'Escape' is part of an enum However whenever i try to compile i get this error: void(*EEngine::Core::)()is not compatible with void(*)()Now the function i try to add is part of a namespace called EEngine and is part of the class Core, i just don't get why you would not be able to assign things from another namespace to it. Any suggestions as to why i can't do this or how i can work around it? | |||
|
Last edited on
|
|||
| ovi78 (1) | |
|
Hi , As the function is a member function, the declaration should be something like this: typedef void (EEngine::Core::*keyFunc)(); | |
|
|
|
| Alx101 (73) | |
| I know, but i want to be able to assign functions from other classes too, is there any way i can do this? | |
|
|
|