class Foo { public: explicit Foo() {} explicit Foo(Foo&) {} }; Foo d = Foo();
error: no matching function for call to \
The compiler is telling you... Use this:
Foo(const Foo&) {}