ass="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
</pre></div>
</div>
<p>The example won&#8217;t ever yield the expected value, because the function mutates
a copy of the objects. Instead, <code class="docutils literal"><span class="pre">std::ref</span></code> should be used:</p>
<div class="highlight-cpp"><div class="highlight"><pre><span></span><span class="n">counter</span> <span class="n">c</span><span class="p">{};</span>
<span class="n">proj</span><span cla