Created
February 4, 2016 22:28
-
-
Save thiagomg/c7b97352a59bcf97f04d 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
struct my_value { | |
std::string sval; | |
using const_iterator = std::string::const_iterator; | |
}; | |
//... | |
auto cfg = configuration::load<std::string, my_value>(fname, | |
[](auto &config, iter_type b, iter_type m, iter_type e) { | |
std::string k(b, m); | |
my_value mv; | |
mv.sval = std::string(m+1, e); | |
config.add_item( k, mv ); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment