Why should optional<T&> rebind on assignment? : <p>There is an ongoing debate about what <code>optional</code> and <code>variant</code> should do with reference types, particularly with regards to assignment. I would like to better understand the debate around this issue. </p>

<pre><code>optional&lt;T&amp;&gt; opt;
opt = i;
opt = j; // should this rebind or do i=j?
</code></pre>

<p>Currently, the decision is to make <code>optional&lt;T&amp;&gt;</code> ill-formed and make <code>variant::operator=</code> ill-formed if any of the types is a reference type - to sidestep the argument and still give us most of the functionality. </p>

<p>What is the argument that <code>opt = j</code> <em>should</em> rebind the underlying reference? In other words,  why <em>should</em> we implement <code>optional</code> like this:</p>

<pre><code>template &lt;class T&gt;
struct optional&lt;T&amp;&gt; {
    T* ptr = nullptr;

    optional&amp; operator=(T&amp; rhs) {
        ptr = &amp;rhs;
        return *this;
    }
};
</code></pre>
