Pros & Cons of putting all code in Header files in C++?

前端 未结 17 1871
终归单人心
终归单人心 2020-12-02 15:48

You can structure a C++ program so that (almost) all the code resides in Header files. It essentially looks like a C# or Java program. However, you do need at least one

17条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 16:11

    The obvious downside to me is that you always have to build all the code at once. With .cpp files, you can have separate compilation, so you're only rebuilding bits that have really changed.

提交回复
热议问题