Opened 5 months ago

Closed 5 months ago

Last modified 5 months ago

#16097 closed enhancement (fixed)

Missing virtual keyword in include files

Reported by: troelsk Owned by:
Priority: normal Milestone:
Component: base Version: dev-latest
Keywords: Cc:
Blocked By: Blocking:
Patch: yes

Description

Patch adding some missing virtual:
include/wx/generic/dvrenderers.h
include/wx/stream.h
include/wx/wfstream.h
Makes it a little easier to follow and understand the code path.

Attachments (1)

virtual.patch download (10.0 KB) - added by troelsk 5 months ago.

Download all attachments as: .zip

Change History (7)

Changed 5 months ago by troelsk

comment:1 Changed 5 months ago by astronothing

Too bad we can't use the override specifier in C++ 11 :(

comment:2 Changed 5 months ago by troelsk

override is in C# also, is good.
BTW there must a tool for finding missing virtual's? (I did these manually)

comment:3 Changed 5 months ago by plorkyeran

override doesn't have any functional impact, so you could have a WX_OVERRIDE that's defined to override if wx is being built as C++11.

comment:4 Changed 5 months ago by vadz

Yes, we definitely should add wxOVERRIDE or, maybe, even just use override itself and #define it as nothing for pre-C++11 compilers.

comment:5 Changed 5 months ago by VZ

  • Resolution set to fixed
  • Status changed from new to closed

(In [76170]) Use "virtual" keyword with overridden methods.

No real changes, just make the code more clear by explicitly using "virtual".

Closes #16097.

comment:6 Changed 5 months ago by plorkyeran

just use override itself and #define it as nothing for pre-C++11 compilers.

That's break a lot of code, since it's a perfectly legal name in both C++03 and C++11 (it's a contextual keyword that takes advantage of that symbol names can't appear where override and final go).

Note: See TracTickets for help on using tickets.