Static stuff..

David Faure dfaure at klaralvdalens-datakonsult.se
Tue Dec 31 18:56:11 GMT 2002


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Tuesday 31 December 2002 16:57, Marc Mutz wrote:
> On Tuesday 31 December 2002 01:07, Chris Howells wrote:
> <snip>
> > I'd like to ask when stuff should be made
> > static and when not. Is there any good rule or not?
> <snip>
> 
> Think of static member functions and methods as "class members and 
> methods" as opposed to "_object_ members and methods" and you'll be 
> fine. I think that's the Smalltalk names for it.

If you read the patches on kde-cvs you'd see this is about "file static",
not about static class methods :-)

And the answer is: use "static" before a function when this function is only
used in this file - so it doesn't need to be exported, which saves one symbol
(e.g. among those exported by the library).

- -- 
David Faure -- faure at kde.org, dfaure at klaralvdalens-datakonsult.se
Klarälvdalens Datakonsult AB, Platform-independent software solutions
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
KOffice-1.2.1 is available - http://download.kde.org/stable/koffice-1.2.1/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.7 (GNU/Linux)

iD8DBQE+EehL72KcVAmwbhARAtv/AJ9uvEeokX3/z48w7fHxKoB+aUxQSACfZi6g
qyIGPBBRVbHM2ME3FmhkbpI=
=IEyP
-----END PGP SIGNATURE-----





More information about the kde-core-devel mailing list