public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* c++: Is iostream use legal in the constructor of a static object
@ 2006-01-04 16:39 Anthony Shipman
  0 siblings, 0 replies; only message in thread
From: Anthony Shipman @ 2006-01-04 16:39 UTC (permalink / raw)
  To: gcc-help

If I have a class C and a static object
    static C obj;
is it legal to use iostream e.g. cout in the constructor for C?

If I do then I am using iostream during static initialisation but, at least 
for Gnu libstdc++, iostream depends on locale which depends on static 
initialisation of locale ids. So that would seem to me to be a real hazard.

-- 
Anthony Shipman                    Mamas don't let your babies 
als@iinet.net.au                   grow up to be outsourced.

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-04 16:39 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-04 16:39 c++: Is iostream use legal in the constructor of a static object Anthony Shipman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).