Hi,
On 14.07.2016 16:17, Mark Roszko wrote:
> If you put virtual blah() in struct C without override, you can be
> creating a new virtual function if the signature does not match and
> its completely valid.
Right, but that is something we can catch with "override".
The reason I like to have
To Simon: Fair. It is indeed a little odd that C++ committee decides to put
one before but one after the signature. Only that you might want to write
it in the style guide; otherwise, both styles will appear in the future.
To Mark: I said {the use of both is redundant}, not {one of them is
On Thu, Jul 14, 2016 at 10:17:10AM -0400, Mark Roszko wrote:
> If you put virtual blah() in struct C without override, you can be
> creating a new virtual function if the signature does not match and
> its completely valid.
This happens to me about 99% of the times I change a function signature
>It is redundant (you cannot override a non-virtual function)
a() and b() in struct c in the example are virtual in both parents.
override is simply a check to tell the compiler you intend to override
a() and b() from parent classes.
If you put virtual blah() in struct C without override, you
Why both "virtual" and "override" in "struct C"? It is redundant (you
cannot override a non-virtual function). See
http://en.cppreference.com/w/cpp/language/override.
Regards,
Cheng
On Wed, Jul 13, 2016 at 1:27 AM, Simon Richter
wrote:
> Hi Wayne,
>
> On 12.07.2016
Hi Wayne,
On 12.07.2016 16:07, Wayne Stambaugh wrote:
> I was looking over this patch set and before I apply it I want to be
> sure that all base class functions declared as virtual are explicitly
> declared as override in the derived classes. It's a very large patch
> set and I don't have time
Simon,
I was looking over this patch set and before I apply it I want to be
sure that all base class functions declared as virtual are explicitly
declared as override in the derived classes. It's a very large patch
set and I don't have time to confirm that this is the intent of these
patches.
Hi,
C++ has a misfeature where methods in derived classes can be virtual
without that being immediately obvious, which makes class definitions a bit
harder to read than strictly necessary because it isn't immediately obvious
what is happening.
In C++11, this is still the case, but at least we
8 matches
Mail list logo