home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / lang / cplus / 18809 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  1.2 KB

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