How to perfect forward a member variable : <p>Consider the following code:</p>

<pre class="lang-cpp prettyprint-override"><code>template&lt;typename T&gt; void foo(T&amp;&amp; some_struct)
{
    bar(std::forward&lt;/* what to put here? */&gt;(some_struct.member));
}
</code></pre>

<p>In the case of forwarding the whole struct I would do <code>std::forward&lt;T&gt;(some_struct)</code>. But how do I get the correct type when forwarding a member?</p>

<p>One idea I had was using <code>decltype(some_struct.member)</code>, but that seems to always yield the base type of that member (as defined in the struct definition).</p>
