We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
In private conversation @nenomius suggests that instead of this options initializing:
options.option(option{}, option{}, option{});
it's better to use:
auto options = libname::options{option, option, option, option}
hey, guys, @shiz01 , @oficsu , what do you think about this design idea?
The text was updated successfully, but these errors were encountered:
As I can see, there has been already implemented pipe syntax like this:
auto options = libname::options{ argc, argv } | libname::option( /* ... */ ) | libname::option( /* ... */ );
With ADL, we can remove redundant libname mentions and improve readability:
libname
auto options = libname::options{ argc, argv } | option( /* ... */ ) | option( /* ... */ );
But I'm not sure if this is a reliable tool. And I think, it's also possible to improve the first example and make it similar to the previous one:
auto options = libname::options{ argc, argv } .option( /* ... */ ) .option( /* ... */ );
Isn't this the best from both worlds?
If in a future we want to have option groups, your second example might be changed to:
auto options = libname::options { libname::option( /* ... */ ), libname::group("groupname" libname::option( /* ... */ ), libname::option( /* ... */ )) libname::option( /* ... */ ), };
And with my proposal to:
auto options = libname::options { argc, argv } .option( /* ... */ ) .group("groupname") .option( /* ... */ ) .option( /* ... */ ) .close() .option( /* ... */ );
And I think it's more expressive syntax. But there may also be some drawbacks that I'm not seeing and these are only theoretical thoughts at now
Sorry, something went wrong.
Yes, it is planned to make builder-like syntax. But there’s no time yet :(
You can also add a constructor overload, with a variadic of options. Easy. For:
auto options = libname::options{option, option, option, option};
But there is no free time at the moment :(
No branches or pull requests
In private conversation @nenomius suggests that instead of this options initializing:
it's better to use:
auto options = libname::options{option, option, option, option}
hey, guys, @shiz01 , @oficsu , what do you think about this design idea?
The text was updated successfully, but these errors were encountered: