A potential problem is that this points to an object that has not been fully constructed. For example, if you have this:
template<class T> struct fun { fun(T* pointer) : memberPointer(pointer) { memberPointer->callMethod();
you will encounter undefined behavior because you will pass a pointer to an incompletely constructed object, where only a pointer to a fully constructed object should be passed. I intentionally created some crappy code with UB to be more convincing, in real life you will not necessarily have a UB problem, sometimes all objects will be in the correct states, so you will get some very subtle initialization order errors.
This is none of your business. Your business is in order - you do not care that the object is not yet fully constructed. However, you must be careful when changing the code so that you do not fall into the script as described above.
source share