On Wednesday 2013-09-04 14:28 +1000, Cameron McCormack wrote:
> Bobby Holley wrote:
> >+1. EIBTI.
> 
> I agree, though MOZ_OVERRIDE does imply that the function is virtual
> already, so it may not be so necessary there.

I also support repeating virtual as good documentation.

The introduction of MOZ_OVERRIDE (which is newer than most of our
existing code) perhaps offers a reason not to bother anymore,
though.  But I think it's useful to have |virtual| be explicit.

> There are many cases of member function declarations like:
> 
>   /* virtual */ void theFunction();

I don't recall that convention for declarations, but what I do write
quite often is the same thing in function *definitions*, where
virtual (and static, for static methods) aren't allowed to be
repeated.  In other words, I generally write:

  class Foo {
    virtual void do_something();
  };

  /* virtual */ void
  Foo::do_something()
  {
  }

-David

-- 
𝄞   L. David Baron                         http://dbaron.org/   𝄂
𝄢   Mozilla                          https://www.mozilla.org/   𝄂
             Before I built a wall I'd ask to know
             What I was walling in or walling out,
             And to whom I was like to give offense.
               - Robert Frost, Mending Wall (1914)

Attachment: signature.asc
Description: Digital signature

_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to