Skip to content
Discussion options

You must be logged in to vote

Hi @jgournet ,

This is admittedly a bit confusing, but the fallibility of to_string depends on the type of the input argument, and if it is known to the compiler. In your first case, the compiler knows it is an object and so to_string could fail (in this case it'll always fail). In your second example it knows the input is an integer and so will never fail. Does that make sense?

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jgournet
Comment options

Answer selected by jszwedko
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants