On Friday, 3 May 2019 11:41:16 PDT Иван Комиссаров wrote: > auto button = layout->addWidget(make_unique<QPushButton>(«RIGHT»)); > button->setFlat(true);
The problem with code that has pre- and post-addition setup is that now you have two objects in the stack, which complicates your stack frame. The compilers aren't currently smart enough to deduce std::unique_ptr whose payload is completely null and can be early-destroyed. I'm wary of making user code less readable, but it's something we should do if it's for a good reason. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel System Software Products _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development