title: Get the name of a std::function
body: <p>In the following toy-example, I would like to get the name of a function. The function itself was given as an <code>std::function</code> argument. Is it possible in C++ to get name of a <code>std::function</code> object?</p>
  
  <pre><code>void printName(std::function&lt;void()&gt; func){
      //Need a function name()
      std::cout &lt;&lt; func.name();
  }
  
  void magic(){};
  
  //somewhere in the code
  printName(magic());
  
  output: magic
  </code></pre>
  
  <p>Otherwise I would have to give the function's name as a second parameter.</p>