On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote:
> In modern C++ there is almost no need to use raw *new* and *delete*. As
> Bjarne Stroustrup is saying in his “A Tour of C++”: “Avoid ‘‘naked’’ new
> and delete operations; §4.2.2.”. We use standard containers and smart
> pointers for that, with std::make_shared and std::make_unique functions for
> smart pointers creation.

QPointer is the wrong class for this, since QPointer is a non-owning weak 
reference.

If you want an equivalent of std::make_shared, you're looking at the 
QSharedPointer class. And it already has an equivalent: 
QSharedPointer<T>::create().

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

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to