-
Notifications
You must be signed in to change notification settings - Fork 349
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
improve documentation for custom converters/validators #780
Comments
Well from what I can tell
would get called but doesn't do anything and returns true. So I think you would either need to make this function call the operator>> or just get rid of it and let CLI call it on the default lexical_cast |
Thanks. So then, what's the use of std::istringstream &operator>> if I'm going to do the conversion in lexical_cast? If I had to implement a library extension I'd prefer to have << and >> operators that may come usefull, but If I comment out the lexical_cast I get:
thanks again |
You can try putting the overloaded streaming operators in the date namespace. The name lookup with header libraries is bit "questionable"/"confusing" The purpose of a validator is to restrict what would otherwise be a valid conversion. If you want to allow all valid conversions then a validator is not necessary. |
Thanks, it worked. I'll do some experiments to get a better understanding of how things are working and try to write some meaningful commented examples to add to the documentation. |
I'd like to extend the library to support more option type.
I'd prefer to avoid to use lambdas or simply define functions to pass to add_option_function().
Rather I'd like to add code that will let the user simply write
Right now I wrote:
but simply
doesn't get called at all. And dateE still cntain its default value.
What am I missing?
thanks
The text was updated successfully, but these errors were encountered: