//returns the size of the current container
Size_type size () const;
//index operator function
T& Operator [] (size_type);
Const T& Operator [] (size_type) const;
In the Vec CPP defined in this three functions:
Template
Typename Vec
Return limit - the data;
}
Template
T& Vec
The return data [I];
}
Template
Const T& Vec
Return * (data + I);
}
Then in Str. CPP in include the header file and call the three functions, is a function is undefined mistake, then I directly in the Vec. H header file statement class
Directly defines these three functions, compiled through, can to a great god said what reason is this
CodePudding user response:
At the end of the template to write a file