fork download
  1. #include <functional>
  2. #include<map>
  3. #include<string>
  4.  
  5. class Calc {
  6.  
  7. private:
  8.  
  9. void Naming() {}
  10. std::map<std::string, std::function <void()>> Command_Name;
  11.  
  12. public:
  13.  
  14. Calc() {
  15. Command_Name["var"] = std::bind(&Calc::Naming, this);
  16. }
  17.  
  18. void operator()() {
  19. Command_Name["var"]();
  20. }
  21. };
  22.  
  23. int main() {
  24. Calc calculater;
  25. calculater();
  26. return 0;
  27. }
Success #stdin #stdout 0s 5532KB
stdin
Standard input is empty
stdout
Standard output is empty