You can initialize the vector to your given size in the member intializer of the constructor:
template <class T>
class name {
private:
int nr;
std::vector<stack<T> > nameArray;
public:
name (int x) : nr(x), nameArray(nr) {}
//other methods
};
Working example here: http://codepad.org/ZT9iuQEg