home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18722 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1006 b   |  27 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!spool.mu.edu!sgiblab!sgigate!odin!roadrunner.denver.sgi.com!bruceb
  3. From: bruceb@roadrunner.denver.sgi.com (Bruce Bailey)
  4. Subject: Re: How to prevent local instances, but allow "new"
  5. Message-ID: <1993Jan5.194223.19400@odin.corp.sgi.com>
  6. Sender: news@odin.corp.sgi.com (Net News)
  7. Nntp-Posting-Host: roadrunner.denver.sgi.com
  8. Organization: Silicon Graphics, Inc.
  9. References:  <1icij0INNdhc@news.cerf.net>
  10. Date: Tue, 5 Jan 1993 19:42:23 GMT
  11. Lines: 14
  12.  
  13. In article <1icij0INNdhc@news.cerf.net>, hlf@nic.cerf.net (Howard Ferguson)
  14. writes:
  15. |> I wish to define a class in a library which the library user
  16. |> can create by dynamic allocation via the new operator, but
  17. |> I want to prevent him from creating automic instances.
  18. |> 
  19. |> I thought that giving the class a public new operator,
  20. |> but a private constructor would work, but this prevents
  21. |> any instances of either type from being created.
  22. |> 
  23.  
  24. Make the destructor private.
  25.  
  26. Bruce Bailey (bruceb@denver.sgi.com)
  27.