[program options] option_description name as string
We tend to store the names of our options in strings (so we can reuse them later when getting the values out of the variable map). But option_descriptions can only be created from const char *, so we need to add a .c_str() when building the options_description. Is there any reason why options can't be constructed with a string? Otherwise I'll open a feature request bug. -- Anthony Foglia Princeton Consultants (609) 987-8787 x233
"Anthony Foglia"
We tend to store the names of our options in strings (so we can reuse them later when getting the values out of the variable map). But option_descriptions can only be created from const char *, so we need to add a .c_str() when building the options_description.
Is there any reason why options can't be constructed with a string? Otherwise I'll open a feature request bug.
This did come up recently on the dev list. FWIW, here's the thread: http://lists.boost.org/Archives/boost/2010/03/162646.php
Chard wrote:
"Anthony Foglia"
wrote in message news:4BD075A4.101@princeton.com... Is there any reason why options can't be constructed with a string? Otherwise I'll open a feature request bug.
This did come up recently on the dev list.
FWIW, here's the thread:
Interesting, but I don't see a final decision. The argument seems to boil down to: Having versions that took strings would be convenient. But for users who use string literals, their code would bloat with the implicit string conversion code. Adding the overloads might be fine, but the maintainer, Volodya, needs to think about it. Sounds like he got busy and forgot, so I'll add it to the tracker. -- Anthony Foglia Princeton Consultants (609) 987-8787 x233
participants (2)
-
Anthony Foglia
-
Chard