class eResource
{
public:
template <class derived>
class Attribute
{
public:
class attribute
{
private:
vector <unsignedchar>
values;
static map <string, int>
maps;
public:
staticint test; //This is what I'm trying to define
unsignedchar& operator[] (int index)
{ return values[index]; }
unsignedchar& operator[] (string str)
{ return values[ maps[str] ]; }
};
string name;
string description;
attribute attributes;
};
class Tile:
public Attribute <Tile>
{
};
}
};
Defining: int eResource::Attribute<eResource::Tile>::attribute::test;
Receive these error in codeblocks:
|18|error: 'class eResource::Attribute<eResource::Tile>' is not a valid type for a template constant parameter|
|19|error: 'attribute' in namespace '::' does not name a type|
Mind my lacking C++ terminology:
Attribute is using recursive derivation (templates) to create multiple parent instances of a single object, so static data members can be sliced into portions. In order for me to access (set/get) values, it needs to be defined.
I find the whole defining part quite messy, hard to get my head around.. Any help would be helpful.