title: wrapping specialised c++ template class with swig
body: <p>consider the following class declarations:</p>
  
  <pre><code>namespace X {
  template&lt;class T&gt;
  class Foo {
  public:
      Foo();
      virtual ~Foo();
  
      T value() const;
  };
  
  template&lt;class T&gt;
  class Foo&lt;vector&lt;T&gt;&gt; {
  public:
      Foo();
      virtual ~Foo();
  
      T value( const int ) const;
  };
  }
  </code></pre>
  
  <p>for them i have the following declaration in the foo.i file</p>
  
  <pre><code>%include "stl.i"
  %include "std_string.i"
  %include "std_vector.i"
  
  namespace X {
  using namespace std;
  
  template&lt;class T&gt;
  class Foo {
  public:
      Foo();
      virtual ~Foo();
      T value() const;
  };
  
  template&lt;class T&gt;
  class Foo&lt;vector&lt;T&gt; &gt; {
  public:
      Foo();
      virtual ~Foo();
      T value( const int ) const;
  };
  
  %template(FooInt) Foo&lt;int&gt;;
  %template(FooString) Foo&lt;string&gt;;
  %template(FooVectorInt) Foo&lt;vector&lt;int&gt; &gt;;
  
  }
  </code></pre>
  
  <p>the difference between the two classes is the specialisation of the later to vector container <em>and</em> the differrent signature of the value() method, where the first takes no arguments, while the second takes an expects an integer.</p>
  
  <p>the wrapper code put together by swig wrapps the <code>%template(FooVectorInt)</code> wrong, in that it calls the <code>value()</code> method instead that of the specialised vector method <code>value(const int)</code>. giving me the following compile error message:</p>
  
  <pre><code>foo_wrap.cxx: in function »int _wrap_FooVectorInt_value(lua_State*)«:
  
  /home/noobsaibot/foo/bindings/src/lua/foo_wrap.cxx:6706:81: error: no matching function to call »X::Foo&lt;std::vector&lt;int&gt; &gt;::value() const«
  /home/noobsaibot/foo/src/foo.h:78:5: note: candidate is: T X::Foo&lt;std::vector&lt;_RealType&gt; &gt;::value(int) const [with T = int, int = unsigned int]
  </code></pre>
  
  <p>any advices as to what i might be missing to make swig understand which function is the correct one?</p>
  
  <p>cheers</p>