Article View: comp.std.c++
Article #277the most dissatisfying part of c++
From: Limsoon Wong
Date: Tue, 31 Jul 1990 14:46
Date: Tue, 31 Jul 1990 14:46
26 lines
1048 bytes
1048 bytes
the program below is a contrived one. it cannot be compiled.
the reason is a type fault. however, it exhibits a very central
characteristic of update. something should be done to allow
this kinds of programs. ---limsoon.
#include <stream.h>
class a {
public:
a& test() {
// 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();
// type violation despite the fact that
// `B' and `B.test()' are the same object.
}
Technical Details
Message-ID:
<27634@netnews.upenn.edu>Path:
arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!rutgers!netnews.upenn.edu!saul.cis.upenn.edu!limsoonShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!tut.cis.ohio-state.edu!zaphod.mps.ohio-state.edu!usc!rutgers!netnews.upenn.edu!saul.cis.upenn.edu!limsoon From: limsoon@saul.cis.upenn.edu (Limsoon Wong) Newsgroups: comp.std.c++ Subject: the most dissatisfying part of c++ Message-ID: <27634@netnews.upenn.edu> Date: 31 Jul 90 14:46:47 GMT Sender: news@netnews.upenn.edu Reply-To: limsoon@saul.cis.upenn.edu.UUCP (Limsoon Wong) Organization: University of Pennsylvania Lines: 26