Undefined behaviour of const_cast when we return mutable object from class
<p>I am not sure about const_cast in this case. Do we have undefined behaviour or not?</p>

<pre><code>#include &lt;iostream&gt;
#include &lt;vector&gt;

using namespace std;

struct A {
    mutable vector&lt;int&gt; a;
    A() : a(1,2) {}
    const vector&lt;int&gt;&amp; get() const {
        return a;
    }
};

int main()
{
    A a;
    vector&lt;int&gt; &amp;b = const_cast&lt;vector&lt;int&gt;&amp;&gt;( a.get() );
    b[0] = 3;
    cout &lt;&lt; a.a[0] &lt;&lt; endl;
}
</code></pre>