const T& func() const;

Nick Shaforostoff shafff at
Thu Aug 16 05:24:01 BST 2007

>it's not possible to later change the function to return 
>a calculated (rather than stored) value.

>In fact, I was fairly sure we were going to go the other way and change 
>const T & -> T.

and what's the preformance impact?
i suggest to use 'const T&' in core classes or in cases where we know for sure that the data will be always cached
(e.g. it is obvious that we don't want to parse whole file everytime we need its metaInfo)

More information about the kde-core-devel mailing list