Why is the move constructor not called?
<p>As per my understanding, the move constructor will be called when there is a temporary object created. Here the <code>getA()</code> function is returning a temporary object but my program is not printing the message from the move constructor:</p>

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

using namespace std;

class A
{
    public:
    A()
    {
        cout&lt;&lt;"Hi from default\n";
    }

    A(A &amp;&amp; obj)
    {
        cout&lt;&lt;"Hi from move\n";
    } 
};

A getA()
{
    A obj;
    cout&lt;&lt;"from getA\n";
    return obj;
}

int main()
{
    A b(getA());

   return 0;
}
</code></pre>