fork download
  1. #include <iostream>
  2. #include <map>
  3. #include <typeindex>
  4. using namespace std;
  5.  
  6. enum DataType_T{INT,FLOAT};
  7. struct Data
  8. {
  9. DataType_T type;
  10. void* min;
  11. void* max;
  12. };
  13.  
  14. int main() {
  15.  
  16. std::map<std::type_index, Data> m;
  17. m.insert(std::make_pair(std::type_index(typeid(int)), Data()));
  18. std::cout << m[typeid(int)].type << std::endl;
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0s 3232KB
stdin
Standard input is empty
stdout
0