www.digitalmars.com         C & C++   DMDScript  

c++ - A static attribute in a parent template class can't be created. - Example.zip

Hello!

I've got a 'situation' here. I think this should work... Any ideas?
I want to have a template which specifies a static stl map and other stuff.
And then derive from it and create that static stl map.  It doesn't seem to be 
working.

(pseudo copy)

<< first .h file>>
namespace conversion
{
template <class T>
class refCount
{
public:  
static std::map<void*,void*> objectList;
...
};
};

<<new .h file>>

class example;

class example: public refCount<<example>>
{
example()
{ }
}


<< cpp file >>

std::map<void*, void*> example::objectList;


When I try to compile it tells me that objectList is not a member of the struct
example.

I'll attach the three real files for added enjoyment.

Thanks for any help!

Cary FitzHugh


begin 0644 Example.zip


MEY9V X$ +TU][./C2SI"\JQ($7I3Y*1TY'N=3].$Y?;?]R2;H,D91V`FBY6<
MHC9"2=^;^1[8TTEQ+"3"(!E>78[BL\/!8-1/CI)^<AXGHV'_,#X].3\.7KIP
MXP+:QU`:AC933^,8-4J.0\WX$^K>5(ET*]J&-0!$\!*&ZN[1"C\3AO9+J24C
MX23/&-D">,:,`7K-,7*0,ZP2.FSVJ2TO[C+!PYK/J60D>",6%AI N_I&\(V.

M*N.Z7$)2T\18%9*"]?P:J="R78\1;QBL%%)?FR%H138`T[`!5P?W0]96)P)Z
M$&9]WX2F F7P_ ?R]D"_8Z]+J/>HAO;VX! )&+C'!FH,](!5:XQMJUTS2<+N
M;KJ[%`5<60QVP"AX5<6F`<[D)H%]EP:>!0%.6 '.>;&K+E'U8K; 'LFJ+H?P


MZ1B,&D4<<W3UN<3T9-$V*9=$"N+_;C,GN.&\A_O ^'T?=S?71G6A!;90X^C!
M^;R>VEH[#P8PVR\IF?^)U"C5V[]$%<SEB`ID=P-.H1Z\ML9=P`2BQ2UJX\^3

MV4&6Y[0]:'Q$$?/R7-1/VZ9<KW:[IA*WHA*;4C1UM2H?[C=WR8D[+=C/#KW4
M)DG9!R4L%H(/:% YCO%#G
M`KGKB0```.D````9````<F5F97)E;F-E5')A8VME<D5X86UP;&4N:'6.30K"

MV$2Y2A1E.4?BA\3MK3%  #VEA
M3"ZHM;]7] O#P<"[&FK;?G4I4QYU3C-R*#H],>%%?;VI<'8,=1D8QO`'4$L!
M`A0`%````` `AWY$,PU 5[6A`0``2`0``!(``````````0` `````````')E

M``````````$`(````-$!``!R969E<F5N8V54<F%C:V5R17AA;7!L92YC<'!0
M2P$"%``4````"``Z $0S6 *YZXD```#I````&0`````````!`"````#N` ``

"``!F
`
end
Oct 04 2005