[Interest] QScopedPointer and c++11 move semantics

Kitsune Ral Kitsune.Ral at protonmail.ch
Sun Jan 1 12:06:09 CET 2017


I think the code I gave is C++17 because of http://en.cppreference.com/w/cpp/language/class_template_deduction



--
Kitsune Ral



-------- Original Message --------
Subject: Re: [Interest] QScopedPointer and c++11 move semantics
Local Time: 31-an de decembro, 2016 8:49 P.T.M.
UTC Time: 31-an de decembro, 2016 11:49
From: thiago.macieira at intel.com
To: interest at qt-project.org

Em sexta-feira, 30 de dezembro de 2016, às 22:41:14 BRST, Kitsune Ral via
Interest escreveu:
> The most concise, I guess, is:
> static const auto laterDeleter = std::mem_fn(&QObject::deleteLater);
> std::unique_ptr<QObject, decltype(laterDeleter)> a(nullptr, laterDeleter);
>
> In C++17, if I don't mistake, you won't ned explicit type specifier in the
> template, so it shortens to: std::unique_ptr<QObject> a(nullptr,
> std::mem_fn(&QObject::deleteLater));

I don't think that's plain C++17, that's actually the Concepts TS.

--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center

_______________________________________________
Interest mailing list
Interest at qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20170101/38ab94ee/attachment.html>


More information about the Interest mailing list