C ++ Review3_ series and combing on C ++ concepts of

After the previous two Review, code reuse, inheritance class concept has been further understanding.

Re-set to do it again here, the other concepts are linked together to form a knowledge framework.

 

First class and object concepts. The object refers to the combination of characteristics and skills, the benefits of object-oriented programming ideas to improve the program's scalability, maintainability and readability are better.

 

Class to be considered when constructing the dynamic allocation of memory , but also have a constructor , destructor concept.

 

In order to make the operation target more beautiful, with operator overloading techniques.

 

Overloaded function is a major feature of the C ++ language is different from the C language. Overloaded significance to the caller a lot of convenience, improve the readability of the program, decided the same way according to the actual operating conditions which block the actual call.

 

Operator overloading and class member function overloading, C ++ is actually polymorphic a form of art. Polymorphism is one of C ++ object-oriented three characteristics, are the other two packages , inheritance .

 

Polymorphic concept is actually built on the concept of inheritance of a multi-state concept is closely related to virtual functions , there is a build (static binding, dynamic binding) , will involve multi-state properties the overhead running.

 

Package concept is well understood, a pile encapsulated with a process function, a grouping of related variables encapsulated structure

 

Considering the code reuse , the class multiplexing the like. ---> will have a class inheritance concept

 

Public inheritance (is-a relationship) is one mechanism for code reuse, in addition to the combination aspect of code reuse, comprising , private inheritance , protected inheritance (has-a relationship) and the like.

 

Also on code reuse as well as multiple inheritance , a class template concept.

 

Class template is a template function extension concept.

 

The benefits of the template is packaged and reuse process or algorithm, and make it independent of the type.

 

C ++ provides a number of standard template library and standard classes, these may be based on existing code, to develop their own programs.

 

Furthermore, since the concept of class members have private, public members, protected members. These concepts are in fact intended to limit the authority of the outside world class data access. This data is well protected, but sometimes not quite easy, this time I need a friend .

Simply put a special friend function of a non-member function, which can access the private data of the class.

 

Friend , friend function concept and then extended it, and will have a friend class .

 

There are also memory model, namespace, exceptions, input and output streams, file, generic programming, containers, iterators, and other concepts continue to be sort out ....

Guess you like

Origin www.cnblogs.com/grooovvve/p/11204490.html