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,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,3885b7fd66a1db28 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-12-25 00:23:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!cyclone1.gnilink.net!spamfinder.gnilink.net!nwrddc02.gnilink.net.POSTED!53ab2750!not-for-mail From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3a) Gecko/20021210 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Why is Ada a good choice for an ambitious beginner to programming References: <5ad0dd8a.0212210251.63b87aba@posting.google.com> <5ad0dd8a.0212230352.11f8b886@posting.google.com> <5ad0dd8a.0212231215.6ae81bf7@posting.google.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <7WdO9.115704$4W1.35198@nwrddc02.gnilink.net> Date: Wed, 25 Dec 2002 08:23:31 GMT NNTP-Posting-Host: 162.83.251.55 X-Complaints-To: abuse@verizon.net X-Trace: nwrddc02.gnilink.net 1040804611 162.83.251.55 (Wed, 25 Dec 2002 03:23:31 EST) NNTP-Posting-Date: Wed, 25 Dec 2002 03:23:31 EST Xref: archiver1.google.com comp.lang.ada:32301 Date: 2002-12-25T08:23:31+00:00 List-Id: Bill Findlay wrote: > C++ beginners just *might* have to learn about placement new, > to let them do things that are trivially easy in Ada; What's the Ada equivalent? Is it something like for v'address use (some expression) C++ "placement new" is somewhat more general - it's a way of passing parameters to (and thereby also selecting by overload resolution) a storage allocator. But it is trivially easy to use - it looks something like Type *ptr = new(ap1, ap2, ap3) Type(tp1, tp2, tp3); The apn arguments are passed to the allocator selected by overload resolution on them, and the tpn arguments are then passed to the constructor of Type, which is built in the space returned by the allocator. I don't think beginners need to learn about this, though.