-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support tuple #307
Support tuple #307
Conversation
… some notes about it in the README.md remove the test from visual studio 2015 vs2015 doesn't seem to properly deal with is_assignable in the cases we care about so make a standalone version that is more direct in what we are doing add version to appveyor and add some notes to the readme fix a few test cases to make sure code is covered and test a few other paths remove unneeded enum streaming operator add some diagnostic escapes around trait code to eliminate gcc Wnarrowing warnings work specification of the template operations remove optional add some templates for options conversions add the two parameter template for add_option
…st overload to use
… prior to named subcommand callbacks, and reflect this change in the a new test and docs.
…umber of elements to require
@henryiii this is something I have been tinkering with and I wanted to see how close I am on coverage and platform support. There is a bit more work to be done on testing, and possible support for things like vector I looked at the complex, but there is a special support for "j" notation on complex numbers so can't get rid of that yet. you can take a look see if this is of interest |
ok, obviously have a little ways to go to get broad compiler support |
Codecov Report
@@ Coverage Diff @@
## master #307 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 2939 2983 +44
=====================================
+ Hits 2939 2983 +44
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## master #307 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 12 12
Lines 2958 3002 +44
=====================================
+ Hits 2958 3002 +44
Continue to review full report at Codecov.
|
This should address #296 since you can now do std::pair<size_t, int> index;
app.add_option("--entry",index,"pair option"); |
mp11 or (probably) hanna can do it, so it should be possible. For now, this is probably fine and is a nice feature to have. |
I think my real question is not whether it can be done, but whether it can be done a straightforward and somewhat readable way. |
From #296 what I don't know quite yet is how to handle the validators that might be distinct for each part of a tuple. Not sure the best way to handle that yet. |
A future improvement could be looking at how to do this without a limit and 5x repeated code. |
If merged this pull request will enable full support for tuples up to 5 elements in size. This includes support for std::pair and std::array(up to 5 elements).