Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Created February 4, 2016 22:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thiagomg/68035bb92d17c0b8c001 to your computer and use it in GitHub Desktop.
Save thiagomg/68035bb92d17c0b8c001 to your computer and use it in GitHub Desktop.
Leitura de configuração em C++
using adder_func = std::function<void(const std::pair<Key,Value> &pair)>;
void iterate_and_check(const Key &prefix, adder_func f_adder) const {
std::for_each(begin(_items), end(_items), [&prefix, &f_adder](const std::pair<Key,Value> &pair) {
//let's check prefix
if( std::equal( begin(prefix), end(prefix), begin(pair.first) ) )
f_adder(pair);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment