[Development] Setters: Passing by value or const reference?
Thiago Macieira
thiago.macieira at intel.com
Tue May 8 16:08:09 CEST 2012
On terça-feira, 8 de maio de 2012 15.42.41, Marc Mutz wrote:
> > Most of the flags like -fno-exceptions ... are still binary compatible.
>
> What happens if an exception travels through C++ code compiled
> with -fno-exceptions? Will it pass through? Will it call all dtors? Or will
> it ruin the stack? (Not a rhetorical question: I really don't know myself).
That doesn't work any more than travelling through another language, like a
glib- or Cocoa-based event loop. You *cannot* let exceptions propagate through
Qt code, at all. If you let any one do that, the only thing you can do at the
end is to quit your application with extreme prejudice. And count yourself
lucky that it didn't crash on the way.
People who want to use exceptions are allowed to -- in their own code. And I
welcome patches that make our Qt containers more exception safe (I think they
stand at "basic safety" right now), so you can use them in your exception-
bearing code.
Given that, -fno-exceptions is entirely binary compatible: the container code
is mostly inline anyway and will use whatever flags the application is using,
while the non-inline code is out-of-bounds for exceptions anyway.
--
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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120508/0adc7954/attachment.sig>
More information about the Development
mailing list