Re: Bug in g++'s int constructor?
Re: Bug in g++'s int constructor?
- Subject: Re: Bug in g++'s int constructor?
- From: Alex Curylo <email@hidden>
- Date: Thu, 28 Mar 2002 22:35:20 -0800
>
ints don't have "constructors"
All built in types use constructor notation () to express the default value
of that type. That's close enough to "have 'constructors'" for all except
the most rectal-cranially inverted pedants, I would think.
ip = new int; // uninitalized
ip = new int(); // initializes to zero
in any standards-compliant compiler.
>
and they are not guaranteed to be initialized to any particular value
>
unless you explicitly initialize it.
Hmmmmm ... well, automatic variables no, but global, static, and namespace
variables are all guaranteed zero initalization by a conformant compiler in
the absence of an explicit initializer.
In my C++ 3rd Ed. the above rules are delineated in sections 4.9.5
"Initialization" and 6.2.8 "Constructors". Look it up, as they say.
--
Alex Curylo -- email@hidden --
http://alexc.webjump.com/
"I like you better cynical than credulous, especially credulous about
the virtues of people dramatically more stupid than you are."
-- Crawford Kilian
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.