E
Ernesto
Hola gurús:
I'm programming my own collection classes and I already implemented a
DynamicArray defined as:
template <class T>
class DynamicArray
{
...
};
Now, I want to implement a hash table as follows:
template <class KEY_T, class VALUE_T>
class HashTable
{
};
In my hash table, the data will be stored in a DynamicArray that will
contain DynamicArrays containing the respective [key;value] objects.
So, I defined too:
template <class KEY_T, class VALUE_T>
class HashTableKeyValue
{
...
KEY_T key;
VALUE_T value;
};
so, I want to create an attribute inside my hash table like:
DynamicArray < HashTableKeyValue<KEY_T, VALUE_T> > ** dataarray;
i.e., I want my dataarray to contain DynamicArrays that contain
HashTableKeyValues<KEY_T, VALUE_T> ... obviously, it does not compile
because the notation is not correct (the compiler says that it needs a
real type, not a template).
How can I implement this stuff? Do you think my logic is right?
Thanks in advance
Saludos
Ernesto
I'm programming my own collection classes and I already implemented a
DynamicArray defined as:
template <class T>
class DynamicArray
{
...
};
Now, I want to implement a hash table as follows:
template <class KEY_T, class VALUE_T>
class HashTable
{
};
In my hash table, the data will be stored in a DynamicArray that will
contain DynamicArrays containing the respective [key;value] objects.
So, I defined too:
template <class KEY_T, class VALUE_T>
class HashTableKeyValue
{
...
KEY_T key;
VALUE_T value;
};
so, I want to create an attribute inside my hash table like:
DynamicArray < HashTableKeyValue<KEY_T, VALUE_T> > ** dataarray;
i.e., I want my dataarray to contain DynamicArrays that contain
HashTableKeyValues<KEY_T, VALUE_T> ... obviously, it does not compile
because the notation is not correct (the compiler says that it needs a
real type, not a template).
How can I implement this stuff? Do you think my logic is right?
Thanks in advance
Saludos
Ernesto