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=0.2 required=5.0 tests=BAYES_00,FREEMAIL_FROM, HEADER_SPAM,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fc772,b30bd69fa8f63cb2 X-Google-Attributes: gidfc772,public X-Google-Thread: 103376,b30bd69fa8f63cb2 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-06-20 02:36:12 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.uchicago.edu!newsfeed.cs.wisc.edu!uwm.edu!rpi!not-for-mail From: Wesley Groleau Newsgroups: comp.lang.ada,comp.lang.c++.moderated Subject: Re: C bug of the day Date: 20 Jun 2003 05:38:30 -0400 Organization: Ain't no organization here! Sender: cppmods@netlab.cs.rpi.edu Message-ID: References: <1054751321.434656@master.nyc.kbcfp.com> <7gBHa.12174$KF1.273806@amstwist00> <82347202.0306191147.11374726@posting.google.com> Reply-To: wesgroleau@despammed.com NNTP-Posting-Host: netlab.cs.rpi.edu X-Original-Date: Thu, 19 Jun 2003 20:28:17 -0500 X-Submission-Address: c++-submit@netlab.cs.rpi.edu X-Auth: PGPMoose V1.1 PGP comp.lang.c++.moderated iQBVAwUAPvLWEUHMCo9UcraBAQFXaAH8CiovMdyREBCfUSYu5p+78P15oN1yrm9b lxB1hTjvcTIqUvsUubFEaNr6ZeNwl77g55mDiVY+gq9tn8KJsOKXEg== =XXKW Xref: archiver1.google.com comp.lang.ada:39485 comp.lang.c++.moderated:68780 Date: 2003-06-20T05:38:30-04:00 List-Id: > The "adjustment" procedure is used for such things as incrementing > reference counts. The "finalize" procedure could be used to There are probably a lot of good ways to use Ada "adjust." One important one is replacing a copy of a pointer with a pointer to a new copy of the heap object. This can be recursive, so that in a tree or list or such, each allocation also "adjusts" any pointers within. But then what if it's something like a map or graph, where there may be more than five pointers to the same node? You'd want one new node with five pointers to it. Can be done, but it's awkward. Hoever, not as awkward as doing the whole deep copy _without_ language assistance. I presume C++ is substantially equivalent on this issue? [ See http://www.gotw.ca/resources/clcm.htm for info about ] [ comp.lang.c++.moderated. First time posters: Do this! ]