This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
CTORs for static elements
- From: Perry Smith <pedz at easesoftware dot com>
- To: gcc-help GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 5 Jun 2006 19:09:51 -0500
- Subject: CTORs for static elements
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