Can I write C++ code without headers (repetitive function declarations)?
问题 Is there any way to not have to write function declarations twice (headers) and still retain the same scalability in compiling, clarity in debugging, and flexibility in design when programming in C++? 回答1: Use Lzz. It takes a single file and automatically creates a .h and .cpp for you with all the declarations/definitions in the right place. Lzz is really very powerful, and handles 99% of full C++ syntax, including templates, specializations etc etc etc. Update 150120: Newer C++ '11/14 syntax