NetEase Cloud Classroom _c++ Development Introduction to Mastery _ Chapter 7: Templates

Source: Internet
Author: User
Tags class definition

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.