Re: Calling C library functions from C++ program
On Dec 11, 9:28 am, Juha Nieminen <nos...@thanks.invalid> wrote:
James Kanze wrote:
You have member functions (which might or might not be
virtual), virtual functions (which are specifically
dynamically bound), and... What would be the proper name for
those function with the "static" keyword?
Static member functions.
I'm not sure that's such a great idea.
"Static" sounds a lot like the opposite of "dynamic". A "dynamic
function", in turn, sounds like a dynamically bound function, in other
words, a virtual function. Thus one could deduce that a "static
function" is a member function which is not virtual.
I'm not so sure. "Static" means unchanging, unmoving. A "static
function" is more accurately a function that does not modify it's own
code, and that remains in the same place (e.g. does not spontaneously
become a member of another class). On the other hand, a "dynamic"
function could modify itself, e.g. a member function of a polymorphic
virus implementation, or perhaps a "dynamic" function is one such as
this:
class A { void function (); };
class B { };
Where at any given moment, possibly when you least expect it, the
compiler is free to make function() be a member of B instead.
In fact, I'd like to propose that in the next C++ standard, that any
member function not explicitly identified as "static" may, at any
given time, become a member of an arbitrary other class in the
program. I think that would remove any remaining ambiguity from this
important issue.
Jason