Skip to content

Instantly share code, notes, and snippets.

@thiagomg
Created February 4, 2016 22:28
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/c7b97352a59bcf97f04d to your computer and use it in GitHub Desktop.
Save thiagomg/c7b97352a59bcf97f04d to your computer and use it in GitHub Desktop.
Leitura de configuração em C++
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