
9 Dec
2005
9 Dec
'05
9:20 a.m.
Chris Weed wrote:
Hi, I would like to have the program_options functions parse a boost::filesystem path.
For example something like the following code. However, this doesn't seem to work. The error seems to suggest the problem is a lack of operator >> for path.
Is it possible to make this work?
Yes, you have two approaches. 1. Specify a custom way to parse fs::path to Boost.program_options See http://boost.org/doc/html/program_options/howto.html#id2716150 for an example. 2. Convince Beman Dawes, the author of Boost.Filesystem, that adding operator>> for paths is a good idea. Personally, I don't see any reason why it should not work -- if I want to save/load something containing boost::fs::path, working operator>> would be a plus. - Volodya