passing POD by value with const qualifiers. Silly or not?

David Faure faure at kde.org
Thu Feb 21 09:08:36 GMT 2008


On Wednesday 20 February 2008, Alexander Neundorf wrote:
> You can't accidentially assign a different value to contact_id in the 
> implementation. It doesn't change anything for the calling code.

Exactly; so it's an implementation detail that surfaces in the API.
If later on you do want to change contact_id inside the implementation, you can't because it would change the API....
But I agree that this isn't "a big problem", just the reason we usually don't do it that way.

-- 
David Faure, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).




More information about the kde-core-devel mailing list