title: Copy constructor call missing
body: <p>Below is the code I am trying to figure out with the copy constructor and = operator overloading.
  Below I have commented line with the copy constructor ambguity.</p>
  <h1>Code:</h1>
  <pre><code>using namespace std;
  
  class A{
          int a;
      public:
          A(int x = 0){a=x; cout&lt;&lt;&quot;Called ctor for&quot;&lt;&lt;a&lt;&lt;endl;}
          A(const A &amp;obj){cout&lt;&lt;&quot;Copy Ctor called&quot;&lt;&lt;endl;a = obj.a;}
          void set(int x){a=x;}
          int get(){return a;}
          A operator+(const A &amp;);
          A operator*(const A &amp;);
          void operator=(const A &amp;);
  };
  
  A A::operator +(const A &amp;obj){
      cout&lt;&lt;&quot;Inside + operator&quot;&lt;&lt;endl;
      return a + obj.a;
  }
  
  A A::operator *(const A &amp;obj){
      cout&lt;&lt;&quot;Inside * operator&quot;&lt;&lt;endl;
      return a * obj.a;
  }
  
  void A::operator =(const A &amp;obj){
      a = obj.a;
      cout&lt;&lt;&quot;= operator is called&quot;&lt;&lt;endl;
  }
  
  int main(){
      A a(10), b(11);
      A c = a + b;    // Why isn't copy ctor is called for this statement?
      c = a+b;
      cout&lt;&lt;&quot;Value: &quot;&lt;&lt;c.get()&lt;&lt;endl;
      cout&lt;&lt;&quot;Value: &quot;&lt;&lt;(a*b).get()&lt;&lt;endl;
      return 0;
  }
  </code></pre>
  <h1>Output:</h1>
  <pre><code>Called ctor for10
  Called ctor for11
  Inside + operator
  Called ctor for21  //Just ctor of the temp object from the operator+ () called.
  Inside + operator
  Called ctor for21
  = operator is called
  Value: 21
  Inside * operator
  Called ctor for110
  Value: 110
  </code></pre>
  <p>Please explain why copy constructor is not being called in this case?</p>