template function error..
- by sil3nt
Hi there, I have function which takes in an parameter of a class called "Triple", and am returning the averge of 3 values of type float.
template <typename ElemT>
float average(Triple ElemT<float> &arg){
float pos1 = arg.getElem(1);
float pos2 = arg.getElem(2);
float pos3 = arg.getElem(3);
return ( (pos1+pos2+po3) /3 );
}
when i try compiling this i get
q2b.cpp:32: error: template declaration of `float average'
q2b.cpp:32: error: missing template arguments before "ElemT"
not quite sure what this means.