Article View: net.lang.c++
Article #97Re: statics in state tables
From: R.B.Murray
Date: Fri, 14 Mar 1986 17:57
Date: Fri, 14 Mar 1986 17:57
70 lines
2655 bytes
2655 bytes
>
> By the way, it seems to me a significant difference from C that the
> default storage class for globals is "static" -- worth noting at least
> in Section r.15, "Differences from C". I only noticed it by accident.
>
> Nathan C. Myers hplabs!hp-pcd!orstcs!nathan nathan@oregon-state
Actually, in release 1.0, the default storage class for globals is "extern",
just as in "C". I suspect you're using release E, which is obsolete.
Cfront release E was released to universities (only)
for a nominal charge in early 1985. This was a preliminary
version of cfront (and was advertised as such).
Users of release E ought to get 1.0, as the language has changed since then.
What follows is a list of these changes. (This list is also in the 1.0 release
notes.)
**NOTE: This list is ONLY relevant if you are at one of the
universities that got release E. The 1.0 release, and
the book, already reflect these changes:
1. The default storage class of globals is static, as in C;
2. You can't initialize references with pointers;
3. Undeclared functions are no longer implicitly declared according to the
first use. Instead, an undeclared function is treated as in good-old-C,
i.e. all args are passed unchecked;
4. Static constructors and destructors can always be used (the +I flag is
no longer needed);
5. The correct syntax for defining a member function uses "::"
struct cls {
void member();
};
void cls::member(){}
//Used to be: void cls.member(){}
6. You can delete a vector of class objects with the syntax
delete [count] ptr;
e.g.
object* ptr;
ptr = new object[20];
delete [20] ptr;
7. Improved member initializations.
When a class object has members that are themselves class objects,
arguments can now be passed to the constructors of those members.
class inner {
inner(int);
};
class outer {
inner in;
outer(float, int);
};
//This constructor first calls
//inner::inner(i+1)
outer::outer(float f, int i) : in( i + 1 ) {
/* ... */
}
8. Many bug fixes.
Rob Murray
AT&T
Summit, NJ
Technical Details
Message-ID:
<173@sfsup.UUCP>Path:
arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!sftig!sfsup!rbmReferences:
<34200006@orstcs.UUCP>Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.2 9/18/84; site sfsup.UUCP Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!mhuxn!mhuxm!sftig!sfsup!rbm From: rbm@sfsup.UUCP (R.B.Murray) Newsgroups: net.lang.c++ Subject: Re: statics in state tables Message-ID: <173@sfsup.UUCP> Date: Fri, 14-Mar-86 12:57:29 EST Article-I.D.: sfsup.173 Posted: Fri Mar 14 12:57:29 1986 Date-Received: Sat, 15-Mar-86 21:56:52 EST References: <34200006@orstcs.UUCP> Organization: AT&T Information Systems, Summit N.J. Lines: 70