CTORs for static elements

Perry Smith pedz@easesoftware.com
Tue Jun 6 00:09:00 GMT 2006


I have a class like:

class f {
public:
   f() : l(-1) { }

private:
   int l;
};

I then have a global static instance of f.  Is GCC going to create a  
CTOR function and call it when the program starts up or is it going  
to just put f::l into an initialized data area?  My other question  
(not gcc specific) is if this is specified in the C++ language?

Thanks,
Perry



More information about the Gcc-help mailing list