home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18011 < prev    next >
Encoding:
Text File  |  1992-12-15  |  926 b   |  39 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!caen!spool.mu.edu!umn.edu!csus.edu!borland.com!pete
  3. From: pete@borland.com (Pete Becker)
  4. Subject: Re: static members of templates
  5. Message-ID: <1992Dec15.173341.7000@borland.com>
  6. Originator: pete@genghis.borland.com
  7. Sender: news@borland.com (News Admin)
  8. Organization: Borland International
  9. References: <CBT.92Dec15101117@hobbes.inesc.pt>
  10. Distribution: comp
  11. Date: Tue, 15 Dec 1992 17:33:41 GMT
  12. Lines: 25
  13.  
  14. In article <CBT.92Dec15101117@hobbes.inesc.pt> cbt@hobbes.inesc.pt (Conceicao Batista Tavares) writes:
  15. >
  16. >I want to have a static member of a template
  17. >
  18. >Example:
  19. >
  20. >        class A {
  21. >                int a;
  22. >        };
  23. >
  24. >        template<T> class exemple {
  25. >          static int elem;
  26. >        };
  27. >
  28. >For the definition of the static member I have to do this?
  29. >
  30. >        int exemple<A>::elem;
  31. >
  32.  
  33.     template <class T> int example<T>::elem;
  34.  
  35.     -- Pete
  36.  
  37.  
  38.  
  39.