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,fed2e7871ca258cd X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-28 08:43:27 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!nntp.abs.net!uunet!dca.uu.net!ash.uu.net!spool0900.news.uu.net!reader0900.news.uu.net!not-for-mail Message-ID: <3C2CA143.6030006@mail.com> Date: Fri, 28 Dec 2001 11:43:47 -0500 From: Hyman Rosen User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:0.9.7+) Gecko/20011226 X-Accept-Language: en-us MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: List Container Strawman 1.4 References: <87lmfsn2jj.fsf@deneb.enyo.de> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1009557805 reader0.ash.ops.us.uu.net 8610 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:18358 Date: 2001-12-28T11:43:47-05:00 List-Id: Ted Dennison wrote: > Actually, I was thinking along the lines of an Containers.Lists.Fixed > package that works with arrays. I think this kind of thing is where C++'s iterators and algorithms approach shows its superiority. Why should a List have any notion of other data structures to which its elements can be copied? In the STL, creating or copying one structure from another can be done just using the std::copy algorithm, a pair of iterators giving the source range, and a target iterator which receives the copies. If you want to copy to a fixed-size array, the target iterator can simply be a pointer to the first element. If you are creating a more complicated target (such as another list, or a vector), then it is the iterator that holds the semantics of where the data goes, for example std::inserter or std::back_inserter.