Whole Tomato Software Forums
Whole Tomato Software Forums
Main Site | Profile | Register | Active Topics | Members | Search | FAQ
User name:
Password:
Save Password
Forgot your password?

 All Forums
 Visual Assist
 Feature Requests
 Refactor: extract typedef
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

pjwhams
Senior Member

25 Posts

Posted - Nov 24 2015 :  03:45:57 AM  Show Profile  Reply with Quote
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.

feline
Whole Tomato Software

United Kingdom
19020 Posts

Posted - Nov 24 2015 :  7:47:07 PM  Show Profile  Reply with Quote
This is an interesting idea, and makes a lot of sense. We are considering adding a feature like this at some point:

case=87570

zen is the art of being at one with the two'ness
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
© 2023 Whole Tomato Software, LLC Go To Top Of Page
Snitz Forums 2000