C ++ heavy-load operations, type conversion, and heavy-load operations
1. Basic Concept 1.1 Basic Points
1.2 call method of overloaded Operator Functions
1) Non-member functions call operator + as the non-member functions of the object data1 and
What is the POD type?
The full name of POD is Plain Old Data. In general, a class or struct can keep its data unchanged after being copied in binary format, so it is a POD type.
Ordinary Definition
1. There are ordinary Constructors
2. There is an
Pure C ++ column... Original: Stanley B. LippmanTranslation: Coffer Source: pure C ++: Hello, C ++/CLI Welcome to my first column hosted in msdn magazine! In fact, I have written the first column before, and its content is completely different-it
The constructor initialization list starts with a colon, followed by a list of data members separated by commas (,). Each data member is followed by an initialization formula in parentheses. For example:
Class
Cexample
{ Public : Int A;
The initialization syntax is unified in the C ++ 11 standard. Before learning about these changes, we need to understand the aggregate and POD types, I saw a good article on Stack Overflow (original article). I have a detailed explanation of the
Chapter 2: List and array list
(): Empty list, false when used as a condition judgment
Two non-empty list examples: ("hello", "world", "\ n") (123,456,789)
Different types of elements can be contained in the same list.
The list in Perl is only
I have always wanted to learn the source code of the C ++ Open-Source engine. After comparing xapian, lemur, and firtex, I decided to start from xapian and look at lemur later.
Xapian is selected because the xapian code is more readable and closer
Suppose we create a class to save a bitmap with a pointer pointing to a dynamic allocation)
Class bitmap {...};Class widget{Public:Protected:PRIVATE:Bitmap * pb;};
This operator = makes the Code look reasonable on the surface, but it is not safe
Resources are: once used, they must be returned to the system in the future. In addition to common memory, there are also file descriptors (File description), mutex locks, brushes in the graphic interface, and database connections.
And network
Common resources include memory, file descriptor, mutex locks, fonts and brushes in the graphic interface, database connections, and network sockets. These resources are generally dynamically created and allocated, which is a pointer. Regardless of
Noncopyable
Function
Allows programs to easily implement a non-replicable class.
Header files must be included
# Include or
# Include
Principle
When C ++ defines a class, if the replication constructor and the copy
If you want to define the element classes of STL containers by yourself, it is best to meet the element requirements of STL containers.Required:1. copy constructor2. Assignment = Operator3. destructor that can destroy objectsIn addition:1. Available
Efficient C ++ and efficient classrooms
Valid C ++
Pointer and reference are different:
The pointer must be initialized during definition. If this variable may point to null during use, you must use a pointer instead of reference.
Another important
One, Vector (cont.)1. Size and capacitySize: The number of elements in the container.Capacity: The number of elements that can be accommodated in a container.Size_type size (void) const; Get sizevoid resize (Size_type num,Value_type const& val =
Google's excellent C + + open source projects, including the Chromium browser project can be said to be very representative, in addition to its third open source Library or its own excellent open source library, can be as needed to extract their own
According to the derivation in the second chapter of the book "Real-time Shadow", the simplest shadow technique is realized.Planar shadow a projection matrix to project the vertices of an object illuminated by the light in the direction of the light
Unique Pointer: Manages the storage of a pointer, providing a limited garbage-collection facility, with little to no overhead over built-i n Pointers (depending on the deleter used).These objects has the ability of taking ownership of a pointer:once
Chained queue is a kind of storage representation based on single linked listThe head pointer of the queue points to the first node of the single-linked list, and the tail pointer points to the last node in the single-linked list.Exiting an element
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.