Created
October 18, 2014 02:56
-
-
Save emarthinsen/2c66274eff545e46b295 to your computer and use it in GitHub Desktop.
Vector of function pointers
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ex6.54.cpp:12:11: error: unexpected type name 'func': expected expression | |
vector<*func> funcPtrs; | |
^ | |
1 error generated. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <vector> | |
using std::vector; | |
int myfunc(int a, int b) { | |
return a + b; | |
} | |
typedef decltype(myfunc) func; | |
int main() { | |
vector<*func> funcPtrs; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment