C ++, template argument error
Below is my template matrix that I want to build, taking a value from a user. But when I compile it. I am getting below error. Why a mistake?
SO_template.cpp: In a member function void Matrix<T>::BuildMatrix(std::vector<T, std::allocator<_CharT> >)':
SO_template.cpp:44: error: expected
; 'to "it"
If I specialize my class using int it doesn't complain, why?
template<class T>
class Matrix
{
private:
vector<T> col;
int iNumberOfRow;
int iNumberOfCol;
public:
void BuildMatrix(const std::vector<T> stringArray)
{
std::vector<T>::iterator it= stringArray.begin();
cout<<"Build Matrix irow="<<stringArray.size();
...
...
}
};
+3
source to share