[Kmymoney-devel] missing subject
Fernando Vilas
fvilas at iname.com
Fri Oct 24 13:08:58 UTC 2014
On Thursday, October 23, 2014 01:48:53 PM Cristian Oneț wrote:
[...]
>
> More about this. Since MyMoneyFile return several const objects by
> value (not const references) [1] it basically forces a copy of the
> temporary in the caller code. I think as a first step we should remove
> all const qualifiers from temporary values to allow compilers to
> perform optimizations and skip copying.
>
> Regards,
> Cristian
>
> [1]
> https://projects.kde.org/projects/extragear/office/kmymoney/repository/revi
> sions/master/entry/kmymoney/mymoney/mymoneyfile.h#L1251
[...]
This is a hold-over from some Effective C++ advice. The "use const everywhere"
idea in that book is a little overstated, and has been walked back some by the
author. Unfortunately, many developers (including me) are only now finding out
about the impacts, especially as related to rvalue references in C++11.
The short answer is that this looks like low-hanging-fruit for some
performance upgrades in general, and especially when using new standards.
Thanks,
Fernando
More information about the KMyMoney-devel
mailing list