A static member s of class X may be referred to
using the qualified-id expression X::s; it is not
necessary to use the class member access syntax ([expr.ref]) to
refer to a static member.
A static member may be
referred to using the class member access syntax, in which case the
object expression is evaluated.
[Example 1: struct process {staticvoid reschedule();
};
process& g();
void f(){
process::reschedule(); // OK, no object necessary
g().reschedule(); // g() is called} — end example]
Static members obey the usual class member access rules ([class.access]).
When used in the declaration of a class
member, the static specifier shall only be used in the member
declarations that appear within the member-specification of
the class definition.
[Example 1: class process {static process* run_chain;
static process* running;
};
process* process::running = get_main();
process* process::run_chain = running;
The definition of the static data member run_chain of class
process inhabits the global scope; the notation
process::run_chain indicates that the member run_chain
is a member of class process and in the scope of class
process.
In the static data member definition, the
initializer expression refers to the static data
member running of class process.
The member shall still be defined in a namespace scope if
it is odr-used ([basic.def.odr]) in the program and the
namespace scope definition shall not contain an initializer.
The declaration of an inline static data member (which is a definition)
may specify a brace-or-equal-initializer.
If the
member is declared with the constexpr specifier, it may be
redeclared in namespace scope with no initializer (this usage is
deprecated; see [depr.static.constexpr]).