In C++, is there a difference between declaring a copy constructor default as opposed to not declaring one at all? For visualization:
class A{
int x;
}
vs
class B{
int x;
B() = default;
B(const B&) = default;
}
How about default copy assignment, default move constructor, and default move assignment? If I'm just going to declare them as default, could I just as well not declare them at all?
I looked on the internet and haven't been able to find an answer
B(const B&) = default;suppresses the compiler from generating an implicitB(B&&)move constructor, implicitB& operator=(B&&)move assignment, and will eventually also suppress an implicitB& operator=(B const&)copy assignment. q.v. the table at the bottom of Howard Hinnant explanation blog page.