I'm trying to use forward declarations and d-pointers to eliminate some include dependencies. Everything is working well, except that I have used XList typedefs for readability in many places (e.g: typedef QList<X> XList
).
The workaround for the typedef forward declaration issue is to use inheritance: class XList : public QList<X>{};
.
QList has a non-virtual destructor. Given the fact that Qt's own QStringList inherits QList<QString>
and I'm not allocating XLists on the heap, do you see any problems with this workaround? Should I explicitly disallow heap allocations for the XList classes?