Automatically split (refactor) .h into header and implementation (h+cpp)
问题 When writing C++ code, I often start by writing full 'implementation' code in my header files, then later need to refactor the implementation into a .cpp file. This is great, but I find this process laborious, but otherwise pretty easy, so I wondered about whether is there any automated way to do this? Specifically, I want to convert all class and function definitions in the .h to declarations, and have them declared in a new .cpp file. I'm using xcode, but I am open to any solutions. 回答1: