+
Skip to content

Conversation

yahiaetman
Copy link
Collaborator

Since only options can be retrieved by the template get<T> functions, positional arguments needs to be manually parsed which added unneeded verbosity to the code.

This pull request adds the following functions:

  • std::optional<T> args::get<T>(size_t positional_index)
  • T args::get<T>(size_t positional_index, , T&& default_value)

If the positional_index doesn't exist an std::nullopt or the default value is returned.

Also this pull request contains a fix for #8 and adds test cases for the aforementioned functions and fix.

@sailormoon
Copy link
Owner

Fantastic contribution, Yetman! Thank you so much for the fix and feature addition :)

@sailormoon sailormoon merged commit bb2ab63 into sailormoon:master Apr 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载