Created
February 4, 2016 22:21
-
-
Save thiagomg/68035bb92d17c0b8c001 to your computer and use it in GitHub Desktop.
Leitura de configuração em C++
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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