www.digitalmars.com Home | Search | C & C++ | D | DMDScript | News Groups | index | prev | next
Archives

D Programming
D
D.gnu
digitalmars.D
digitalmars.D.bugs
digitalmars.D.dtl
digitalmars.D.dwt
digitalmars.D.announce
digitalmars.D.learn
digitalmars.D.debugger

C/C++ Programming
c++
c++.announce
c++.atl
c++.beta
c++.chat
c++.command-line
c++.dos
c++.dos.16-bits
c++.dos.32-bits
c++.idde
c++.mfc
c++.rtl
c++.stl
c++.stl.hp
c++.stl.port
c++.stl.sgi
c++.stlsoft
c++.windows
c++.windows.16-bits
c++.windows.32-bits
c++.wxwindows

digitalmars.empire
digitalmars.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
Oct 04 2005