[vtk-developers] VTK Coding Standards, C++11 override and =delete
Sean McBride
sean at rogue-research.com
Fri May 6 09:05:12 EDT 2016
On Thu, 5 May 2016 16:30:50 -0400, Brad King said:
>On 05/05/2016 04:05 PM, Sean McBride wrote:
>> On Thu, 5 May 2016 15:55:22 -0400, Marcus D. Hanwell said:
>>
>>> One question I have for style, and I may be a minimalist, but using
>>> the virtual and override keyword for the same declaration seems overly
>>> redundant. The override keyword tells me it is overriding a virtual,
>>> couldn't we just use that? I totally agree on its use, and I know both
>>> are correct, but why not replace virtual with override rather than
>>> keeping both?
>>
>> Seems like that would greatly complicate maintaining C++03 compatibility.
>
>C++03 does not require the virtual specifier to be present in overriding
>method declarations either. Some coding style guides even forbid it.
Ah. Some googling suggests it was a popular style choice pre-C++11, which makes sense. I'm so used to seeing it, I guess I thought it was required.
A rough count of "ITK_OVERRIDE" gives 5528 hits, "virtual.*ITK_OVERRIDE" gives 3466. In the llvm codebase, they seem to very rarely use both.
Considering VTK max line width is 80 chars, I think I'm in favour of omitting it too.
If there's consensus, I'll update my MR.
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng sean at rogue-research.com
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
More information about the vtk-developers
mailing list