title: C++ variadic templates unresolved external of virtual abstract
body: <p>Today I wrote code for my project, and got unresolved external of linker, code must generate class with multiple virtual abstract methods - as base of class collections. So I decide use variadic templates for this task - but got error.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;int I&gt;
  struct pin_tag {};
  
  //inputs
  template&lt;int N, class T0, class... VAR&gt;
  class inputs_base : public inputs_base&lt;N + 1, VAR...&gt;
  {
  protected:
     typedef inputs_base&lt;N + 1, VAR...&gt; base_type;
     using arg_type = T0;
     //using base_type::_in;
     virtual void _in(T0 const&amp; t, pin_tag&lt;N&gt;) = 0;
  };
  
  template&lt;int N, class T0&gt;
  class inputs_base&lt;N, T0&gt;
  {
  protected:
     using arg_type = T0;
     virtual void _in(T0 const&amp; t, pin_tag&lt;N&gt;) = 0;
  };
  
  template&lt;class... VAR&gt;
  class inputs : public inputs_base&lt;0, VAR...&gt;
  {
  private:
     using inputs_type = inputs&lt;VAR...&gt;;
     using inputs_base_type = inputs_base&lt;0, VAR...&gt;;
  
     template &lt;int N, class T = inputs_type&gt;
     struct getter
     {
       using next_type = typename getter&lt;N - 1, typename T::base_type&gt;;
       using arg_type = typename next_type::arg_type;
       using current_type = typename next_type::current_type;
     };
  
     template &lt;class T&gt;
     struct getter&lt;0, T&gt;
     {
       using arg_type = typename T::arg_type;
       using current_type = typename T;
     };
  
     public:
     template&lt;int N&gt;
     using in_arg_type = typename getter&lt;N&gt;::arg_type;
  
     template&lt;int N&gt;
     void in(in_arg_type&lt;N&gt; const&amp; t)
     {
       getter&lt;N&gt;::current_type::_in(t, pin_tag&lt;N&gt;());
     }
  };
  
  
  class test : public inputs&lt; int, bool &gt;
  {
  protected:
     virtual void _in(int const&amp; val, pin_tag&lt;0&gt;)
     {}
     virtual void _in(bool const&amp; val, pin_tag&lt;1&gt;)
     {}
   };
  
  int _tmain(int argc, _TCHAR* argv[])
  {
  
     test t;
     t.in&lt;0&gt;(100500);
  }
  </code></pre>
  
  <p>I've got linker error</p>
  
  <pre><code>error LNK2019: unresolved external symbol "protected: virtual void __thiscall inputs_base&lt;0,int,bool&gt;::_in(int const &amp;,struct pin_tag&lt;0&gt;)" (?_in@?$inputs_base@$0A@H_N@@MAEXABHU?$pin_tag@$0A@@@@Z) referenced in function "public: void __thiscall inputs&lt;int,bool&gt;::in&lt;0&gt;(int const &amp;)" (??$in@$0A@@?$inputs@H_N@@QAEXABH@Z)
  </code></pre>
  
  <p>It seems <code>_in</code> lost virtuality. Can anyone inspect my code please.</p>