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

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!mcsun!inesc.inesc.pt!inesc!cbt
  3. From: cbt@hobbes.inesc.pt (Conceicao Batista Tavares)
  4. Subject: static members of templates
  5. Message-ID: <CBT.92Dec15101117@hobbes.inesc.pt>
  6. Sender: usenet@inesc.pt (USENET News System)
  7. Nntp-Posting-Host: hobbes.inesc.pt
  8. Organization: INESC, Lisboa Portugal
  9. Distribution: comp
  10. Date: Tue, 15 Dec 1992 10:11:17 GMT
  11. Lines: 32
  12.  
  13.  
  14. I want to have a static member of a template
  15.  
  16. Example:
  17.  
  18.         class A {
  19.                 int a;
  20.         };
  21.  
  22.         template<T> class exemple {
  23.           static int elem;
  24.         };
  25.  
  26. For the definition of the static member I have to do this?
  27.  
  28.         int exemple<A>::elem;
  29.  
  30. The problem is that I have to assign a value to the parameter of the
  31. template to define the static member, and by consequence I have no 
  32. longer the facilities that I could achive with templates.
  33.  
  34. I don't know if my problem it's clear.
  35.  
  36. Thanks for any help.
  37.  
  38. --Sao
  39.  
  40. --
  41. <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> 
  42. <> Programs don't |        Sao Tavares                         <>        
  43. <> run, just walk |   E-mail: cbt@yosemite.inesc.pt            <>      
  44. <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
  45.