Can I write C++ code without headers (repetitive function declarations)?

前端 未结 24 944
半阙折子戏
半阙折子戏 2020-11-28 07:55

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 desi

24条回答
  •  不知归路
    2020-11-28 08:28

    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 can only be used within Lzz function bodies.

提交回复
热议问题