I don’t think this will work for you if you haven’t set warning level 4 (or similar, I assume Visual Studio) and turned on “handle warnings as errors”.
Basically, this warning is a “Good Thing”, as it will not allow you to accidentally use the this pointer when what it points to is not yet built.
However, when you know what you are doing, where this is passed in the initialization list, the warning and error caused by this will be annoying.
You can get rid of it (again, by accepting Visual Studio) by decorating the constructor (if it is not defined in the class declaration), then you should decorate the whole class):
// warning C4355: 'this' : used in base member initializer list
Johann Gerell Oct 23 '10 at 22:01 2010-10-23 22:01
source share