[Development] Contribute to the Qt

Marc Mutz marc.mutz at kdab.com
Fri Jul 24 13:47:59 CEST 2015


On Friday 24 July 2015 10:30:32 Peter Kuemmel wrote:
> > Or do you want to help improve the C++11 support in Qt?
> 
> Is there a TODO list about possible improvements?
> And what's the policy about C++14? Isn't C++14 mostly
> a patch/cleanup of C++11?

List: we have the list from Thiago, which I asked yesterday on the list about 
re: consensus. That'd be

- make sure public headers use Q_NULLPTR, not 0 (the devil is in the details
  here, just adding the warning to headerscheck doesn't find 0s in templates).
- make sure Q_DECL_OVERRIDE is added everywhere (postponed to 5.7 for now)
- make sure Q_DECL_NOTHROW / Q_DECL_NOEXCEPT / Q_DECL_NOEXCEPT_EXPR is added
  to relevant functions
- make sure Q_DECL_(RELAXED_)CONSTEXPR is added whereever possible

To which I'd add:

- add qMove()s where it makes sense (e.g. QVector::append() these days).

My personal agenda:

- make sure value types aren't pessimised by careless disabling of the move
  special member functions (move assignment is generally easy, move ctors need
  the new smart pointer (https://codereview.qt-project.org/115213) and need to
  work with both QSharedDataPointer _and_ QExplicitlySharedDataPointer before
  they can be safely ported to QtPrivate::SharedDataPointer - that turns out
  to be surprisingly tricky in certain cases).
- ditto, but in addition they're nothrow

std::vector resizing performance heavily depends on a nothrow move 
constructor. But also QVector has gained _some_ move support (in append(), 
both lvale and rvalue overloads).

C++14: There's not much different in terms of API design between C++11 and 14. 
Basically, currently we only have Q_DECL_RELAXED_CONSTEXPR vs. 
Q_DECL_CONSTEXPR. If we have polymorphic function objects, we probably should 
add is_transparent to them, but I don't think we have any. Well, QCollator 
maybe. 

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt Experts



More information about the Development mailing list