title: How to pass template function with default arguments to std::call_once
body: <p>I need to use std::call_once in my templatized singleton class but currently below sample code is not compiling :</p>
  
  <pre><code>std::once_flag flag;
  class LifeTrackerHelper
  {
  public:
  template&lt;class T&gt;
  inline static int SetLongevity(std::unique_ptr&lt;T&gt;&amp; pobj,unsigned int longevity = 0)
  {
      return 0;
  }
  };
  template&lt;class T&gt;
  class Singleton
  {
     public:    
     inline static T* getInstance()
     {
       static std::unique_ptr&lt;T&gt; ptr(new T());  
       std::call_once(flag,&amp;LifeTrackerHelper::SetLongevity&lt;T&gt;,ptr);  
       //static int i = LifeTrackerHelper::SetLongevity&lt;T&gt;(ptr);
       // if call_once is commented and above line uncommented this will work
       return ptr.get();
     }
  };
  class Test
  {
      public:
      void fun()
      {
          std::cout&lt;&lt;"Having fun...."&lt;&lt;std::endl;
      }
  };
  int main()
  {
  
    Singleton&lt;Test&gt;::getInstance()-&gt;fun(); 
  }
  </code></pre>
  
  <p>So need help in understanding how to properly use std::call_once here.</p>