This is the mail archive of the
mailing list for the GCC project.
c++: Is iostream use legal in the constructor of a static object
- From: Anthony Shipman <als at iinet dot net dot au>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 5 Jan 2006 03:39:09 +1100
- Subject: 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
email@example.com grow up to be outsourced.