home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!mcsun!inesc.inesc.pt!inesc!cbt
- From: cbt@hobbes.inesc.pt (Conceicao Batista Tavares)
- Subject: static members of templates
- Message-ID: <CBT.92Dec15101117@hobbes.inesc.pt>
- Sender: usenet@inesc.pt (USENET News System)
- Nntp-Posting-Host: hobbes.inesc.pt
- Organization: INESC, Lisboa Portugal
- Distribution: comp
- Date: Tue, 15 Dec 1992 10:11:17 GMT
- Lines: 32
-
-
- I want to have a static member of a template
-
- Example:
-
- class A {
- int a;
- };
-
- template<T> class exemple {
- static int elem;
- };
-
- For the definition of the static member I have to do this?
-
- int exemple<A>::elem;
-
- The problem is that I have to assign a value to the parameter of the
- template to define the static member, and by consequence I have no
- longer the facilities that I could achive with templates.
-
- I don't know if my problem it's clear.
-
- Thanks for any help.
-
- --Sao
-
- --
- <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
- <> Programs don't | Sao Tavares <>
- <> run, just walk | E-mail: cbt@yosemite.inesc.pt <>
- <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <> <>
-