title: Why does C++ template function not recognize a function in the same header file
body: <p>This is probably a question that goes back to a fundamental understanding of how C++ compile a program.  I have the following set of functions defined in a <code>.hpp</code> file.  The line <code>keys = get_keys(inputs)</code> is causing the problem.  The compiler gives me the following error message <code>Use of undeclared identifier 'get_keys'</code>.  However, <code>get_keys()</code> is defined right below it.  I tried implementing the <code>get_keys</code> function in the <code>.cpp</code> file and just declaring the prototype in the <code>.hpp</code> file since it is not a template function, but that did not work either.  Why can I not access this function?</p>
  
  <pre><code>template &lt;typename ...Funcs&gt;
  static std::tuple&lt;std::vector&lt;double&gt;, std::vector&lt;double&gt;&gt;
  ode_solver(double step_size, double start, double stop, double error,
             std::string func_name, std::map&lt;std::string, double&gt; &amp;inputs,
             Funcs&amp;&amp;... funcs)
  {
  
      std::vector&lt;std::string&gt; keys;
      // THE COMPILER DOES NOT RECOGNIZE get_keys in the below line
      keys = get_keys(inputs);
      std::vector&lt;double&gt; one = {0.0, 1.0};
      std::vector&lt;double&gt; two = {0.0, 1.0};
      std::tuple&lt;std::vector&lt;double&gt;, std::vector&lt;double&gt;&gt; three(one, two);
      return three;
  }
  // ================================================================
  
  std::vector&lt;std::string&gt;
  get_keys(std::map&lt;std::string, double&gt; &amp; arr)
  {
      std::vector&lt;std::string&gt; keys;
      for (typename std::map&lt;std::string, double&gt;::iterator it = arr.begin();
           it != arr.end(); it++)
      {
          keys.push_back(it -&gt; first);
      }
      return keys;
  }
  // ================================================================
  </code></pre>