Skip to content
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

Merged
merged 23 commits into from
Aug 16, 2019
Merged

Support tuple #307

merged 23 commits into from
Aug 16, 2019

Conversation

phlptp
Copy link
Collaborator

@phlptp phlptp commented Jul 30, 2019

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).

phlptp and others added 15 commits May 28, 2019 07:27
… 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
… prior to named subcommand callbacks, and reflect this change in the a new test and docs.
@phlptp
Copy link
Collaborator Author

phlptp commented Jul 30, 2019

@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

@phlptp
Copy link
Collaborator Author

phlptp commented Jul 30, 2019

ok, obviously have a little ways to go to get broad compiler support

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #307 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #307   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2939   2983   +44     
=====================================
+ Hits         2939   2983   +44
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/TypeTools.hpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 17ddce2...196b66c. Read the comment docs.

@codecov
Copy link

codecov bot commented Jul 31, 2019

Codecov Report

Merging #307 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master   #307   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          12     12           
  Lines        2958   3002   +44     
=====================================
+ Hits         2958   3002   +44
Impacted Files Coverage Δ
include/CLI/App.hpp 100% <100%> (ø) ⬆️
include/CLI/TypeTools.hpp 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4bfce43...ff1679f. Read the comment docs.

@phlptp phlptp marked this pull request as ready for review July 31, 2019 16:18
@phlptp
Copy link
Collaborator Author

phlptp commented Aug 1, 2019

This should address #296 since you can now do

std::pair<size_t, int> index;
app.add_option("--entry",index,"pair option");  

include/CLI/TypeTools.hpp Show resolved Hide resolved
include/CLI/TypeTools.hpp Show resolved Hide resolved
@henryiii
Copy link
Collaborator

henryiii commented Aug 7, 2019

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.

@phlptp
Copy link
Collaborator Author

phlptp commented Aug 8, 2019

I think my real question is not whether it can be done, but whether it can be done a straightforward and somewhat readable way.

@phlptp
Copy link
Collaborator Author

phlptp commented Aug 8, 2019

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.

@henryiii
Copy link
Collaborator

A future improvement could be looking at how to do this without a limit and 5x repeated code.

@henryiii henryiii merged commit 127f538 into CLIUtils:master Aug 16, 2019
@henryiii henryiii deleted the support_tuple branch August 16, 2019 13:58
@henryiii henryiii added this to the v1.9 milestone Dec 31, 2019
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