A
Andrey Vul
Given the following:
class Bar {};
class Foo {
Bar *parent;
Foo(Bar *p, const Foo& f = 0) {
parent = p;
if (f != 0) {
/* do something with f */
}
}
};
Why does the compiler die while Foo& =0 is used, but works when Foo*
=0 is used?
class Bar {};
class Foo {
Bar *parent;
Foo(Bar *p, const Foo& f = 0) {
parent = p;
if (f != 0) {
/* do something with f */
}
}
};
Why does the compiler die while Foo& =0 is used, but works when Foo*
=0 is used?