I was wondering why an error like this would occur.
no matching function for call to 'Foo::Foo()'
in code for a copy constructor? Assume Foo is just an object with normal fields ( no dynamically allocated memory, etc. ), and the only constructor it has defined is a constructor that takes one argument.
I didn't even know the constructor needed to be considered though. If the code says something like
bar = thing.bar; //
and bar is of Foo type, with the specifications described above, shouldn't it just generate a shallow copy and be done with it? Why does a default constructor need to be invoked?