--nextPart1251837.KSNGE2Sdov Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Andre W=F6bbeking wrote: >On Wednesday 20 February 2008 06:04:24 Matt Rogers wrote: >> Hi, >> >> So, I've been doing some review of decibel and I've seen some stuff >> like this (from kdereview/decibel/src/server/contactmanager.h) >> >> Decibel::ChannelInfo >> contactContactUsingAccount(const uint contact_id, const int >> account_handle, const int type, const bool suppress_handler); >> >> >> Most of us know that passing POD by value with a const qualifier is >> kinda silly, since it has next to zero real effect. I agree with Stephan and Andre here. I'll even give you examples from Qt: src/xmlpatterns/api - headers do not include const unnecessarily src/xmlpatterns/*~api - const is used on PODs [That's a zsh extendedglob] >It makes sense in the implementation but not in the API. As compromise > we could remove the const in the header files but leave them in the > source files (that is allowed for PODs). No, it's not. Not only that, some compilers mangle the "const" as well, so= =20 removing it if it was there is binary incompatible. This applies as well to return types: const int foo(); That generates a warning in gcc 4.3, but you can't remove it because it's=20 binary incompatible in MSVC. =2D-=20 =A0 Thiago Macieira =A0- =A0thiago (AT) macieira.info - thiago (AT) kde.org =A0 =A0 PGP/GPG: 0x6EF45358; fingerprint: =A0 =A0 E067 918B B660 DBD1 105C =A0966C 33F5 F005 6EF4 5358 --nextPart1251837.KSNGE2Sdov Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQBHu9niM/XwBW70U1gRAvcyAJ4yDybxsfSz4KbNLsL/th2dfmsBBwCcCc6z huyWb5fnSp2PkVpb2a/zoI4= =TzEd -----END PGP SIGNATURE----- --nextPart1251837.KSNGE2Sdov--