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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,2f84446733b06aca X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,2f84446733b06aca X-Google-Attributes: gid103376,public From: Dale Stanbrough Subject: Re: Converting C++ class to Ada Date: 1996/12/12 Message-ID: <58npck$iku$1@goanna.cs.rmit.edu.au>#1/1 X-Deja-AN: 203615913 distribution: world references: <32ADF183.7195@lmtas.lmco.com> content-type: text/plain; charset=ISO-8859-1 x-xxmessage-id: organization: RMIT, Melbourne, Australia mime-version: 1.0 newsgroups: comp.lang.ada,comp.lang.c++ Date: 1996-12-12T00:00:00+00:00 List-Id: "My main issues: (1) What do I do about the constructor? As I understand C++, I need to force the user to supply values for the components of Object_Type when something of that type is declared. How do I do this?" The only way to force this seems to be the use of private types with discriminants. type Object_Type(<>) is private; which says this _may_ have discriminants, but that's private. The only way to initialize and object, and you are forced to, is via a function. E.g. Item : Object_Type; -- illegal, must be initialized Item : Object_Type := Init(....); -- Ok. The full type definition does not have to have the discriminants. IMHO, it would have been nicer to be able to say "this object must be initialized when declared" by using a different mechanism to this (rather obscure) one. Dale