title: Can I define a private template function outside of a class?
body: <p>I have two template functions, <code>generatePerms</code> and <code>permute</code> in a header file (not for a class, just a general header file with utility-type functions). I want <code>generatePerms</code> to be publicly accessible, but <code>permute</code> should not be. Is there any way to do this? I don't think I can use <code>public:</code> and <code>private</code> outside of a class, but maybe there's a way to structure the header file that can achieve this end?</p>
  
  <p>Example header file:</p>
  
  <pre><code>//header.hpp
  #ifndef H_UTILITY
  #define H_UTILITY
  
  #include &lt;vector&gt;
  
  //this one should be private
  template &lt;typename T&gt;
  void permute( std::vector&lt;T&gt; values, int n, std::vector&lt;T&gt; *perms ){ /* do stuff */ }
  
  //this one should be public
  template &lt;typename T&gt;
  std::vector&lt;T&gt; generatePerms( std::vector&lt;T&gt; values, int n ){ /* do stuff, calls permute() */ }
  
  #endif
  </code></pre>