Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
Leitura de configuração em C++
auto after(const Key &prefix) const -> std::unordered_set<Key> {
std::unordered_set<Key> values;
iterate_and_check(prefix, [&values, &prefix](const std::pair<Key,Value> &pair) {
values.insert( pair.first.substr( prefix.size() ) );
});
return values;
}
auto next_token(const Key &prefix, const typename Key::value_type separator) const -> std::unordered_set<Key> {
std::unordered_set<Key> values;
int pos = last_of(prefix, separator);
iterate_and_check(prefix, [&values, &prefix, &pos, &separator](const std::pair<Key,Value> &pair) {
int npos = next_of(pair.first, pos, separator);
values.insert( pair.first.substr( pos, npos ) );
});
return values;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment