pointer to class template
<p>Here is the compilable code and the problem is still there</p>

<pre><code>#include &lt;iostream&gt;   
#include &lt;string&gt;    

template&lt;typename A,typename B,typename C&gt;   
class Mesh{   
    public:   
    Mesh(){}   
    Mesh(std::string file){   
    A foo;   
    std::cout &lt;&lt;  file &lt;&lt; endl;   
    }   
};    

template&lt;typename A, typename B,typename C&gt;    
class Eq{    
public:    
  Mesh&lt;A,B,C&gt;* pmesh;      
  Eq() {}
  Eq(Mesh&lt;A,B,C&gt; *pmesh_){
      pmesh = pmesh_;
  }
};

template&lt;typename A, typename B,typename C&gt;
class Pipe{
public:
  Mesh&lt;A, B,C&gt; mesh;
  Eq&lt;A, B, C&gt; eq1;

  Pipe(){}
  Pipe(std::string file){
      mesh = Mesh&lt;A, B, C&gt;(file);
      eq1 = Eq&lt;A,B,C&gt;(&amp;mesh);
      std::cout &lt;&lt; "P:"&lt;&lt;&amp;mesh &lt;&lt; " ";
  }
};

template&lt;typename A,typename B, typename C&gt;
class Simulator {
public:
    Pipe&lt;A,B,C&gt; pipe;

    Simulator(){}
    Simulator(std::string file){
        pipe = Pipe&lt;A,B,C&gt;(file);
        std::cout &lt;&lt; "S:"&lt;&lt;&amp;(pipe.mesh)&lt;&lt;" ";
    }
};

using namespace std;
int main() {
    typedef double A;
    typedef double B;
    typedef int  C;

    Simulator&lt; A, B, C&gt; simu("mesh");
}
</code></pre>

<p>The Outlet of the program is</p>

<p>mesh<br>
P:0018FE44  S:0018FE3C</p>

<p>I think the problem is in the declaration of pipe, if I define sinulator as</p>

<pre><code>template&lt;typename A,typename B, typename C&gt;    
class Simulator {   
public:
    Pipe&lt;A,B,C&gt;*  ppipe;

Simulator(){}
    Simulator(std::string file){
        ppipe = new Pipe&lt;A,B,C&gt;(file);
        std::cout &lt;&lt; "S:"&lt;&lt;&amp;(ppipe-&gt;mesh)&lt;&lt;" ";
    }
};
</code></pre>

<p>the output is </p>

<p>mesh
P:00308F08  S:00308F08</p>

<p>any idea, why the first code is wrong ?? </p>
