warning C4355: 'this' : used in base member initializer list
Hi,
I'm passing a reference to an object to another object which is hold by composition like this:
Code:
class A;
class B : boost::noncopyable
{
A& mParent;
public:
B(A& parent)
:mParent(parent)
{}
};
class A : boost::noncopyable
{
B mB;
public:
A() // warning
:mB(*this)
{}
};
int main() {}
and I'm getting the following warning, which was never apparent to me before (while using composition regulary):
Quote:
warning C4355: 'this' : used in base member initializer list
What I'm doing wrong this monday?
THank you in advance!