문제

I am developing some c++ code, but having code separated in to .h and .cpp is driving me mad, as it is slowing down re-factoring.

Is there a tool that lets one work on a single file. An editor that just hides the truth, or a per-processor that takes a single file and produces the two files .cpp and .h

clarification: I want a single file per compilation unit (like Java, C♯, Eiffel). I will still have to have #include in files to include the headers of other modules. (but then Java and c♯ have import and using).

clarification 2:

Things are easier if everything that should be together is together. i.e. one and only one file per class.

도움이 되었습니까?

해결책

There's Lzz. I haven't tried it, but it seems like what you're looking for.

다른 팁

Whatever tool you try to use to do this will only hide some of the complexity or make your code C++-unlike and that will in turn make it harder for others to read/maintain.

I recommend that you just learn and get used to the compilation model of the language rather than fighting it. Deciding what goes into the header and/or the implementation is not an automated process, but rather part of the design and tools cannot design for you. Any automated tool to do that will end up generating a less than perfect result, probably longer compile times and/or leaking implementation details to the users of your headers.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top