is "Redundant #include Guards" necessary on Visual Studio?
<p>I used to use the following code to make sure that the include file is not loaded more than once.</p>

<pre><code>#ifndef _STRING_
#include &lt;string&gt;
#endif

// use std::string here
std::string str;
...
</code></pre>

<p>This trick is illustrated in the book "API Design for C++".</p>

<p>Now my co-work told me that this is not necessary in Visual Studio because if the implementation head file of string contains <code>#pragma once</code>, the include guard is not required to improve the compilation speed.</p>

<p>Is that correct?</p>

<p>Quote from original book:</p>

<pre><code>7.2.3 Redundant #include Guards
Another way to reduce the overhead of parsing too many include files is to add redundant preprocessor
guards at the point of inclusion. For example, if you have an include file, bigfile.h, that looks
like this
#ifndef BIGFILE_H
#define BIGFILE_H
// lots and lots of code
#endif
then you might include this file from another header by doing the following:
#ifndef BIGFILE_H
#include "bigfile.h"
#endif
This saves the cost of pointlessly opening and parsing the entire include file if you’ve already
included it.
</code></pre>
