Visual studio: automatically update C++ cpp/header file when the other is changed?

你。 提交于 2019-12-22 08:14:09

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/2607845/visual-studio-automatically-update-c-cpp-header-file-when-the-other-is-change

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!