Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4874

C/C++ • Re: boost program options c++ question

$
0
0
I'm afraid I don't know. After a quick google, it seems I know even less thus can't resist..
Why is the any_string literal needed on the below code?

Code:

options_.add_options()("help,h", value<bool>(&help)->default_value(false)->implicit_value(true), "Print this help message")("testing", value<std::vector<std::string>>(&testingv)->multitoken()->default_value(std::vector<std::string>{"1", "0"}, "any_string"), "test multivalue")
Wow, is that Boost's idea of parsing options? Heck, I think even lowly getopt() is a bit obtuse! I rolled my own years ago. ;-)

Statistics: Posted by swampdog — Mon Jul 29, 2024 7:30 pm



Viewing all articles
Browse latest Browse all 4874

Trending Articles