[LC++]Scoping question
Vincent Penquerc'h
Vincent.Penquerch at artworks.co.uk
Mon Jul 22 19:24:06 UTC 2002
> Am I guaranteed this will happen as I want by ISO? I know
> that for global
> variables in seperate files, any ordering can be used for their
> construction/destruction. Is this the same situation with
> static variables,
> or are they considered to be constructed strictly after and destroyed
> strictly before global variables are?
There is a thing you can rely on, IIRC, that globals in a
single compilation unit are initialized in the order they
are declared. I think destruction will happens in the
opposite order, so if you can declare y as a global, then
you'd be fine.
Hmm, as I write this, I become less and less sure about
what I'm saying.... :)
--
Vincent Penquerc'h
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.linux.org.au/pipermail/tuxcpprogramming/attachments/20020722/2a6dae12/attachment.htm
More information about the tuxCPProgramming
mailing list