Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Visual Assist
 Feature Requests
 Refactor: extract typedef

You must be registered to post a reply.
Click here to register.

Screensize:
UserName:
Password:
Format: BoldItalicizeUnderlineStrikethrough Align leftCenterAlign right Insert horizontal ruleUpload and insert imageInsert hyperlinkInsert email addressInsert codeInsert quoted textInsert listInsert Emoji
   
Message:

Forum code is on.
Html is off.

 
Check to subscribe to this topic.
   

T O P I C    R E V I E W
pjwhams Posted - Nov 24 2015 : 03:45:57 AM
There's lots of occasions when I'm refactoring old code when I have a number of compound types that start to get unwieldy (especially for pre-C++11 code):


std::pair<Pig,Poke> pigPokePair;
std::vector<std::pair<Pig,Poke>> pigsAndPokes;
for (std::vector<std::pair<Pig,Poke>>::iterator it=...)


It would be very helpful to be able to have an 'extract typedef' that would work in a similar way to the Introduce Variable refactoring: select 'std::pair<Pig,Poke>', invoke the refactoring and VA brings up a prompt to replace all in the current scope. VA asks for the new name ('PigPoke') and then will introduce a typedef on the line above and then replace all occurrences.
1   L A T E S T    R E P L I E S    (Newest First)
feline Posted - Nov 24 2015 : 7:47:07 PM
This is an interesting idea, and makes a lot of sense. We are considering adding a feature like this at some point:

case=87570

© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000