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

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

    You can do without headers. But, why spend effort trying to avoid carefully worked out best practices that have been developed over many years by experts.

    When I wrote basic, I quite liked line numbers. But, I wouldn't think of trying to jam them into C++, because that's not the C++ way. The same goes for headers... and I'm sure other answers explain all the reasoning.

提交回复
热议问题