C++ (Qt)template<class T>T* adoptChild(std::unique_ptr<T> child) { child->setParent(this); return child.release();}
C++ (Qt)template<class T> void adoptChild(T *child); template<class T> T* adoptChild(std::unique_ptr<T> child);
C++ (Qt) heap_unique<Resource> heap_owner_1 = make_unique<Resource>("heap_resource_1"); weak<Resource> heap_weak{heap_owner_1.get()}; ... heap_unique<Resource> heap_owner_2 = std::move(heap_owner_1);