I am using this pretty simple class without using any inheritance.
class A
{
int a;
int b;
public:
A(int x, int y) { a = x; b = y;}
A() :A(0,0){};
~A(){};
} ;
int main ()
{
A a1, a2(5, 7) ;
}
I get this error.
error C2614: 'A' : illegal member initialization: 'A' is not a base or member
There are similar questions on SO but they relate to inheritance. Can someone explain the reason and what does standard say about that?
EDIT:
It would be better if someone elaborate more on the forwarding constructor and this feature in C++11.