Hello!
I've had a simple problem in C++ with mixing inheritance and function overloading. I was just wondering if there were any workarounds. I have those two classes :
class DisplayContext
{
public:
virtual CryoBool create(const DisplayContextStyle & in_style);
CryoBool create(const Size & in_size, CryoBool in_fullscreen = CryoTrue);
};
class RenderContext : public DisplayContext
{
public:
// Overloaded
CryoBool create(const DisplayContextStyle & in_style);
};
The thing is, for some reason having only one of the two overloads virtual causes trouble to the compiler. The problem occurs when I do :
RenderContext rc;
rc.create(Size(800,600), CryoFalse);
The compiler outputs an error, saying that "create" does not take two arguments. So I have to do this :
rc.DisplayContext::create(Size(800,600), CryoFalse);
Which works, but which is ugly.
Anyone knows why I'm getting this problem and if there's a simple solution?