13 std::map<std::string, std::string> extra;
18 static void parse_or_die(
const std::string &str, T *value) {
19 std::istringstream iss(str);
24 if constexpr (
sizeof(T) ==
sizeof(char) && !std::is_same<T, bool>::value) {
31 user_assert(!iss.fail() && iss.get() == EOF) <<
"Unable to parse: " << str;
36 explicit ParamParser(
const std::map<std::string, std::string> &m)
44 bool parse(
const std::string &key, T *value) {
45 auto it = extra.find(key);
46 if (it == extra.end()) {
49 parse_or_die(it->second, value);
56 std::ostringstream oss;
57 oss <<
"Autoscheduler Params contain unknown keys:\n";
58 for (
const auto &it : extra) {
59 oss <<
" " << it.first <<
"\n";