Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Reinhardt Behm
On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote: Hello! 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

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Bo Thorsen
Den 17-10-2014 08:42, Reinhardt Behm skrev: On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote: Hello! 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

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Koehne Kai
-Original Message- From: interest-bounces+kai.koehne=theqtcompany@qt-project.org [mailto:interest-bounces+kai.koehne=theqtcompany@qt-project.org] On Behalf Of Mikhail Matrosov Sent: Wednesday, October 15, 2014 11:57 PM To: interest@qt-project.org Subject: [Interest]

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Reinhardt Behm
On Friday 17 October 2014 09:00:08 Bo Thorsen wrote: Den 17-10-2014 08:42, Reinhardt Behm skrev: On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote: Hello! In modern C++ there is almost no need to use raw *new* and *delete*. As Bjarne Stroustrup is saying in his “A Tour of

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Mikhail Matrosov
On Friday 17 October 2014 09:00:08 Bo Thorsen wrote: * Den 17-10-2014 08:42, Reinhardt Behm skrev: ** On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote: ** Hello! ** ** In modern C++ there is almost no need to use raw *new* and *delete*. As ** Bjarne Stroustrup is saying in his “A

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Bo Thorsen
Den 17-10-2014 10:32, Mikhail Matrosov skrev: On Friday 17 October 2014 09:00:08 Bo Thorsen wrote: / Den 17-10-2014 08:42, Reinhardt Behm skrev: // On Thursday 16 October 2014 01:56:46 Mikhail Matrosov wrote: // Hello! // // In modern C++ there is almost no need to use raw *new* and

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Mikhail Matrosov
Ok, I got your point. Thanks to all for the feedback! - Best regards, Mikhail Matrosov 2014-10-17 12:34 GMT+04:00 Bo Thorsen b...@vikingsoft.eu: Den 17-10-2014 10:32, Mikhail Matrosov skrev: On Friday 17 October 2014 09:00:08 Bo Thorsen wrote: / Den 17-10-2014 08:42, Reinhardt Behm

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Thiago Macieira
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,

Re: [Interest] Qt::MakePointer for creating QPointer as std::make_shared for creating std::shared_ptr

2014-10-17 Thread Mikhail Matrosov
I got another thought on the subject. We ultimately have three allocation options: 1. Create QObject on the stack 2. Create QObject on the heap with a parent 3. Create QObject on the heap without a parent (null parent) In first two options object is deleted automatically (by going out of scope or