gcc -Woverloaded-virtual

Aurélien Gâteau aurelien.gateau at free.fr
Mon Nov 26 17:05:25 GMT 2007


David Faure wrote:
>> As for removeSubjob(), I found two calls to removeSubjob(job, true).
>> Those are in copyjob.cpp. In the case of removeSubjob(), the default
>> behavior is to not merge metadata, so it we can either:
>> - add a removeSubjobAndMergeMetadata() method
>> - add a separate mergeMetadata() method
> Separate call sounds good. Doesn't really need a new method though,
> there's already a mergeMetadata but that's for outgoing metadata
> (job->slave) while here it's about the resulting metadata (incoming, i.e.
> slave->job).
> 
> I would just do d->m_incomingMetaData += job->metaData() before
> the removeSubjob(job) call.

Yes, it's probably simpler.

> And then the dynamic cast in removeSubjob can be removed altogether
> (well, so the whole method is just a base class call, but maybe better
> keep it in case we need it later?)

Adding a new virtual method to a class is not binary compatible, but
reimplementing an existing virtual method is binary compatible, or am I
wrong? In this case we don't need to keep the method.

Aurélien





More information about the kde-core-devel mailing list