Article View: comp.std.c++
Article #3519Re: Q: default constructor for fundamental types?
From: James Kanze US/ESC 60/3/141 #407...
Date: Tue, 27 Feb 1996 16:01
Date: Tue, 27 Feb 1996 16:01
42 lines
2314 bytes
2314 bytes
In article <4gsvhn$csi@clarknet.clark.net> gusty@clark.net (Harlan
Messinger) writes:
|> Dirk Herrmann (dirk@sallust.ida.ing.tu-bs.de) wrote:
|> : Sorry if this has been discussed before.
|> :
|> : When using templates, it appears that there should be
|> : default constructors for the fundamental data types.
|> Essentially, there is.
[Example deleted...]
|> But it appears that it is allowed. It works fine in Visual C++ 2.2.
[...]
|> The following produces output of "8" on the first line and gobbledygook
|> on the second line, since the effect of the "default constructor" of the
|> integer member function is to do nothing.
This is wrong, but since it is a recent change, it is probable that
the compiler simply hasn't implemented it yet.
Expressions of the form `int()' have always been allowed. A (fairly)
recent change to the draft standard states that they have the same
value as default static initialization (in this case, 0). The earlier
rules had the initailization undefined.
--
James Kanze Tel.: (+33) 88 14 49 00 email: kanze@gabi-soft.fr
GABI Software, Sarl., 8 rue des Francs-Bourgeois, F-67000 Strasbourg, France
Conseils, études et réalisations en logiciel orienté objet --
-- A la recherche d'une activité dans une region francophone
[ comp.std.c++ is moderated. To submit articles: Try just posting with your
newsreader. If that fails, use mailto:std-c++@ncar.ucar.edu
comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
Comments? mailto:std-c++-request@ncar.ucar.edu
]
Technical Details
Message-ID:
<9602271131.AA18225@lts.sel.alcatel.de>Path:
arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamageReferences:
<4glrdc$dqo@ra.ibr.cs.tu-bs.de> <4gsvhn$csi@clarknet.clark.net>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!engnews1.Eng.Sun.COM!taumet!clamage From: James Kanze US/ESC 60/3/141 #40763 <kanze@lts.sel.alcatel.de> Newsgroups: comp.std.c++ Subject: Re: Q: default constructor for fundamental types? Date: 27 Feb 1996 16:01:12 GMT Organization: ? Approved: clamage@eng.sun.com (comp.std.c++) Message-ID: <9602271131.AA18225@lts.sel.alcatel.de> References: <4glrdc$dqo@ra.ibr.cs.tu-bs.de> <4gsvhn$csi@clarknet.clark.net> NNTP-Posting-Host: taumet.eng.sun.com Content-Type: text In-Reply-To: gusty@clark.net's message of 26 Feb 1996 20:13:44 GMT Content-Length: 1310 X-Lines: 34 Originator: clamage@taumet