H
Hendrik Schober
#include <iostream>
class B {
public:
virtual ~B() {}
};
class D : private B {
public:
B* getB() {return this;}
};
int main()
{
D d;
B* pb = d.getB();
D* pd = dynamic_cast<D*>(pb);
std::cout << pd;
return 0;
}
When running the above compiled with Comeau
or CW9, it emits '0' ('NULL'). With VC7.1 it
emits an address. I think that's a bug.
Schobi
--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org
"Sometimes compilers are so much more reasonable than people."
Scott Meyers
class B {
public:
virtual ~B() {}
};
class D : private B {
public:
B* getB() {return this;}
};
int main()
{
D d;
B* pb = d.getB();
D* pd = dynamic_cast<D*>(pb);
std::cout << pd;
return 0;
}
When running the above compiled with Comeau
or CW9, it emits '0' ('NULL'). With VC7.1 it
emits an address. I think that's a bug.
Schobi
--
(e-mail address removed) is never read
I'm Schobi at suespammers dot org
"Sometimes compilers are so much more reasonable than people."
Scott Meyers