Are unused includes harmful in C/C++?

后端 未结 10 577
说谎
说谎 2020-12-23 14:27

What are the negative consequences of unused includes?

I\'m aware they result in increased binary size (or do they?), anything else?

10条回答
  •  失恋的感觉
    2020-12-23 14:53

    Whether or not they increase the binary size really depends on what's in them.

    The main side-effect is probably the negative impact on compilation speed. Again, how big an impact depends on what's in them, how much and whether they include other headers.

提交回复
热议问题