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,927ae253da8bb547 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-05-31 10:23:09 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsswitch.lcs.mit.edu!newsfeed.ecrc.net.MISMATCH!news-FFM2.ecrc.net!news.cesnet.cz!crax.cesnet.cz!news.felk.cvut.cz!not-for-mail From: "Sergey Koshcheyev" Newsgroups: comp.lang.ada Subject: Re: Specialization Date: Fri, 31 May 2002 19:05:42 +0200 Organization: Czech Technical University Message-ID: References: <4519e058.0205300909.5bfb317d@posting.google.com> <3CF6CF7D.8000704@worldnet.att.net> <82347202.0205310608.2f7d634d@posting.google.com> NNTP-Posting-Host: m232.dkm.cz X-Trace: ns.felk.cvut.cz 1022864746 31555 62.24.78.232 (31 May 2002 17:05:46 GMT) X-Complaints-To: usenet@ns.felk.cvut.cz NNTP-Posting-Date: Fri, 31 May 2002 17:05:46 +0000 (UTC) X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Xref: archiver1.google.com comp.lang.ada:25104 Date: 2002-05-31T19:05:42+02:00 List-Id: Just a clarification, I'm not the original poster who wanted to implement STL in Ada, I have only jumped in to correct a little misinformation. "Jim Rogers" wrote in message news:82347202.0205310608.2f7d634d@posting.google.com... > After reading the above reference I see no significant difference between > the problems you encountered in Ada and the way the C++ STL is currently > implemented (regarding node allocation). Note that the SGI document states > that their allocator uses malloc rather than new. I am not sure this is > a big performance or safety advantage. It may be more flexible than the C++ > new operator. Regardless of what the allocator uses, you only get a pointer to a block of memory from it. You then need to construct the object, and often not at the time of the allocation, but later. However, calling a constructor explicitly is not allowed, so this is where the "hacks" come into the picture. If you look at the STL documentation, you will find a function 'construct', which implements such delayed construction. If there is a way to have this idiom ("delayed initialization") in Ada, this is what is needed. If there was a more Ada-like way to achieve a similar effect, like for example having space allocated for 8 items in a vector, but having only the first three items fully constructed (initialized) and usable, it would be even better. > You clearly understand how to use the C++ STL. Have you ever implemented > the C++ STL before? I think you are only now encountering the low level > details which must exist in the C++ STL. No, I haven't implemented the STL. And I don't even exactly remember the source of my knowledge about it :-) Sergey.