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=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.27.101 with SMTP id s5mr6366246obg.0.1413560527899; Fri, 17 Oct 2014 08:42:07 -0700 (PDT) X-Received: by 10.50.85.38 with SMTP id e6mr424118igz.9.1413560527796; Fri, 17 Oct 2014 08:42:07 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!mx02.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!feeder.erje.net!eu.feeder.erje.net!news.glorb.com!h18no6956884igc.0!news-out.google.com!rp1ni32382igb.0!nntp.google.com!uq10no12544050igb.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Fri, 17 Oct 2014 08:42:06 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: Subject: Re: pointers and protected objects From: Adam Beneschan Injection-Date: Fri, 17 Oct 2014 15:42:07 +0000 Content-Type: text/plain; charset=ISO-8859-1 Xref: news.eternal-september.org comp.lang.ada:22552 Date: 2014-10-17T08:42:06-07:00 List-Id: On Friday, October 17, 2014 5:51:43 AM UTC-7, tonyg wrote: > I can create pointers to protected objects, but how do I initialise the protected object as it is a limited type and the syntax > > po_ptr := new Po_Type'(Po_Type_Instance) would not be allowed That syntax would mean that a new protected object would be created and Po_Type_Instance would be copied to it. But you can't copy protected objects. You can, however, say po_ptr := new Po_Type; or po_ptr := new Po_Type'(Some_Function(...)); where Some_Function is a function that returns a Po_Type. -- Adam