Skip to content

Instantly share code, notes, and snippets.

@mostsignificant
Last active October 20, 2021 19:19
Show Gist options
  • Save mostsignificant/0ac6f8435329d01d03e1fc8715c6335c to your computer and use it in GitHub Desktop.
Save mostsignificant/0ac6f8435329d01d03e1fc8715c6335c to your computer and use it in GitHub Desktop.
blog-has-option
bool has_option(
const std::vector<std::string_view>& args,
const std::string_view& option_name) {
for (auto it = args.begin(), end = args.end(); it != end; ++it) {
if (*it == option_name)
return true;
}
return false;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment