On 2015-04-28 6:52 AM, Aryeh Gregor wrote:
But why do you find it
more clear to say |virtual ... final| than |... final|? They both convey
the exact same amount of information. Is it just habit and/or personal
preference?
Personally, I was surprised when I first learned that override/final
can only be used on virtual functions. I was definitely unaware that
override/final imply virtual until I read this thread. It seems David
Baron also didn't know. So I think keeping "virtual" makes things
clearer for people who aren't C++ gurus like you. :) I would wager
that most of our developers would not realize that "void foo()
override;" is a virtual function, especially if they didn't think
about it much.
As I said, I do believe the argument of people being new to these C++11
keywords not knowing what they mean exactly, but the fact that they only
apply to virtual functions usually appears in the first paragraph if not
the first sentence of any documentation I've seen so far (for example,
http://en.cppreference.com/w/cpp/language/override and
http://en.cppreference.com/w/cpp/language/final), so I'd say it is
pretty easy to learn and I do hope that this thread has at least helped
with that a bit.
_______________________________________________
dev-platform mailing list
dev-platform@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-platform