Original Post
I'm writting sort of a vector class, and when I try to use the array index operator I get an error that I dont understand. Any suggestions?
This line:
cMaterial *mat = materials[material];
Generates this error: error C2440: 'initializing' : cannot convert from 'SmartList' to 'cMaterial *'
with
[
T=cMaterial
]
Here is the definition:
And the function definition:
Generates this error: error C2440: 'initializing' : cannot convert from 'SmartList
Here is the definition:
SmartList<cMaterial> *materials;
And the function definition:
T* SmartList<class T>::operator[](long index)
{
if (list[index])
return list[index]->object;
else
GenError("Invalid Smartlist Index");
}
edit: stupid < >'s
[edited by - honayboyz on May 12, 2004 9:30:34 PM]
[edited by - honayboyz on May 12, 2004 9:31:59 PM]
[edited by - honayboyz on May 12, 2004 9:33:26 PM]
[edited by - honayboyz on May 12, 2004 9:34:12 PM]