Hi,
I have in my header "Test.h" a variable of a class that doesn't have a constructor without arguments. And I have a constructor like this:
Test::Test() // <-- Here he complains:
// error: no matching function for call to ‘Beer::Beer()’
{
int i = 2;
theVar = Beer(1, i); // Beer(int, int) is the only constructor
}
But I'm initializing it after the (empty) initializer list, in the constructor body.
How can I solve this? How is this problem called, if it has a name?
Thanks