title: C++ problem with std::pair and forward declarations
body: <p>Unfortunately I still got a problem with my templated code from here: </p>
  
  <p><a href="https://stackoverflow.com/questions/1911434/c-fancy-template-code-problem">C++ fancy template code problem</a></p>
  
  <p>on line 49 in the file 'utility':</p>
  
  <pre><code>error C2440: 'Initializing': cannot convert from 'const int' to 'IntersectionData *'
  
  error C2439: 'std::pair&lt;_Ty1,_Ty2&gt;::second': member could not be initialized
  </code></pre>
  
  <p>how could i figure out where the problem is? the only place i use a pair with 'IntersectionData*' is here:</p>
  
  <pre><code>#include "MRMaterialMatth.h"
  #include "IntersectionData.h"
  using namespace std;
  
  struct IShaderMatth {
   virtual ~IShaderMatth() {}
   vector&lt;pair&lt;MaterialMatth,IntersectionData*&gt; &gt; traceCols; 
  };
  </code></pre>
  
  <p>and there are not any other compiler errors</p>
  
  <p>how can I track down this?</p>
  
  <p>//edit: utility is not my code. it must be from std.. the code of line 49 looks like this:</p>
  
  <pre><code>template&lt;class _Other1,
      class _Other2&gt;
      pair(const pair&lt;_Other1, _Other2&gt;&amp; _Right)
      : first(_Right.first), second(_Right.second)
      {   // construct from compatible pair
      }
  </code></pre>
  
  <p>line 49 is the line of the comment</p>
  
  <p>edit2:
  the only places where i change something about the content of tracecols look like this:</p>
  
  <pre><code>            IntersectionData* iDataOut = NULL;
              if(newIData_out!=NULL)
              {
                  iDataOut = new IntersectionData(*iData);
              }
              traceCols-&gt;push_back(make_pair(MaterialMatth(),iDataOut));
  </code></pre>
  
  <p>and</p>
  
  <pre><code>    if(traceCols){
          traceCols-&gt;push_back(make_pair(MaterialMatth(), NULL));
      }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>        if(traceCols)
          {
              (*traceCols)[traceCols-&gt;size()].second = new IntersectionData(*newIData);
          }
  </code></pre>
  
  <p>is NULL the problem? it's a pointer, so i should be allowed to create a pair with NULL, no??</p>