From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII X-Google-Thread: 103376,741d9c75087d538f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-06 09:05:04 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!lnsnews.lns.cornell.edu!news.litech.org!news-feed.riddles.org.uk!freenix!oleane.net!oleane!nnrp.oleane.net!skymaster!nobody From: "Jean-Pierre Rosen" Newsgroups: comp.lang.ada Subject: Re: Cloning a Class Wide Data Type with "new"? Date: Fri, 6 Jun 2003 17:34:30 +0200 Organization: Adalog Message-ID: <01cqbb.q3o.ln@skymaster> References: <3EE097D5.2010901@cogeco.ca> NNTP-Posting-Host: mailhost.axlog.fr X-Trace: s1.read.news.oleane.net 1054915263 30493 195.25.228.57 (6 Jun 2003 16:01:03 GMT) X-Complaints-To: abuse@oleane.net NNTP-Posting-Date: Fri, 6 Jun 2003 16:01:03 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 Xref: archiver1.google.com comp.lang.ada:38761 Date: 2003-06-06T17:34:30+02:00 List-Id: "Warren W. Gay VE3WWG" a �crit dans le message news: 3EE097D5.2010901@cogeco.ca... > I havn't had much time to research this one yet, but I've > got stuck trying to clone a class wide type this morning, > on my way to work. A sample program is provided below. > > I need to be able to allocate and then copy an arbitrary > tagged type (based upon a base type) into the newly > allocated object. There's gotta be a way to do this.. > I just can't remember it! > > The problem is the operation of the form of : > > Cloned : Base_Access := new Base_Class'(Orig); > Cloned : Base_Access := new Base_Class'class'(Orig); Hey, in Ada types must conform, and Base_Access is an access to Base_Access'Class! -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Visit Adalog's web site at http://www.adalog.fr