Hi, On Monday 23 September 2013 09:45:51 Olivier Goffart wrote: > On Sunday 22 September 2013 16:25:25 Thiago Macieira wrote: > > Right now, we allow them and I don't like the idea of forbidding forward > > declarations. > > > > Therefore, doing anything that breaks them is source-incompatible and > > should not be permitted until Qt 6. > > Yes, but as stated, using macro as it was done for QXmlStreamWriter does > not break source or binary compatibility. Hence it is possible to move a > class from one module to a lower module.
I beg to differ!
--snip: header--
class QXmlStreamWriter;
class MyClass
{
public:
MyClass();
//...etc.
private:
QXmlStreamWriter*m_output;
};
--snap: source--
#include <QXmlStreamWriter>
MyClass::MyClass()
:m_output(new QXmlStreamWriter)
{}
--the end--
Before the change: the code worked as expected.
After the change: it does not compile because the forward-declaration declares
a different class than what should have been used and the compiler fails with
incompatible pointers.
I do this all the time to speed up my compiler. (You start to notice the
compiler once you have more than just a couple of C++ files and you are
limited to a small share of an already underperforming machine.)
In other words: broken source compatibility. Period.
Whenever that happens a certain Teutonic programmer forgets that little
invention called "civilization", grabs his battle hammer and screams bloody
murder... ;-)
Konrad
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
