Mordachai
Tomato Guru
USA
224 Posts |
Posted - Jan 18 2017 : 11:08:02 AM
|
Not sure if this is VA or MSVC++?
But, if I type 'switch' - then hit enter, it expands to a full switch statement:
switch (switch_on) { default: break; }
With "switch_on" highlighted, and if I type a symbol there, hit enter, then the switch is updated to reflect that enumeration's possible values.
Nice!!! Love this feature!
---
However (you knew it was coming)... if the symbol I type for 'switch_on' isn't trivial, then I don't get the expansion.
It's kind of ridiculous - if I do something like:
switch (myptr->GetSubType()) { default: break; }
It fails. :(
If I instead take an extra moment to do:
auto x = myptr->GetSubType(); switch (x) { case SubType1: case SubType2: case SubType3: case SubType4: default: break; }
So, just by forcing the type information out to the current context, I get the snazzy best-case scenario.
But if I leave it even one layer indirected, then I get the dumb worst-case scenario. :'(
REQUEST:
If you can resolve:
auto x = 'thing-i-typed'
Then you can resolve it in the switch (switch_on) context!!!
Please!!! :D |
|