title: Main function body doesn't detect call to overloaded variadic-templated function C++
body: <p>I'm currently learning variadic template functions and parameter packing/unpacking.</p>
  
  <p>This is my code, </p>
  
  <pre class="lang-cpp prettyprint-override"><code>template&lt;typename T, typename U&gt; 
  void my_insert(std::vector&lt;int&gt;&amp; v, T&amp; t) {
      int i;
      if (typeid(t).name() == typeid(const char*).name()) {
          i = stoi(t);
      }
      else if (typeid(t).name() == typeid(char).name()) {
          i = t - 48;
      }
      else if (typeid(t).name() == typeid(int).name()) {
          i = t;
      }
      else if (typeid(t).name() == typeid(double).name()) {
          i = static_cast&lt;int&gt;(round(t));
      }
      else if (typeid(t).name() == typeid(bool).name()) {
          if (t) i == 1;
          else i == 0;
      }
      else if (typeid(t).name() == typeid(std::vector&lt;U&gt;).name()) {
          int j = 0;
          while (j &lt; t.size()) {
              my_insert(v, t[j]);
              ++j;
          }
      }
      else return;
      v.push_back(i);
  }
  template&lt;typename T, typename U, typename ...Args&gt;
  void my_insert(std::vector&lt;int&gt;&amp; v, T&amp; t, Args&amp;... args) {
      int i;
      if (typeid(t).name() == typeid(const char*).name()) {
          if (isdigit(t[0])) i = stoi(t);
          // else do nothing
      }
      else if (typeid(t).name() == typeid(char).name()) {
          i = t - 48;
      }
      else if (typeid(t).name() == typeid(int).name()) {
          i = t;
      }
      else if (typeid(t).name() == typeid(double).name()) {
          i = static_cast&lt;int&gt;(round(t));
      }
      else if (typeid(t).name() == typeid(bool).name()) {
          if (t) i == 1;
          else i == 0;
      }
      else if (typeid(t).name() == typeid(std::vector&lt;U&gt;).name()) {
          int j = 0;
          while (j &lt; t.size()) {
              my_insert(v, t[j]);
              ++j;
          }
      }
      //else do nothing
      v.push_back(i);
      my_insert(args...);
  }
  
  int main() {
  
      std::vector&lt;int&gt; v; 
  
      my_insert(v, "123", "-8", 32, 3.14159, true, true, false, '5', "12.3");
  
      return 0;
  }
  </code></pre>
  
  <p>ERROR : no instance of overloaded function my_insert matches the argument list</p>
  
  <p>I don't understand what mistake I've made since for me the same exact implementation of the a <code>print()</code> function works with <code>{ cout &lt;&lt; t &lt;&lt; endl; print(args...); }</code> , w/ signature <code>&lt;typename T, typename ...Args&gt; void print(const T&amp; t, const Args... args)</code>;</p>
  
  <p>I know that a variadic function can be implemented with recursive calls non-variadic parameter overloaded versions of the same function. A so-called base case statement.</p>
  
  <p>With all that being said, I'm unsure what it is that I'm doing incorrectly.</p>