Things To Look Out For In Reviews: Difference between revisions
Jump to navigation
Jump to search
(Created.) |
(Start section on new classes) |
||
Line 12: | Line 12: | ||
* enums should either be scoped or have an explicit underlying type. '''Rationale:''' prevents the enum's underlying_type to change (which would be BiC). References: http://eel.is/c++draft/enum#dcl.enum-7.sentence-3, https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#The_Do's_and_Don'ts (Point 3) | * enums should either be scoped or have an explicit underlying type. '''Rationale:''' prevents the enum's underlying_type to change (which would be BiC). References: http://eel.is/c++draft/enum#dcl.enum-7.sentence-3, https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#The_Do's_and_Don'ts (Point 3) | ||
== New Classes == | |||
Make sure new classes follow the [https://codereview.qt-project.org/c/meta/quips/+/321050 draft value-class mechanics QUIP-22]. | |||
=== Polymorphic Classes === | |||
- Make dtor out-of-line, even if empty (then =default it). '''Rationale:''' pins the vtable to a single TU (and prevents -Wweak-vtable warnings). References: https://bugreports.qt.io/browse/QTBUG-45582 | |||
= Decided To Keep Here = | = Decided To Keep Here = | ||
(make a proper subsection grouping when moving stuff here) | (make a proper subsection grouping when moving stuff here) |
Revision as of 08:36, 5 January 2024
This page is a low-entry-bar staging area for potential project-wide guidelines. After each release, we should go over each of these and decide whether we keep them here, or, preferably, fold them into [API Design Principles], [Qt Coding Style], [Coding Conventions] or a new or existing QUIP.
Newly-Added Things
When adding a new Thing, don't forget to provide rationale.
Enums
- add a trailing comma to end of enumerators if a line break follows. Rationale: prevents the previous line from needing to change when adding more. Example: https://codereview.qt-project.org/c/qt/qtremoteobjects/+/528328/comment/9b8677ff_4ce9831a/
- enums should either be scoped or have an explicit underlying type. Rationale: prevents the enum's underlying_type to change (which would be BiC). References: http://eel.is/c++draft/enum#dcl.enum-7.sentence-3, https://community.kde.org/Policies/Binary_Compatibility_Issues_With_C%2B%2B#The_Do's_and_Don'ts (Point 3)
New Classes
Make sure new classes follow the draft value-class mechanics QUIP-22.
Polymorphic Classes
- Make dtor out-of-line, even if empty (then =default it). Rationale: pins the vtable to a single TU (and prevents -Wweak-vtable warnings). References: https://bugreports.qt.io/browse/QTBUG-45582
Decided To Keep Here
(make a proper subsection grouping when moving stuff here)