home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!spool.mu.edu!sgiblab!sgigate!odin!roadrunner.denver.sgi.com!bruceb
- From: bruceb@roadrunner.denver.sgi.com (Bruce Bailey)
- Subject: Re: How to prevent local instances, but allow "new"
- Message-ID: <1993Jan5.194223.19400@odin.corp.sgi.com>
- Sender: news@odin.corp.sgi.com (Net News)
- Nntp-Posting-Host: roadrunner.denver.sgi.com
- Organization: Silicon Graphics, Inc.
- References: <1icij0INNdhc@news.cerf.net>
- Date: Tue, 5 Jan 1993 19:42:23 GMT
- Lines: 14
-
- 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.
- |>
- |> I thought that giving the class a public new operator,
- |> but a private constructor would work, but this prevents
- |> any instances of either type from being created.
- |>
-
- Make the destructor private.
-
- Bruce Bailey (bruceb@denver.sgi.com)
-