C++ (Qt)#include <list>#include <QList> class NonCopyable{public: NonCopyable(const NonCopyable&) = delete; NonCopyable(NonCopyable&&) = default;}; int main(){ std::list<NonCopyable> std_list; std_list.push_back(NonCopyable{}); QList<NonCopyable> q_list; q_list.push_back(NonCopyable{});}
auto img = loadImage(...);QList<QImage> list;list.append(img);
auto str = QStringLiteral("hello");QList<QString> list;list.append(str);
C++ (Qt) QVector<std::unique_ptr<MyClass>> q_vector; q_vector.append(std::make_unique<MyClass>());