[haiku-commits] Re: haiku: hrev47567 - src/kits/interface

  • From: Stefano Ceccherini <stefano.ceccherini@xxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Thu, 24 Jul 2014 21:19:58 +0200

The order of INHERITED methods doesn't matter.

If class A declares

virtual void foo();
virtual void foo2();


In class B : public A

there is no difference if you declare

virtual void foo();
virtual void foo2();

or

virtual void foo2();
virtual void foo();

Bye!


2014-07-24 20:53 GMT+02:00 John Scipione <jscipione@xxxxxxxxx>:

> On Thu, Jul 24, 2014 at 2:43 PM, Ingo Weinhold <ingo_weinhold@xxxxxx>
> wrote:
> > On 24.07.2014 17:14, jscipione@xxxxxxxxx wrote:
> >>
> >> fef862e: TextView.h rearrage virtual methods for FBC
> >>
> >>    The order is updated so the virtual methods appear in the same order
> >>    that they did in BeOS R5 with methods new to Haiku added to the
> bottom.
> >>
> >>    Perform() moves up, all other methods move below GetDragParameters(),
> >>    the last virtual method in BeOS R5's TextView.h.
> >
> > But you do know that the order of inherited methods doesn't actually
> matter?
> > That being said, I'm all for matching the order in the super classes.
>
> I'm no expert on this, but, according to this:
> http://haiku-os.org/legacy-docs/benewsletter/Issue2-25.html the order
> of virtual functions does matter, "Public Virtual Function Order
> Cannot Change". Maybe this was a restriction of the Metrowerks
> compiler and not something we have to worry about with gcc/clang?
>
>

Other related posts: