Is it ok to pass *this in the constructor in the following example

Posted by Nikhil on Stack Overflow See other posts from Stack Overflow or by Nikhil
Published on 2010-03-20T19:24:30Z Indexed on 2010/03/20 19:31 UTC
Read the original article Hit count: 213

Filed under:
Class A
{
  A(B& b) : mb(b) 
   {}

  B& mb;
};


Class B
{
B(): a(*this)
{}

A a;
}

© Stack Overflow or respective owner

Related posts about c++