This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

c++: Is iostream use legal in the constructor of a static object


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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]