bool is_numeric(string s) { std::istringstream i(s); int x; if (!(i >> x)) { return false; } return true; }