Article View: comp.std.c++
Article #2206Re: Two standards questions
From: Steve Clamage
Date: Sat, 14 Oct 1995 21:57
Date: Sat, 14 Oct 1995 21:57
46 lines
2117 bytes
2117 bytes
In article 4kTmzbC00iVD0Bmn4x@andrew.cmu.edu, Mathew G Monroe <mmex+@andrew.cmu.edu> writes:
>
>First: Under the current draft standard are all const object only given
>an internal linkage, unless they have previously been given external
>linkage? I ask because I understood this was the case.
Yes.
> But, GNU G++
>(at least 2.7.0) doesn't strictly follow this. For example,
>
>const char *messages[]={"Fun", "Stuff};
>const char fun[]="message";
>
>messages is made external, and fun is internal. This seems wrong to me,
>both should be internal.
No, GNU is correct. "messages" is not const, so it is made external.
That is "messages" is a non-const pointer to a const char. On the
other hand, "fun" is a const array of chars. The "const" applies to
the declarator which follows. In the first case, the declator is "*"
and in the second case it is "fun". Pointers and arrays are not
the same thing.
>
>Second: By the current standard is the complex class a template? I ask
>because old versions of GNU g++ and libg++ has complex not as a
>template, yet g++ 2.7.0 and libg++ 2.7.0 make it a template.
Yes, the current draft makes complex a template. The exact spelling
of the names and whether the spelling "complex" should be a typedef
to something like basic_complex<double> instead of the name of a
template was still under discussion the last time I checked.
---
Steve Clamage, stephen.clamage@eng.sun.com
---
[ comp.std.c++ is moderated. Submission address: std-c++@ncar.ucar.edu.
Contact address: std-c++-request@ncar.ucar.edu. The moderation policy
is summarized in http://dogbert.lbl.gov/~matt/std-c++/policy.html. ]
Technical Details
Message-ID:
<45p7cg$oil@engnews2.Eng.Sun.COM>Path:
arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!MattReferences:
<4kTmzbC00iVD0Bmn4x@andrew.cmu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!howland.reston.ans.net!agate!agate!Matt From: clamage@Eng.Sun.COM (Steve Clamage) Newsgroups: comp.std.c++ Subject: Re: Two standards questions Date: 14 Oct 1995 21:57:43 GMT Organization: Sun Microsystems Inc. Approved: Matt@Austern Message-ID: <45p7cg$oil@engnews2.Eng.Sun.COM> References: <4kTmzbC00iVD0Bmn4x@andrew.cmu.edu> Reply-To: clamage@Eng.Sun.COM NNTP-Posting-Host: austern.hip.berkeley.edu