On Monday 18 January 2016 23:11:14 Marc Mutz wrote: > QString foo() { return QStringLiteral("foo"); } > QString bar() { return Q3DeepCopy<QString>(QStringLiteral("foo")); } > > You will _never_ have the plugin-unloading problem with 'bar', only with > 'foo', and the reason is CoW: suggesting value semantics where there aren't > any.
That doesn't mean types without CoW are immune from the problem. There are lots of discussion in the std mailing lists about constexpr data, so in the future a const std::string could potentially point to .rodata and thus be affected by this problem too. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center _______________________________________________ Development mailing list Development@qt-project.org http://lists.qt-project.org/mailman/listinfo/development