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=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,31178c24bcde806e X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-01-13 03:31:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.vmunix.org!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Mon, 13 Jan 2003 16:28:53 +0500 References: Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Finalization of tagged types - problem Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3e22a39e$0$33926$bed64819@news.gradwell.net> NNTP-Posting-Date: 13 Jan 2003 11:31:42 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1042457502 news.gradwell.net 33926 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:32958 Date: 2003-01-13T11:31:42+00:00 List-Id: In article , "Grein, Christoph" writes: > From: porton@ex-code.com (Victor Porton) > >> I have a non-limited tagged type (not derived from >> Ada.Finalization.Controlled) Base. >> >> I derive: >> >> type State_Type is new Base with >> record >> -- ... >> Finalizer: Finalizer_Type(State_Type'Access); >> end record; >> >> I want to add a component with back-reference derived >> from Ada.Finalization.Controlled or >> Ada.Finalization.Limited_Controlled for auto-finalization >> of State_Type. >> >> But >> >> type Finalizer_Type(State: access State_Type) is >> new Ada.Finalization.Controlled with null record; >> >> Compiler: "Access discriminant are allowed only for limited types". >> >> Can be done something among the obvious but imperfect >> solutions: 1. make Base controlled. 2. make Base limited >> and derive Finalizer_Type from Limited_Controlled instead? > > I've published a few years ago in Ada Letters a paper "Add Finalization" dealing > with this problem. You can find it online on my home page > > Christoph, thanks. So is it your opinion: derive from Controlled if it may be needed in a derived? BTW, Is derivance from Controlled a big overhead?