#include <time.h>
#include<stdio.h>
#include<string>
#include<vector>
#include <algorithm>
#include<map>
#include<iostream>
void *fun1(){
printf("jhell\n");
}
void *fun2(){}
typedef void*(*T)(void);
int main() {
std::map<int, T> m;
m[1] = fun1;
m[2] = fun2;
auto it = m.begin();
std::cout << it->first << "," << it->second << "," << it->second() << std::endl;
//auto f = (*it->second)();
printf("it->second:%x, it->second():%x\n", it->second, it->second());
return 0;
}
g++ -Wall -o map_test map_test.cpp --std=c++11
jhell
1,1,0x6
jhell
it->second:400e20, it->second():6