Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-15 Thread Simon Richter
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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-14 Thread Cheng Sheng
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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-14 Thread Lorenzo Marcantonio
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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-14 Thread Mark Roszko
>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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-13 Thread Cheng Sheng
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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-12 Thread Simon Richter
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

Re: [Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-07-12 Thread Wayne Stambaugh
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.

[Kicad-developers] [PATCH 0/4] Use of "virtual" and "override" keywords

2016-05-01 Thread Simon Richter
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