Should '#include' and 'using' statements be repeated in both header and implementation files (C++)?

后端 未结 5 1566
無奈伤痛
無奈伤痛 2021-02-14 20:33

I\'m fairly new to C++, but my understanding is that a #include statement will essentially just dump the contents of the #included file into the location of that statement. This

5条回答
  •  长发绾君心
    2021-02-14 20:49

    Keep the header files to a minimum. This means as little include's as feasible. the .cpp file will usually include the corresponding header as well as any other headers necessary for implementation.

提交回复
热议问题