Hi,
I just wanted to know whether is this following block of code fully valid in C++:
class A
{
public:
virtual bool b() = 0;
};
class B
{
public:
virtual bool b() = 0;
};
class C: public A, public B
{
public:
virtual bool A::b()
{
return true;
}
virtual bool B::b()
{
return false;
}
};
Using VS2008 it compiles without any errors, however, on GCC (MinGW) 3.4.5 it gives me errors like
cannot declare member function `A::b' within `C'
on the lines where the virtual methods are implemented. I was curious if this is just generally considered invalid and by C++ standards forbidden code (and in VS it thus works thanks to some MS non-standardized magic), or only a bug or unsupported language feature in the GCC.
Thanks for responses.