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,1e0472f55fc12a52 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-19 10:35:15 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn-xit-03!sn-xit-01!sn-post-01!supernews.com!corp.supernews.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How do I create an object instance from a tag? Date: Wed, 19 Feb 2003 12:36:25 -0600 Organization: Posted via Supernews, http://www.supernews.com Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Newsreader: Microsoft Outlook Express 4.72.3612.1700 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3719.2500 X-Complaints-To: abuse@supernews.com Xref: archiver1.google.com comp.lang.ada:34231 Date: 2003-02-19T12:36:25-06:00 List-Id: "Grein, Christoph" wrote: > >So there are good reasons why there is not yet a solution for this problem. The main one is discriminants. Tagged type discriminants never have defaults. Moreover, you can add discriminants to any extension of a tagged type, so you never can know if you have any. And, certainly, the creation of an object with uninitialized discriminants is a no-no. What you really want to do is force the calling of a particular constructor function. (That's what T'Class'Input does, after all, with T'Input being the constructor). If you have a dispatching constructor "Make", then you want something like: Obj : T'Class := T.Make () using ; But the reviewers thought that special syntax was overkill for this problem, and no one has been able to come up with any other solution that really works. Randy.