2 ms·
Thank you, I know it looks stupid simple but code helps me put it into a perspective I can remember better vs only reading documentation about code. That is kin
by giancarlostoro 4y ago
Thank you, I know it looks stupid simple but code helps me put it into a perspective I can remember better vs only reading documentation about code. That is kind of an interesting way to sort of force someone to not just throw away a return value.
Question: Do you know if this would also be fine if the called function was in a return statement?
- Doxin 4y agoThis will only cause an error if both of these are true: - if the expression is the top level expression in a statement (like in my example code) or the left hand side in a comma expression - if the expression is not an assignment, increment, or decrement So using it in a return is fine because then the expression is no longer the top level in the statement, the return is. Of course then the function calling THAT function must deal with not discarding the value. It's pretty neat.