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,LOTS_OF_MONEY 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-27 17:56:25 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!kibo.news.demon.net!demon!news-hub.cableinet.net!blueyonder!internal-news-hub.cableinet.net!news-binary.blueyonder.co.uk.POSTED!53ab2750!not-for-mail User-Agent: Microsoft-Entourage/10.1.1.2418 Subject: Re: Why is Ada a good choice for an ambitious beginner to programming From: Bill Findlay Newsgroups: comp.lang.ada Message-ID: References: <5ad0dd8a.0212210251.63b87aba@posting.google.com> <5ad0dd8a.0212230352.11f8b886@posting.google.com> <5ad0dd8a.0212231215.6ae81bf7@posting.google.com> <7WdO9.115704$4W1.35198@nwrddc02.gnilink.net> Mime-version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-transfer-encoding: 7bit Date: Sat, 28 Dec 2002 01:56:11 +0000 NNTP-Posting-Host: 80.195.52.70 X-Complaints-To: abuse@blueyonder.co.uk X-Trace: news-binary.blueyonder.co.uk 1041040584 80.195.52.70 (Sat, 28 Dec 2002 01:56:24 GMT) NNTP-Posting-Date: Sat, 28 Dec 2002 01:56:24 GMT Organization: blueyonder (post doesn't reflect views of blueyonder) Xref: archiver1.google.com comp.lang.ada:32350 Date: 2002-12-28T01:56:11+00:00 List-Id: "Kevin Cline" wrote: > Hyman Rosen wrote in message > news:<7WdO9.115704$4W1.35198@nwrddc02.gnilink.net>... >> 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) Yes, for the placement pure and simple. What I really had in mind was using it with the additional mechanisms Hyman mentions below ... >> 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. [snip] >> I don't think beginners need to learn about this, though. ... specifically to create local (i.e. not heap) dynamic arrays. As I said, I don't know whether C++ beginners need to do that. Declaring dynamic local arrays in Ada 95 is trivial, of course. > > With the STL it's possible to write a lot of interesting > and efficient C++ code without using new at all. I realize that "arrays are evil" (and how!) in C++, and that using the STL would normally be preferred. -- Bill-Findlay chez blue-yonder.co.uk ("-" => "")