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

Get an Int Returns Bad Any Cast #161

Closed
ChainofChaos opened this issue Feb 17, 2022 · 1 comment
Closed

Get an Int Returns Bad Any Cast #161

ChainofChaos opened this issue Feb 17, 2022 · 1 comment

Comments

@ChainofChaos
Copy link

Not sure what's wrong with this both argument and default_value are an integer but it still gets bad any cast error.
Command line argument
test -T 3
Code

program.add_argument("-T", "--threads")
	.default_value(6)
	.help("specify how many threads you want to use");
unsigned int threads = program.get<int>("-T");  //Bad any cast
@ChainofChaos
Copy link
Author

My bad didn't read this #65 should have been use scan

program.add_argument("-T", "--threads")
        .scan<'d', int>()
	.default_value(6)
	.help("specify how many threads you want to use");

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

No branches or pull requests

1 participant