D27626: refactor: fix various compiler warnings

2020-02-25 Thread Daniel Vrátil
This revision was automatically updated to reflect the committed changes. Closed by commit R104:51fd586686a8: refactor: fix various compiler warnings (authored by dvratil). REPOSITORY R104 KScreen CHANGES SINCE LAST UPDATE https://phabricator.kde.org/D27626?vs=76302&id=76377 REVISION DETAIL

D27626: refactor: fix various compiler warnings

2020-02-25 Thread Daniel Vrátil
dvratil added a comment. Also note that `noexcept` is not a compile-time check, it's a hint to enable some optimizations. It makes a difference when using standard library containers, e.g. `std::vector` will perform a copy if `T`'s move constructor is not `noexcept` in order to guarantee str

D27626: refactor: fix various compiler warnings

2020-02-25 Thread Daniel Vrátil
dvratil added a comment. A good rule of a thumb is that your move constructor and assignment operator should always be `noexcept` unless you have a very good reason for them not to be. Qt has most move constructors marked as noexcept - I found a few that are not marked but that looks more li

D27626: refactor: fix various compiler warnings

2020-02-25 Thread Roman Gilg
romangg added inline comments. INLINE COMMENTS > dvratil wrote in output_model.h:90 > Because in `output_model.cpp:224` we do `m_outputs.insert(i, Output(output, > pos))`, which can make use of move semantics. > > Making move operations `noexcept` is part of Cpp Core Guidelines >

D27626: refactor: fix various compiler warnings

2020-02-25 Thread Daniel Vrátil
dvratil added inline comments. INLINE COMMENTS > romangg wrote in output_model.h:90 > Why to add and why noexcept? Because in `output_model.cpp:224` we do `m_outputs.insert(i, Output(output, pos))`, which can make use of move semantics. Making move operations `noexcept` is part of Cpp Core Gui

D27626: refactor: fix various compiler warnings

2020-02-24 Thread Roman Gilg
romangg added inline comments. INLINE COMMENTS > output_model.h:90 > {} > +Output(Output &&) noexcept = default; > Output(KScreen::OutputPtr _ptr, const QPoint &_pos) Why to add and why noexcept? REPOSITORY R104 KScreen REVISION DETAIL https://phabricator.kde.org/

D27626: refactor: fix various compiler warnings

2020-02-24 Thread Daniel Vrátil
dvratil created this revision. dvratil added a reviewer: Plasma. Herald added a project: Plasma. Herald added a subscriber: plasma-devel. dvratil requested review of this revision. REVISION SUMMARY Fixes pessimizing move, implicit copy assignment operator, copies in range for loops, deprecated