[Development] Abandoning the container changes

Marc Mutz marc.mutz at kdab.com
Thu Jul 19 17:31:33 CEST 2012


hi Thiago,

There are two sides to this coin.

On Thursday July 19 2012, Thiago Macieira wrote:
> On quinta-feira, 19 de julho de 2012 14.19.36, Marc Mutz wrote:
> > Even with inline namespaces? Then they would have failed to achieve their
> > goal  to hide the fact that the type is in an inline namespace.
>
> Yes. It breaks binary compatibility completely for all the code that uses
> QString in its API.

One: No, it doesn't. Code that mentions 'QString' in v5.0 will implicitly 
say 'v50::QString'. Code that mentions 'QString' in v5.2 (assuming QString 
has changed there) will implicitly say 'v52::QString'. There's no bic, since 
v50::QString hasn't changed, and the old API is still available. _Because_ 
the old API is still available, this comes at a cost, of course.

On Thursday July 19 2012, Thiago Macieira wrote:
> On quinta-feira, 19 de julho de 2012 14.31.52, Marc Mutz wrote:
> > namespace v50 {
> >    class QVector ... ; // same as before
> > }
> > inline namespace v52 {
> >     class QVector ... ; // new impl, with conversion to/from
> > v50::QVector... }
> > qFun(const v50::QVector&); // old version, explicit namespace, required
> > for BC
> > qFun(const QVector &); // new version (if necessary)
>
> As you've shown, we need to duplicate everything that has QString,
> QByteArray and QVector in our API.
>
> Close to impossible.

That's is question number two: what does it cost to apply inline namespaces to 
a core type such as QString? I can't answer that , and you can't answer, 
either, because no-one ever tried. I never said it's easy, but I don't think 
it's impossible. Stephen is working on a Clang-based Qt4-to-5 porting tool, 
IIRC, so in one year, with that work further progressed, that duplication 
might come for free, because it's automatable.

But I can see how converting to inline namespaces /now/ is too big a task, 
yes.

Was just an idea, anyway.

Thanks,
Marc

-- 
Marc Mutz <marc.mutz at kdab.com> | Senior 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



More information about the Development mailing list