【发布时间】:2015-12-31 09:39:14
【问题描述】:
http://www.boost.org/doc/libs/1_58_0/doc/html/program_options/tutorial.html
// Declare the supported options.
.............................................
desc.add_options()
("help", "produce help message")
("compression", po::value<int>(), "set compression level")
;
是通过运算符重载吗?
如果是,这里重载了哪个运算符?
你能用一个简单的非 Boost 示例程序来模仿这种语法吗?
【问题讨论】:
-
看起来像函数调用操作符,每次调用都返回同一个对象,其中
operator()重载了一个新的选项。 -
@BoBTFish 因为这几乎是一个完整的答案,所以你可以这样发布:-P