C++ One Header Multiple Sources

前端 未结 4 872
时光说笑
时光说笑 2021-02-19 22:35

I have a large class Foo1:

class Foo {
public:
    void apples1();
    void apples2();
    void apples3();

    void oranges1();
    void         


        
4条回答
  •  遥遥无期
    2021-02-19 23:08

    From a technical standpoint, there is no penalty to doing this at all, but I have never seen it done in practice. This is simply a issue of style, and in that spirit, if it helps you to better read the class, then you would be doing yourself a disservice by not using multiple source files.

    edit: Adding to that though, are you physically scrolling through your source, like, with your middle mouse wheel? As someone else already mentioned, IDE's almost universally let you right click on a function declaration, and go to the definition. And even if that's not the case for your IDE, and you use notepad or something, it will at least have ctrl+f. I would be lost without find and replace.

提交回复
热议问题