What does static mean when applied to a class at namespace scope?
I know that static
at namespace scope means "internal linkage". Now 开发者_运维问答consider the following code:
static class Foo {} foo;
Does the static
apply to Foo
, foo
or both?
It applies to the variable declared after the class definition.
In C++, there is no such thing as static class
. There are only static
objects and static
functions.
class Foo {}
states type of foo
variable. static
makes foo
static.
精彩评论