Class template
To create an instance of a class template
Class name< type parameter table >object;
The difference between a class template and a template class
A class template is a definition of a template, not a real class, defined by a generic type parameter
The template class is a real class definition. Is the instantiation of the class template. The parameters in the class definition are replaced by the actual type
Lesson 37STL Basic Concepts
Stl
Vectors (vector) belong to a sequence container that accommodates indefinite long line sequences, providing fast random access to sequences (also known as direct access)
A vector is a dynamic structure that simulates a dynamic array, which is not fixed in size and can be increased or decreased while the program is running.
The elements of a vector can be of any type T, but must have assignment and copy capabilities, copy constructors with public and overloaded assignment operators
Lesson 38vector
Stl
The size of the vectors (size) and the capacity (capacity) are usually different, capacity returns the number of elements the vector actually can hold. If more than this amount requires reconfiguration of internal storage
NetEase Cloud Classroom _c++ Development Introduction to Mastery _ Chapter 7: Templates