
Hi Stephen, Thank you for your comments.
The proposed property tree library uses a small internal language which is passed to the various functions, for instance:
file = ptree.get<std::string>("config.filename");
Personally, I don't think its a good idea to define new syntaxes and pass them around as strings. It would be a bit more effort to implement, but I think (something like) the following would be preferable:
file = ptree.get<std::string>["config"]["filename"]
I think both approaches have their merits. For example, the above would not permit storing paths in strings or files. I intend to allow both: // These will be equivalent file = pt.["config"]["filename"].get<std::string>(); // #1 file = pt.["config.filename"].get<std::string>(); // #2
Also, there is an additional runtime overhead in parsing the string, which can be avoided by doing it at compile-time using C++'s native syntax.
If performance is important, user will just use #1 syntax. Best regards, Marcin