Type of member variable should depend on constructor argument's type : <p>I try to define a class <code>A</code> as follows:</p>

<pre><code>template&lt; typename T &gt;
class A
{
  public:
    A( T elem )
      : _elem( elem )
    {}

  private:
    TYPE _elem; // "TYPE" should be either "T" in case "elem" is an r-value or "T&amp;" in case "elem" is an l-value.
};
</code></pre>

<p>Here, I want <code>_elem</code> to have either the type <code>T</code> in case that the constructor's argument <code>elem</code> is an r-value or the type <code>T&amp;</code> in case <code>elem</code> is an l-value. </p>

<p>Does anyone know how this can be implemented?</p>
