including (STL) header files in a header
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/4416765/reincluding-header-in-implementation">reincluding header in implementation</a>  </p>
</blockquote>



<p>What I am wondering is that it is common practice to not use <code>using namespace xxx</code> in a header file as not to pollute the global namespace.
How does this go for <code>#includes</code>?</p>

<p>If I have <code>foo.h</code> and <code>foo.cpp</code>.:</p>

<pre><code>//Foo.h
#ifndef FOO_H_
#define FOO_H_

#include &lt;string&gt;

class Foo
{
  public:
    Foo(std::string * a, std::string * b);
    virtual ~Foo();
};

#endif /* FOO_H_ */

//Foo.cpp
#include &lt;string&gt;
#include &lt;Foo.h&gt;
Foo::Foo(std::string * a, std::string * b)
{
  // TODO Auto-generated constructor stub

}

Foo::~Foo()
{
  // TODO Auto-generated destructor stub
}
</code></pre>

<p>Would I really need to <code>#include &lt;string&gt;</code> in both files? Would including it only in the .h or .cpp suffice? (I know both will work, but what is advisable?)</p>

<hr>

<p>edit, a bit more background information regarding my question.<br>
If I would be using certain classes in my header file (either as variables or method arguments) I would forward declare them in the header file and only include the header file itself in the source file. But this will not work for most STL libs because you can't forward declare class-templates?</p>
