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

前端 未结 24 825
半阙折子戏
半阙折子戏 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:15

    What I have seen some people like you do is write everything in the headers. That gives your desired property of only having to write the method profiles once.

    Personally I think there are very good reasons why it is better to separate declaration and definition, but if this distresses you there is a way to do what you want.

提交回复
热议问题