On Sunday, 15 de January de 2012 20.25.17, Peter Kuemmel wrote: > Technically interesting here is the question how such a > situation cloud be managed? Using C++11 'final' would > prevent the reimplementation. But using pre C++11, the only > idea I have is to define a dummy function with a different > return value, only this why the compiler would complain.
Actually, this *is* a solution. If we change the return value of the virtual
createRequest to int and keep the arguments, someone trying to override it
with the standard function would get a compiler error:
<stdin>:1:224: error: conflicting return type specified for ‘virtual
QNetworkReply* Derived::createRequest(QNetworkAccessManager::Operation, const
QNetworkRequest&, QIODevice*)’
<stdin>:1:105: error: overriding ‘virtual int
QNetworkAccessManager::createRequest(QNetworkAccessManager::Operation, const
QNetworkRequest&, QIODevice*)’
We can use a return type like
ThisFunctionIsDeprecated_InsteadPleaseOverride_createReply.
That said, I don't think it's worth it. Just leave it alone.
--
Thiago Macieira - thiago.macieira (AT) intel.com
Software Architect - Intel Open Source Technology Center
Intel Sweden AB - Registration Number: 556189-6027
Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Development mailing list [email protected] http://lists.qt-project.org/mailman/listinfo/development
