A
Alexander Stippler
I know using this in a class initializer list has to be dealt with with
care. I fear for "*this" it is even worse. Is it legal at all - what
does the standard say?
My situation is somewhat like:
struct B;
struct A
{
A(const B &_b) : b(_b) {}
const B &b;
};
struct B
{
B() : a(*this) {}
A a;
};
I just want this reference. No member access or similar (in the
construction process).
Allowed (and reasonable?) by standard or not?
best regards,
Alex
care. I fear for "*this" it is even worse. Is it legal at all - what
does the standard say?
My situation is somewhat like:
struct B;
struct A
{
A(const B &_b) : b(_b) {}
const B &b;
};
struct B
{
B() : a(*this) {}
A a;
};
I just want this reference. No member access or similar (in the
construction process).
Allowed (and reasonable?) by standard or not?
best regards,
Alex