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
M4$L#!!0````(`(=^1#,-8%>UH0$``$ $```2````<F5F97)E;F-E5')A8VME
M<BYHG5/;3L,P#'VOU'^P-`DZQ.6]C$JH* B!`&WC"=`44 \"75(E[KA,X]M)
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\I0PI) AX<7"`P(7X?RAV[C.EGO3$.ZB9 8#9^CN-V[S+YFH+.C?B:[=]18.
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
M^\`VEE;Z2^_FE='WRML'4$L#!!0````(`'F!1#.E!=[-Y````*`!```;````
M<F5F97)E;F-E5')A8VME<D5X86UP;&4N8W!P?9#12\,P$,;?`_D?PO;2BK3O
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
M9  O &`4'#<1H^R'#K+]C!)*) >#[\GC\RLHS[FRP?B"$N=;SGLY+-ZM;J^N
MV4&6Y[0]:'Q$$?/R7-1/VZ9<KW:[IA*WHA*;4C1UM2H?[C=WR8D[+=C/#KW4
M)DG9!R4L%H(/:% YCO%#G/^^+TDS#!-<'-G/F/$%4$L#!!0````(`#J`1#-:
M`KGKB0```.D````9````<F5F97)E;F-E5')A8VME<D5X86UP;&4N:'6.30K"
M0`Q&]X&Y0Z ;W7B`4=QX`#=>((T11\=,F9\B2.]NRQ2D MD$'M_WDI53]N4B
MV$2Y2A1E.4?BA\3MK3%  #VEA/*B9^?EU-Z%\^X/1[1H`.?I2NL=(R5_#-I+
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
M9F5R96YC951R86-K97(N:%!+`0(4`!0````(`'F!1#.E!=[-Y````*`!```;
M``````````$`(````-$!``!R969E<F5N8V54<F%C:V5R17AA;7!L92YC<'!0
M2P$"%``4````"``Z $0S6 *YZXD```#I````&0`````````!`"````#N` ``
M<F5F97)E;F-E5')A8VME<D5X86UP;&4N:%!+!08``````P`#`-````"N`P``
"``!F
`
end
Oct 04 2005