7

For example, if I change the signature in a function in either the header or the cpp, I'd like it to automatically change in the other one. If I add a new function in either, it should appear in both. If I delete a function, it could probably comment out the other one. Manually having to duplicate one's changes seems silly.

Some people have mentioned http://www.lazycplusplus.com/ in response to a similar question, but it seems that that's a command line tool which would require saving and then running this external tool on a particular file. That's still more manual steps than I would have thought were necessary; I'd like this to apply changes as I type.

Jon Seigel
  • 12,251
  • 8
  • 58
  • 92
Jon
  • 5,275
  • 5
  • 39
  • 51
  • I was looking for that feature too, but didn't find it up to now... But http://stackoverflow.com/questions/976467/automatically-generate-c-source-and-header-and-update-vice-versa-on-changes-f tells that there is some solution. – phimuemue Apr 09 '10 at 13:40
  • Microsoft have recently released a free extension that performs rename (only) refactoring within Visual C++. See [here](https://visualstudiogallery.msdn.microsoft.com/164904b2-3b47-417f-9b6b-fdd35757d194) – hendalst Feb 24 '15 at 12:18

1 Answers1

5

What you're looking for is refactoring in Visual C++ which is unfortunately only available via third-party plugins and to my knowledge not in an "as you type" fashion.

I'm using the excellent Visual Assist X which allows for renaming methods, changing signatures and much more.

fhe
  • 6,099
  • 1
  • 41
  • 44
  • I agree that VA X is good, but I find having to manually drill down to "change signature" and editing it inside a dialog almost the same effort as copy/pasting. Would be great if it all just worked automatically. – Jon Apr 09 '10 at 15:33
  • Yes, indeed. But at least it also updates the references to the renamed methods which is a huge helper when there are many calls of the particular method. However, C++ is a rather complex language and current refactoring solutions are almost not comparable to what exists for Java or C#. – fhe Apr 09 '10 at 15:54