🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.std.c++
Article #196

Re: the most dissatisfying part of c++

#196
From: Mike Lijewski
Date: Tue, 31 Jul 1990 17:44
23 lines
1438 bytes
In article <27634@netnews.upenn.edu> limsoon@saul.cis.upenn.edu.UUCP (Limsoon Wong) writes:
 
>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.

I disagree completely that such programs should be allowed.  Since test()
returns a `a&', basically what you are asking is that there be a implicit
conversion from a base class to a derived class.  No way should this be
allowed.  If you really want the below program to work, one possibility
would be to add the following constructor definitions to the class
declaration of b:

	 b() {};
	 b(a) {};
 

-- 
Mike Lijewski  (H)607/277-0394 (W)607/254-8686
Cornell National Supercomputer Facility
ARPA: mjlx@eagle.cnsf.cornell.edu  BITNET: mjlx@cornellf.bitnet
SMAIL:  1122 Ellis Hollow Rd. Ithaca, NY  14850
Technical Details
Message-ID: <10599@batcomputer.tn.cornell.edu>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!usc!zaphod.mps.ohio-state.edu!rpi!batcomputer!lijewski
References: <27634@netnews.upenn.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!snorkelwacker!usc!zaphod.mps.ohio-state.edu!rpi!batcomputer!lijewski
From: lijewski@batcomputer.tn.cornell.edu (Mike Lijewski)
Newsgroups: comp.std.c++
Subject: Re: the most dissatisfying part of c++
Message-ID: <10599@batcomputer.tn.cornell.edu>
Date: 31 Jul 90 17:44:43 GMT
References: <27634@netnews.upenn.edu>
Reply-To: lijewski@tcgould.tn.cornell.edu (Mike Lijewski)
Organization: Cornell National Supercomputer Facility
Lines: 23