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=-0.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,591cbead201d7f34,start X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!i12g2000prf.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Prohibiting dynamic allocation for the given type Date: Tue, 18 Mar 2008 14:30:37 -0700 (PDT) Organization: http://groups.google.com Message-ID: <83335709-e099-416b-9967-5ab6aa0aea11@i12g2000prf.googlegroups.com> NNTP-Posting-Host: 85.3.69.234 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1205875837 17625 127.0.0.1 (18 Mar 2008 21:30:37 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 18 Mar 2008 21:30:37 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i12g2000prf.googlegroups.com; posting-host=85.3.69.234; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20472 Date: 2008-03-18T14:30:37-07:00 List-Id: Is it possible to "prohibit" dynamic allocation for the given type? Let's suppose that I have a type which instances make sense only on the stack. I want to prohibit users from dynamically allocating instances of this type so that they don't get into troubles. Preferably at compile-time. My understanding is that it cannot be done (allocation is not considered to be a type's operation and there is no way to "hide" it from users - as is possible in C++), but I would like to have it confirmed. -- Maciej Sobczak * www.msobczak.com * www.inspirel.com