On Wed, Sep 2, 2009 at 9:32 AM, Darin Adler <[email protected]> wrote: > On Sep 2, 2009, at 9:31 AM, Alexey Proskuryakov wrote: > > As an aside, is there any practical difference between "static const" and >> "const" in C++? The only difference I'm aware of is that the former is >> deprecated in the standard. >> > > I believe the former gives internal linkage and the latter external > linkage, so I always use the former for things defined in a source file and > not declared in a header file and the latter for things defined or declared > in a header file.
This is correct (both about linking and about "static" being deprecated in C++). Note that Stroustrup's recommendation is to use an anonymous namespace around source-file-local variables and functions rather than declaring them static (due to its deprecation). From my recollection this is not precisely equivalent in meaning but it is nearly so. I have seen and used both in WebKit (although "static" is more common) and I believe the Google style guide also allows both. PK
_______________________________________________ webkit-dev mailing list [email protected] http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

