title: Wrapping C++ struct template in SWIG
body: <p>I have a C++ code that wraps an existing Object with a probability as follows:</p>
  
  <pre><code>template&lt; typename Object &gt; struct Roll
  {
      Object object;          
      double probability; 
  
      Roll( Object p, double s )
          : object( p )
          , probability( s )
      { }
  }
  </code></pre>
  
  <p>Later, this will be defined in the same .h file as:</p>
  
  <pre><code>typedef Roll&lt; Color &gt; RollColor;
  </code></pre>
  
  <p>There's instruction around how to wrap a C++ struct with primitive type in SWIG but this one has something to do with the template also, so I don't know how to wrap it properly in my interface file. Do you have any idea how can I do this ? Thank you very much.</p>