【问题标题】:Is it possible to specify that an options is required with boost::program_options?是否可以使用 boost::program_options 指定选项?
【发布时间】:2010-12-20 21:54:48
【问题描述】:

我可以使用 value_semantic.hpp 中定义的 typed_value 类的所有其他公共成员,例如:default_value、im​​plicit_value、zero_tokens、multitoken、notifier 等。

但即使成员“required()”也在那里,我也无法使用它。

我得到了错误:

‘class boost::program_options::typed_value<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>’ has no member named ‘required’ 

有什么想法吗?

【问题讨论】:

    标签: c++ boost boost-program-options


    【解决方案1】:

    你的 boost 版本可能太旧了吗?我在 1.45 的文档中找到了 required(),但在 1.34 的文档中没有找到 - 我不知道它什么时候改变了。

    【讨论】:

    • 你是对的。我已经安装了 1.45,但我正在链接旧版本。我的坏
    猜你喜欢
    • 1970-01-01
    • 2019-06-13
    • 1970-01-01
    • 1970-01-01
    • 2020-05-02
    • 2020-10-27
    • 1970-01-01
    • 2016-02-22
    相关资源
    最近更新 更多