Tool for automating C ++ header / source separation

I am very bored that I have to update the code in two places whenever I develop a C ++ class. During development, this happens 100 times (at least for each private method) that I change the method declaration, add const here or there, delete the & link, etc. I literally hate that I have to open a second file (header file) every time I change a little, and I saw how I try to avoid private interface changes in the middle of development just because I want to avoid this pain. (You probably think I'm lazy, but it's also a REAL pain that keeps me from being as productive as I could be.)

Usually all of my ads are in the title, and all of the definitions are in the source. I don't care about development or smart little optimization tricks. I really like a lot in C ++, but I would be very interested if refactoring and interface development were as simple as in Java.

Are there any tips to solve this problem?

+6
source share
1 answer

You can look at LZZ , which generates header and source files from a single .lzz file. The disadvantage of using this is that it does not always play well with the IDE. For example, in my case with Visual Studio + Visual Assist - you can set syntax highlighting, debug also works correctly and goes to the lzz source (but you could not walk or set a breakpoint in the generated .h / .cpp files), but when you looking for an ad that you often find in the .h file instead of .lzz. I personally prefer to live without lzz and use the IDE for refactoring and quick transitions between declarations and definitions, but some people do not want to wait for C ++ 14 modules and use lzz.

+1
source

All Articles