cxxopts
cxxopts copied to clipboard
Add ParseResult::contains method
Adds a method imitating C++20 std::map contains method for ParseResult. This makes certain syntax more concise:
options.add_options()
...
("d,debug", "Enable debugging")
...
;
bool debug = result.contains("debug");
Obviously this is syntactic sugar for static_cast<bool>(count())
but just like with std::map
this is common enough of a use case to be worth adding.