[Development] Passing QSize, QPoint, QTime and other small structs by value
Marc Mutz
marc.mutz at kdab.com
Fri Apr 7 17:28:51 CEST 2017
On Friday 07 April 2017 15:02:55 Lars Knoll wrote:
> There might be a little catch with regards to structs containing members
> that are 8 bytes in size (aka quint64). Are those getting passed in
> registers on 32bit ARM?
Forget register passing. To a first approximation, it does not matter. If you
pass by cref, you surely force the value on the stack, anyway.
What pass-by-value has going for it is the elimination of memory, and with it
the aliasing and const_cast problems that make the compiler's and developer's
work hard.
Please watch Chandler Carruth's BoostCon 2013 presentation for the pov of
compiler writers (https://www.youtube.com/watch?v=eR34r7HOU14) and Lawrence
Crowl's CppCon 2014 presentation for the pov of a developer
(https://www.youtube.com/watch?v=17rtjq9r27M).
Thanks,
Marc
--
Marc Mutz <marc.mutz at kdab.com> | Senior Software Engineer
KDAB (Deutschland) GmbH & Co.KG, a KDAB Group Company
Tel: +49-30-521325470
KDAB - The Qt, C++ and OpenGL Experts
More information about the Development
mailing list