c++ - Difference between QSharedPointer and QSharedDataPointer? -
what difference between these 2 types of pointers? far can read, qsharedpointer can handle situation well, need qshareddatapointer? from qt documentation qshareddatapointer the qshareddatapointer class represents pointer implicitly shared object. qshareddatapointer makes writing own implicitly shared classes easy. qshareddatapointer implements thread-safe reference counting, ensuring adding qshareddatapointers reentrant classes won't make them non-reentrant. implicit sharing used many qt classes combine speed , memory efficiency of pointers ease of use of classes. see shared classes page more information. example usage - #include <qshareddata> #include <qstring> class employeedata : public qshareddata { public: employeedata() : id(-1) { } employeedata(const employeedata &other) : qshareddata(other), id(other.id), name(other.name) { } ~employeedata() { } for qsharedpointer the ...