#include <cstdio>
class E1
{
public:
void ReportE1()
{
std::printf("In E1, this is %p\n", this);
}
};
class E2
{
public:
void ReportE2()
{
std::printf("In E2, this is %p\n", this);
}
};
class E3
{
public:
void ReportE3()
{
std::printf("In E3, this is %p\n", this);
}
};
class D: public E1, public E2, public E3
{
};
int main()
{
D d;
d.ReportE1();
d.ReportE2();
d.ReportE3();
}
Reports the same this pointer values if compiled using G++;
However, when I compile it using visual C++ 2010 express, the values reported increment by 1, say 10000,10001,10002. I believe this is not standard compliant, or should I say this was not standard compliant. Is there any way I can set a swith so that it behaves exactly same as in G++?
Thanks!


Sign In
Create Account


Back to top









