[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: Re: KDE/kdenetwork/kopete/libkopete
From: Pino Toscano <pino () kde ! org>
Date: 2011-07-10 14:46:01
Message-ID: 201107101646.08279.pino () kde ! org
[Download RAW message or body]
Alle domenica 10 luglio 2011, Lamarque Vieira Souza ha scritto:
> Em Sunday 10 July 2011, Pino Toscano escreveu:
> > SVN commit 1240790 by pino:
> >
> > remove default parameter
> >
> > ... otherwise it creates ambiguity with the parameterless
> > protocolIcon() version CCMAIL: lamarque@gmail.com
You cannot have two functions
int foo(int x = 0);
int foo();
and make calls like "int res = foo();" work, the compiler cannot know
which one it must be called. This was the case for the two protocol
icons I fixed with my commit.
> And it ill create a binary incompatibility when the deprecated
> protocolIcon is removed and the parameter added again.
Removing a public function, whichever it is and whichever other
functions do, is always a "binary incompatibility".
If you refer to "source incompatibility", then you make the parameter of
the new protocolIcon() function as with an optional argument _only_ when
the old parameter-less protocolIcon() is removed. This way, calls like
"->protocolIcon()" and "->protocolIcon(size)" will work and use the
single protocolIcon() version with optional parameter.
--
Pino Toscano
["signature.asc" (application/pgp-signature)]
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic