简体   繁体   English

为什么Xcode 4在每个标头中都包含iostream?

[英]Why does Xcode 4 include iostream in every header?

I noticed that newly created CPP files in Xcode ~4 all #include <iostream> . 我注意到Xcode〜4中新创建的CPP文件全部#include <iostream> I never use any iostream functionality, so usually strip them out (hearing they can gradually slow build times from the Google blink team blog). 我从不使用任何iostream功能,因此通常将其删除(听到它们可能会逐渐减慢Google眨眼团队博客的构建时间)。 Are there any useful generic functions of iostream that make including it all the time valuable? iostream是否有任何有用的通用功能使其始终有价值? Such as instrumentation or reflection features that not having it everywhere would break? 例如仪器或反射功能,到处都不会破坏它?

It seems like a bold step to add everywhere - especially given how conservative many groups software engineering! 似乎在每个地方都添加了一个大胆的步骤-尤其是考虑到许多组的软件工程人员非常保守! - so feel there must be something important I'm missing. -所以觉得我必须缺少一些重要的东西。

Does anyone know the reason why this header has become so important it must be everywhere? 有谁知道此标头变得如此重要以至于必须在任何地方都存在的原因?

I sign juanchopanzas statement: There is no header that needs to be included everywhere. 我签署了juanchopanzas声明:不需要在所有地方都包含标头。 Each #include should only be in a file when it is really needed. 每个#include仅在确实需要时才在文件中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM