#include <vector>
#include <map>
#include <iostream>
#include <string>
using namespace std;

struct callable {
  virtual void operator()(vector<string> args) = 0;
}

std::map<std::string, callable> commands =
{
  { "cd", struct : callable
    {
      operator()(vector<string> args) {
        out << "cd called with args" << endl;
        for (auto i = args.begin(); args.end() != i; ++i) out << *i << endl;
      }
    }
  }
}

int main() {
  vector<string> args = {"hello", "world"};
  commands["cd"](args);
  return 0;
}