title: c++11 variadic templates and std::endl
body: <p>I tried to do logger using C++11 variadic templates, but it doesn't work for <code>std::endl</code>, because <code>std::endl</code> is template function and the compilator doesn't know what specialization of <code>std::endl</code> to select. Is there any way how i can force to always select <code>std::endl&lt;char, std::char_traits&lt;char&gt;&gt;</code>? If possible, i want to use directly std::endl.</p>
  
  <p><strong>EDIT:</strong> it looks like it is not currently possible with C++11 and and best way is to use <code>#define</code> or what <em>vsoftco</em> answered.</p>
  
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;iostream&gt;
  #include &lt;string&gt;
  
  class Logger {
  
  public:
  
      template&lt;typename T&gt;
      void log(T val);
  
      template &lt;typename T, typename ...Args&gt;
      void log(T val, Args... args);
  
  };
  
  // explicit specialization not working 
  template&lt;&gt;
  void Logger::log(std::basic_ostream&lt;char, std::char_traits&lt;char&gt;&gt; (*modifier) (std::basic_ostream&lt;char, std::char_traits&lt;char&gt;&gt;)) {
  
      std::cout &lt;&lt; modifier;
  
  }
  
  template&lt;typename T&gt;
  void Logger::log(T val) {
  
      std::cout &lt;&lt; val;
  
  }
  
  template&lt;typename T, typename ...Args&gt;
  void Logger::log(T val, Args... args) {
  
      log(val);
      log(args...);
  
  }
  
  int main(int argc, char* argv[])
  {   
      Logger log;
  
      log.log("Nazdar ", "bazar ", "cau", std::endl, "kik"); // ERROR: cannot determine which instance of function template "std::endl" is intended
      log.log("Nazdar ", "bazar ", "cau", std::endl&lt;char, std::char_traits&lt;char&gt;&gt;, "kik");
  
      std::cin.get();
  
      return 0;
  }
  </code></pre>