template<class _TYPE, class _VALUE = int>
class avltree;
This is the function:
1 2
template<class _TYPE, class _VALUE>
avltree<_TYPE, _VALUE>* avltree<_TYPE, _VALUE>::addValue (const _TYPE&);
and this is how im calling it:
1 2 3 4 5 6
TestClass * arr[5];
for (int x = 0; x < 5; x++)
{
arr[x] = new TestClass (rand() % 1000, static_cast<double>(rand() % 100000) / 100.0); //these are the correct parameters for each initialization of TestClass
TestClass::idTree.addValue (arr[x]); //TestClass::idTree is a avltree<TestClass*, int> variable
}
And these are the errors its giving me:
1 2
Error 1 error C2663: 'avltree<_TYPE>::addValue'
Error 2 IntelliSense: no instance of overloaded function "avltree<_TYPE, _VALUE>::addValue [with _TYPE=TestClass *, _VALUE=int]" matches the argument list and object (the object has type qualifiers that prevent a match)
its just: avltree<TestClass*, int> TestClass::idTree (GetId);
GetId is an unrelated function, the issue is the addValue function
Using the constructor with the GetId function supplies a function to determine the value of the class type, ie: constint& GetId (const TestClass*& thisobj) { return thisobj->id; }
so that you can have multiple trees for one class without wasting your > < >= <= and == operators