Header per source file

后端 未结 7 1696
醉梦人生
醉梦人生 2020-11-29 05:53

I\'m trying to understand the purpose behind one header per each source file method. As I see it, headers are meant for sharing function declarations, typedef\'

7条回答
  •  感动是毒
    2020-11-29 06:04

    You only put in your header file the bare minimum that other source files need to "see" in order to compile. I've seen some people that put everything non-code into the header file (all typedefs, all #define's, all structures, etc.) even if nothing else in the codebase will be using those. That makes the header file much harder to read for yourself and those who want to use your module.

提交回复
热议问题