4 ms·
There are some problems with that method though. If, for example, you'd like to reverse the condition, you can't write if (!(MouseEvent *mouse = dynamic_c
by Ives 13y ago
There are some problems with that method though.
If, for example, you'd like to reverse the condition, you can't write
if (!(MouseEvent *mouse = dynamic_cast<MouseEvent *>(event)))
{}
because a definition is not a general expression, but was only added as an "extra" to allow its use in some cases in conditionals.
- bnegreve 13y agoOh, ok I didn't know. So it is indeed a syntactical shorthand for simultaneously declaring a variable and branching.