[webkit-dev] static const

Alexey Proskuryakov ap at webkit.org
Wed Sep 2 09:55:44 PDT 2009


02.09.2009, в 9:32, Darin Adler написал(а):

>> 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.


I don't have a normative reference at hand, but I'm fairly sure that  
both give internal linkage in C++ (unlike in C).

http://stackoverflow.com/questions/998425/why-does-const-imply-internal-linkage-in-c-when-it-doesnt-in-c
http://bytes.com/topic/c/answers/62013-const-has-internal-linkage-c

- WBR, Alexey Proskuryakov



More information about the webkit-dev mailing list