octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: c++ question


From: Shai Ayal
Subject: Re: c++ question
Date: Mon, 12 Oct 2009 10:03:05 +0200

On Mon, Oct 12, 2009 at 9:58 AM, Michael Goffioul
<address@hidden> wrote:
> On Mon, Oct 12, 2009 at 7:37 AM, Jaroslav Hajek <address@hidden> wrote:
>> No, it would work the same if the methods were non-virtual, it plays
>> no role. What you see is a bit unknown C++ feature called "name
>> hiding". In short, methods from base class are not automatically
>> imported into the subclass namespace if there's an overloaded version
>> declared in the subclass. (Trust me, there are good reasons for this).
>
> Thanks, I didn't know about that feature. Maybe the "draw" interface of
> opengl_render class should be changed into "drawXXXX" (drawImage,
> drawText...) such that any future derived class won't be bitten by this
> issue.

I don't see a downside since the actual "dispatch" is done manually
anyway in the opengl_renderer::draw function based on the type of the
object as gathered from it's "type" property. Unless someone has an
abjection I'll make this change

Shai


reply via email to

[Prev in Thread] Current Thread [Next in Thread]