You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
% clang++ main.cpp
main.cpp:8:2: error: no matching function for call to 'parse'
parse(argc, argv, cli);
^~~~~
./clipp.h:5325:1: note: candidate function not viable: no known conversion from 'clipp::parameter' to
'const clipp::group' for 3rd argument
parse(const int argc, char* argv[], const group& cli, arg_index offset = 1)
^
./clipp.h:5313:1: note: candidate template ignored: deduced conflicting types for parameter 'InputIterator'
('int' vs. 'char **')
parse(InputIterator first, InputIterator last, const group& cli)
^
./clipp.h:5281:1: note: candidate function not viable: requires 2 arguments, but 3 were provided
parse(arg_list args, const group& cli)
^
./clipp.h:5294:1: note: candidate function not viable: requires 2 arguments, but 3 were provided
parse(std::initializer_list<const char*> arglist, const group& cli)
^
1 error generated.
% g++ main.cpp :(
main.cpp: In function ‘int main(int, char**)’:
main.cpp:8:23: error: no matching function for call to ‘parse(int&, char**&, clipp::parameter&)’
8 | parse(argc, argv, cli);
| ^
In file included from main.cpp:2:
clipp.h:5281:1: note: candidate: ‘clipp::parsing_result clipp::parse(clipp::arg_list, const clipp::group&)’
5281 | parse(arg_list args, const group& cli)
| ^~~~~
clipp.h:5281:1: note: candidate expects 2 arguments, 3 provided
clipp.h:5294:1: note: candidate: ‘clipp::parsing_result clipp::parse(std::initializer_list<const char*>, const clipp::group&)’
5294 | parse(std::initializer_list<const char*> arglist, const group& cli)
| ^~~~~
clipp.h:5294:1: note: candidate expects 2 arguments, 3 provided
clipp.h:5313:1: note: candidate: ‘template<class InputIterator> clipp::parsing_result clipp::parse(InputIterator, InputIterator, const clipp::group&)’
5313 | parse(InputIterator first, InputIterator last, const group& cli)
| ^~~~~
clipp.h:5313:1: note: template argument deduction/substitution failed:
main.cpp:8:23: note: deduced conflicting types for parameter ‘InputIterator’ (‘int’ and ‘char**’)
8 | parse(argc, argv, cli);
| ^
In file included from main.cpp:2:
clipp.h:5325:1: note: candidate: ‘clipp::parsing_result clipp::parse(int, char**, const clipp::group&, clipp::arg_index)’
5325 | parse(const int argc, char* argv[], const group& cli, arg_index offset = 1)
| ^~~~~
clipp.h:5325:50: note: no known conversion for argument 3 from ‘clipp::parameter’ to ‘const clipp::group&’
5325 | parse(const int argc, char* argv[], const group& cli, arg_index offset = 1)
| ~~~~~~~~~~~~~^~~
The text was updated successfully, but these errors were encountered:
It doesn't work, because parse expects a clipp::group as third parameter.
This means, you eihter have to add at least one more option, which will generate a group:
auto cli = (option("-h").set(help), option("-x"));
or explicitly make a group:
auto cli = group( option("-h").set(help) );
I should probably add an overload for parse that also accepts a single parameter.
I cannot compile a simple example. Am I doing anything wrong?
clipp 2c32b2f
clang version 8.0.1 (tags/RELEASE_801/final 366581)
g++ (SUSE Linux) 9.1.1 20190723 [gcc-9-branch revision 273734]
The text was updated successfully, but these errors were encountered: