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 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!feeder.eternal-september.org!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Ada 2005,Doubly_Linked_List with Controlled parameter Date: Tue, 5 Apr 2016 10:50:03 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1083384c-e798-49a0-903a-718dea4ab131@googlegroups.com> <8fdba7bf-86a5-4d6e-b212-c670d3fdf9f9@googlegroups.com> NNTP-Posting-Host: bqgfK7NL3xTHnr0WRaLl4g.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 X-Notice: Filtered by postfilter v. 0.8.2 Xref: news.eternal-september.org comp.lang.ada:29987 Date: 2016-04-05T10:50:03+02:00 List-Id: On 05/04/2016 10:35, George J wrote: > .... >> Or, better, since you never change Name or Surname: >> >> type Info_Record >> (Name_Length : Positive; Surname_Length : Positive) is >> record >> Name : String (1..Name_Length); >> Surname : String (1..Surname_Length); >> Age : Natural; >> end Info_Record; >> >> -- >> Regards, >> Dmitry A. Kazakov >> http://www.dmitry-kazakov.de > > I do it this way, and I have to change Doubly_Linked_List(Info_Record) to > Indefinite_DoublY_Linked(Info_Record) cause of error:"unconstrained > subtype in component declaration". Am I right? I am not familiar with the design of standard container's doubly-linked lists. Normally, a list always deals with limited indefinite elements. Otherwise, it does not make much sense. > Or may be it's any way to > use Doubly_Linked_List? And,BTW, I'm afraid of using Indefinite List > cause I think,that it can request much more memory, than > Doubly_C_L,isn't it? As I said, I don't know how it is designed. There are many ways to design a list. One is that elements are derived from linked base elements. Another is that links are allocated outside and point to the elements. A better variant of the latter is to use a custom storage pool and put links before the elements. In all three methods there is no overhead of having elements limited indefinite. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de