Search code examples
c++copy-constructordefault-constructordefault-copy-constructor

Does the implicitly defined copy constructor in C++ call copy constructor for members too right?


Just want to double check that the default (implicitly defined by compiler) copy constructor for C++ classes performs the copy constructor on each member variable as well using the old value to get the copied value for each member and for atomic objects just uses a bit copy (e.g. ints and floats)


Solution

  • Yes, that is exactly what it does.