Path: utzoo!mnetor!uunet!ncc!alberta!ubc-cs!uw-beaver!apollo!mrst!sdti!mjy From: mjy@sdti.UUCP (Michael J. Young) Newsgroups: comp.lang.c++ Subject: Re: Readable C++ book Message-ID: <262@sdti.UUCP> Date: 22 Apr 88 14:45:00 GMT References: <804@imsvax.UUCP> <6590036@hplsla.HP.COM> <3440@oxtrap.UUCP> Reply-To: mjy@sdti.UUCP (0000-Michael J. Young) Organization: Software Development Technologies, Sudbury MA Lines: 43 In article <3440@oxtrap.UUCP> rich@oxtrap.UUCP (K. Richard Magill) writes: >In article <6590036@hplsla.HP.COM> jima@hplsla.HP.COM ( Jim Adcock) writes: >>By "2.0 goodies" I meant the "2nd batch of C++ features that Stroustrup discussed >>extensively at the C++ Workshop and in his published papers." > >Can I get some specific references? In particular, I can't find >discussions of "private:", "protected:", etc. in Stroustrup's book >yet the InterViews library uses them. What are they? > >For that matter, what are any of the other "2.0 goodies"? Actually, my edition of Stroustrup's book (which is pretty old, March 1986 -- there has been at least one more revision since then) makes reference to features present in version 1.1 of cfront (e.g., pointers to member functions). Features from 1.2 and later are missing. The "private" and "protected" keywords were added in version 1.2, and are described in the 1.2 Release Notes. Syntactically, they are similar to the "public" keyword. The "private" keyword specifies that subsequent class members are private, just like they would be if "public" were never used previously. So it is now possible to have private members after public members, as in: class foo { public: int a; // this member is publicly accessible private: foo *link; // don't even think of using this! }; A "protected" member is treated as if it were public to any derived classes, but private to other classes and functions. Its main purpose is to provide member access for inherited classes while not leaving the class vulnerable to abuse from unrelated functions. My understanding of the major enhancements of version 2.0 is support for multiple inheritence and virtual new and delete operators, among other things. -- Mike Young - Software Development Technologies, Inc., Sudbury MA 01776 UUCP : {decvax,harvard,linus,mit-eddie}!necntc!necis!mrst!sdti!mjy Internet : mjy%sdti.uucp@harvard.harvard.edu Tel: +1 617 443 5779 "Bill & Opus in '88" -- Consider the alternatives!