Given:-
What do you mean by invoking the constructor just like that ?Code:
class A
{
public:
A() { cout << "A constructed\n"}
A(int i) : x(i) {}
private:
int x;
};
int main()
{
vector < A > temp;
A();
temp.push_back(A(3));
system("pause");
return 0;
}
What do you mean by passing the constrctor into the vector temp ?