title: Force an object to be passed as copy to a function receiving a universal reference
body: <p>I'm trying to pass a local lambda function to a <code>std::bind</code> (for passing to a <code>connect</code> function of a signal):</p>
  
  <pre><code>void f()
  {
      auto signal_f = [this](int, int) { /* ... */ };
  
      namespace ph = std::placeholders;
      signal.connect(std::bind(signal_f, ph::_1, ph::_2));
  }
  </code></pre>
  
  <p>But the function parameter of <code>std::bind</code> is received as a universal reference:</p>
  
  <pre><code>template&lt;class F, class... Args&gt;
  /* unspecified */ bind(F&amp;&amp; f, Args&amp;&amp;... args);
  </code></pre>
  
  <p>So, since my lambda object is a named object, it's passed as a lvalue reference , but my lambda object will be destroyed after <code>f()</code> exists, potentially causing memory leaks when the signal is emited.</p>
  
  <p>What is the simplest way of passing that object by copy?</p>
  
  <p>Of course, I could do always things like:</p>
  
  <pre><code>signal.connect(std::bind&lt;std::decay&lt;decltype(signal_f)&gt;::type&gt;
     (signal_f, ph::_1, ph::_2));
  </code></pre>
  
  <p>of other tricky ways but they are too cumbersome, so, what is the simplest way of doing it?</p>
  
  <p><strong>NOTE</strong>: Is there any function from the standard library to create a copy, something like <code>std::make_rvalue(o)</code> or a <code>std::copy</code> version for objects instead of for containers?</p>