-
Notifications
You must be signed in to change notification settings - Fork 114
Open
Description
Here is non-frozen code. I need the key being looked up to come from data outside the program... i.e. not a literal. Does frozen do this or does it not solve that gperf-like problem?
std::unordered_map<std::string_view, int> m = {
{{"even_length",11},0},
{{"length",6},1},
{{"maybe",5},2},
{{"symbol",6},3},
{{"space_to_nonspace",17},4}
};
std::string line;
std::getline(std::cin, line);
fprintf(stderr,"%s\n", line.c_str());
fprintf(stderr,"%.*s index: %d\n", (int)line.length(), line.c_str(), m.at({line.c_str(),line.length()}));
Metadata
Metadata
Assignees
Labels
No labels