Article View: comp.std.c++
Article #265Re: the most dissatisfying part of c++
From: Doug Lea
Date: Fri, 03 Aug 1990 14:55
Date: Fri, 03 Aug 1990 14:55
40 lines
1627 bytes
1627 bytes
My `Customization in C++' paper in the '90 Usenix C++ Proceedings
discusses a reasonably clean, but extensive proposal that would
support the desired usage:
#include <stream.h>
class a {
public:
template a& test() { // *** Note the qualifier ***
// do some modification to the state of this object,
// then ...
return *this;
};
class b : public a {
public:
int b;
};
main() {
b B;
B = B.test(); // *** Legal under customization ***
// type violation despite the fact that
// `B' and `B.test()' are the same object.
}
While I played down the expressivity aspects of the type qualifier
sense of `template' and concentrated on optimization consequences,
the proposed constructs are indeed extremely valuable for writing
container classes and the like.
I'd love to hear from anyone concerning the standardizability of
the proposal.
-Doug
--
Doug Lea, Computer Science Dept., SUNY Oswego, Oswego, NY, 13126 (315)341-2688
email: dl@g.oswego.edu or dl@cat.syr.edu
UUCP :...cornell!devvax!oswego!dl or ...rutgers!sunybcs!oswego!dl
Technical Details
Message-ID:
<DL.90Aug3105931@g.g.oswego.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!ub!oswego!newsReferences:
<27634@netnews.upenn.edu> <10656@crdgw1.crd.ge.com>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!samsung!zaphod.mps.ohio-state.edu!ub!oswego!news From: dl@g.g.oswego.edu (Doug Lea) Newsgroups: comp.std.c++ Subject: Re: the most dissatisfying part of c++ Message-ID: <DL.90Aug3105931@g.g.oswego.edu> Date: 3 Aug 90 14:55:20 GMT References: <27634@netnews.upenn.edu> <10656@crdgw1.crd.ge.com> Sender: news@oswego.Oswego.EDU (Network News) Reply-To: dl@g.oswego.edu Organization: SUNY Oswego Lines: 40 In-reply-to: brownpc@sunne.crd.ge.com's message of 1 Aug 90 21:02:00 GMT