home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!enterpoop.mit.edu!eru.mt.luth.se!hagbard!loglule!jbn
- From: jbn@lulea.trab.se (Johan Bengtsson)
- Newsgroups: comp.lang.c++
- Subject: Re: How to prevent local instances, but allow "new"
- Message-ID: <5502@miramon.lulea.trab.se>
- Date: 7 Jan 93 16:32:04 GMT
- References: <726348154snx@trmphrst.demon.co.uk>
- Organization: Telia Research AB, Aurorum 6, 951 75 Lulea, Sweden
- Lines: 17
- X-Newsreader: TIN [version 1.1 + PL8]
-
- Nikki Locke (nikki@trmphrst.demon.co.uk) wrote:
- : In article <1icij0INNdhc@news.cerf.net> hlf@nic.cerf.net (Howard Ferguson) writes:
- : > I wish to define a class in a library which the library user
- : > can create by dynamic allocation via the new operator, but
- : > I want to prevent him from creating automic instances.
-
- : Leave the constructors public. Make the DESTRUCTOR private. Provide an
- : inline member function ...
-
- Make the destructor PROTECTED. He didn't say he wanted to
- prevent inheritance too...
-
- --
- --------------------------------------------------------------------------
- | Johan Bengtsson, Telia Research AB, Aurorum 6, S-951 75 Lulea, Sweden |
- | Johan.Bengtsson@lulea.trab.se; Voice:(+46)92075471; Fax:(+46)92075490 |
- --------------------------------------------------------------------------
-