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.9 required=5.0 tests=BAYES_00,XPRIO autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d56e8cd008b09d8,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-07-22 09:28:28 PST Path: archiver1.google.com!newsfeed.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!opentransit.net!wanadoo.fr!not-for-mail From: "Bertrand Augereau" Newsgroups: comp.lang.ada Subject: Construction/Destruction and copy semantics Date: Sun, 22 Jul 2001 18:33:43 +0200 Organization: Wanadoo, l'internet avec France Telecom Message-ID: <9jeuvb$not$1@wanadoo.fr> NNTP-Posting-Host: afontenayssb-103-1-1-240.abo.wanadoo.fr X-Trace: wanadoo.fr 995819307 24349 217.128.72.240 (22 Jul 2001 16:28:27 GMT) X-Complaints-To: abuse@wanadoo.fr NNTP-Posting-Date: 22 Jul 2001 16:28:27 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2919.6700 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2919.6700 Xref: archiver1.google.com comp.lang.ada:10421 Date: 2001-07-22T16:28:27+00:00 List-Id: One of the (many) features I like in C++ is constructors/destructors semantics. I find it better than calling a construct procedure and destroy procedure for non-trivial data types (those that have pointers to other ressources, or sockets, or whetever, for instance). You can't forget it this way. Is the problem that I want to stick a C++ pattern in Ada? How do you Ada programmers manage this problem? Second thing, I tried to write some basic containers, and they rely on the := 'operator'. It seems to me you can't overload it in Ada. So if you have a type which needs lazy copying for instance, you have to define a 'copy' procedure for this type. And then your container relies on this procedure. It is not that generic any more at this point. It seems bad to me as you can't instantiate your generic containers with the types of somebody else who uses 'clone' instead. Is it right? How do you adress this problem? Thanks. Bertrand Btw, this is just for getting informed, not to start a language holy war (some people tend to be paranoid)