[Development] Reverting the QRegExp change?

Stephen Kelly stephen.kelly at kdab.com
Wed May 2 13:20:10 CEST 2012


On Wednesday, May 02, 2012 11:57:48 Thiago Macieira wrote:
> On quarta-feira, 2 de maio de 2012 10.21.36, Giuseppe D'Angelo wrote:
> > In a related patch I suggested something like
> > 
> > int QRegExp::foo() const
> > {
> > 
> >   QRegExp copy = *this;
> >   return copy.foo();
> > 
> > }
> > 
> > which although being source compatible, is behaviour incompatible
> > (QRegExp users do expect const methods to change the object -- it's
> > even documented!).
> 
> Indeed, so I think this is actually worse of the three options.
> 
> Reverting completely means we accept that QRegExp is fundamentally flawed
> and people should port away from it immediately. I'd even tack a notice to
> the class saying that its const methods are not thread-safe.
> 
> Adding Olivier's patch means we do a little work to improve code in an
> otherwise Done class, with the ability to keep the old code compiling if one
> so wishes (with the same bugs, of course).
> 
> Adding yours would mean silently changing behaviour. That's far worse.
> 
> > So it's a matter of deciding what's the least worst option.

My preference is reverting completely. It's no change from the Qt 4 behaviour 
(which is good) and QRegExp can probably be really deprecated in a few 
releases once QRegularExpression has taken hold.

Thanks,

-- 
Stephen Kelly <stephen.kelly at kdab.com> | Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
www.kdab.com || Germany +49-30-521325470 || Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-Independent Software Solutions
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120502/65d685b2/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120502/65d685b2/attachment.sig>


More information about the Development mailing list