I have created a class and initialized an array of objects through constructor, why or why not copy constructor is getting called here? Is it copy elision?
#include<iostream>
#include<stdio.h>
class ABC
{
int x, y;
public:
ABC()
{
x = 0;
y = 0;
}
ABC(int a,int b)
{
x = a;
y = b;
}
ABC(const ABC &obj)
{
std::cout<<"Copy called";
}
};
int main()
{
ABC obj[2] = {ABC(), ABC(5,6)}; //copy elision or copy constructor?
}