I can't seem to make a vector<T> in the private section of a class, even though I declare template<class T> at the beginning of the class. Totally new to this template stuff, so any suggestions will be a help.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
usingnamespace std;
class Sorter
{
public:
template<class T> // <-- here T is defined
Sorter();
void sortValues();
void outputValues();
private:
vector<T> values; // <-- here VS 2010 says "T is undefined."
}
template<class T> //here we say that our class is a template
class Sorter{
public:
//...
private:
std::vector<T> values; //don't `using namespace std' in headers
};