Topic: Static variables in member functi..
Author: Chuck Allison <72640.1507@CompuServe.COM>
Date: 22 Nov 1994 20:05:07 GMT Raw View
>Wrong, if language semantics is considered. instance_a.f and
>instance_b.f are not identical, since they operate on different
>data members. A global `a' referred to in instance_a.f is not
>identical to the `a' referred to in instance_b.f. Of course,
>they have the identical semantics, but they _are_ not identical.
Wrong! X::f() is one and the same, whether invoked with an
object:
X a;
a.f();
or with its fully-qualified name:
X::f();
Static member functions do not operate on data members. They
can't. There is no associated "this" pointer. It's really that
simple. They are like global functions, but with scope and access
rules of their class.
-- Chuck Allison
--
Chuck Allison
Compuserve: 72640,1507
INTERNET: 72640.1507@compuserve.com