I was wondering if someone can explain this macro to me.
#define Q_DECLARE_PRIVATE(Class) \
inline Class##Private* d_func() { return reinterpret_cast<Class##Private
*>(d_ptr); } \
inline const Class##Private* d_func() const { return reinterpret_cast<const
Class##Private *>(d_ptr); } \
friend class Class##Private;
I have an application that uses QT and it crashes with an access violation exception on the last line from the following snippet.
class Q_GUI_EXPORT QWidget : public QObject, public QPaintDevice
{
Q_OBJECT
Q_DECLARE_PRIVATE(QWidget)
and what can cause a null pointer operation in on the last line?
The compiler can explain it best of all:
will put foo.cc to stdout after passing through the pre-processor. It lets you see what the compiler sees which (especially with token pasting) is usually less than obvious.