Why is a static struct's dtor called at the exit of a function?

Diego Canuhé canuhedc at gmail.com
Thu Jul 21 23:12:00 PDT 2011


Hi,
I'm not really an experienced programmer so I might be missing something
but...

in
http://d-programming-language.org/attribute.html
static is described as follows:

"The static attribute applies to functions and data. It means that the
declaration does not apply to a particular instance of an object, but to the
type of the object. In other words, it means there is no this reference.
static is ignored when applied to other declarations."

What I understand from that text is that static only applies to functions
and data *of a class
*
As far as I'm concerned static only makes a method non-virtal and a variable
a class-variable.
(static if has nothing to do with this static. I think)


If I just talked nonsense out of my ignorance, I apologize
Static data has only one instance for the entire program, not once per objec
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20110722/4a1296dd/attachment.html>


More information about the Digitalmars-d-learn mailing list