FWIW, I like to write both virtual and MOZ_OVERRIDE.
I care a lot about always using MOZ_OVERRIDE when applicable. For virtual
(when MOZ_OVERRIDE is present) I suppose it is more of a matter of tastes.
Always explicitly writing both virtual and MOZ_OVERRIDE is a simpler rule
than marking virtual only in the cases where needed.
Plus, virtual is highlighted in our editors and people often (at least I)
get used to looking for the answer to "is it virtual?" by glancing at the
beginning of the line in the declaration. So I find always explicitly
writing virtual to be easier to read.

Cheers,

Nical


On Wed, Sep 4, 2013 at 6:45 AM, Chris Pearce <cpea...@mozilla.com> wrote:

> On 04-Sep-13 4:18 PM, Robert O'Callahan wrote:
>
>> I like to put "virtual" on all methods that are virtual, even when it's
>> not
>> strictly necessary because the method overrides a virtual method  of the
>> parent class.
>>
>> Other people disagree, especially when the method has MOZ_OVERRIDE on it
>> as
>> well.
>>
>
> "virtual" on non-overrides, MOZ_OVERRIDE on overrides. MOZ_OVERRIDE
> implies virtual, you get a compile error when you put MOZ_OVERRIDE on a non
> virtual, so it enforces that you're doing what you think you're doing, so
> we should use it.
>
>
> Chris P.
>
>
> ______________________________**_________________
> dev-platform mailing list
> dev-platform@lists.mozilla.org
> https://lists.mozilla.org/**listinfo/dev-platform<https://lists.mozilla.org/listinfo/dev-platform>
>
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform

Reply via email to