home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!decwrl!parc!ellis
- From: ellis@parc.xerox.com (John Ellis)
- Newsgroups: comp.std.c++
- Subject: Constructors and runtime typing
- Message-ID: <ellis.728022822@osric>
- Date: 26 Jan 93 04:33:42 GMT
- Sender: news@parc.xerox.com
- Organization: Xerox PARC
- Lines: 15
-
- Regarding Stroustrup's proposal for runtime typing:
-
- Suppose class B is derived from A and A's constructor calls typeof(*this):
-
- class A {A() {...typeof(*this)...}; ...};
- class B: A {...};
-
- (Excuse any mistakes in notation.)
-
- When "new B" is evaluated, will typeof(*this) yield typeof(A) or
- typeof(B)?
-
- The recommended implementation technique seems to suggest typeof(A),
- and that's consistent with the handling of virtual functions within
- constructors.
-