GCC 4.5 doesn't let me do this:
class foo {
public:
foo() = default;
private:
foo(foo const&) = default;
foo& operator=(foo const&) = default;
};
It complains that:
error: 'foo::foo(const foo&)' declared with non-public access cannot be defaulted in the class body
error: 'foo& foo::operator=(const foo&)' declared with non-public access cannot be defaulted in the class body
However, GCC 4.6 lets me do it. Which one is correct?