================================================ ========================== Click to go directly to the personal homepage: Xiaobai is not a program Yuan C++ series column: C++ headache Code repository: Gitee ================================================ ========================== Table of Contents Preface Let’s talk about the constructor again initialization list explicit keyword anonymous object static member friends friend function Friend class inner class Understand classes and objects […]
Tag: member
Several default member functions of classes in C++
Several default member functions of classes in C++ 1. Constructor The constructor is a special member function. The name is the same as the class name. It is automatically called by the compiler when creating a class type object to ensure that each data member has an appropriate initial value and is stored in the […]
c++ default member function
Table of Contents default member function 1. Constructor 1.1 Concept of constructor 1.2 The constructor you wrote and how to call it 1.2.1 Date implementation 1.2.2 Implementation of stack 1.3 Default constructor generated by the compiler 1.3.1 Date implementation 1.3.1 Implementation of stack 1.3.3 Implementation of queue (two stacks implement one queue) 2. Destructor 2.1 […]
C++ Standard Templates (STL) – Type Support (composite type categories, is_member_pointer, is_reference, is_compound)
Type attributes A type attribute defines a compile-time template-based structure for querying or modifying the properties of a type. Attempting to specialize a template defined in the header results in undefined behavior, except that std::common_type can be specialized as described. Templates defined in the header file may be instantiated with incomplete types unless otherwise specified, […]
C++6 default member functions (in classes and objects)
Table of Contents default member function 1. Constructor 1.1 Concept of constructor 1.2 The constructor you wrote and how to call it 1.2.1 Date implementation 1.2.2 Implementation of stack 1.3 Default constructor generated by the compiler 1.3.1 Date implementation 1.3.1 Implementation of stack 1.3.3 Implementation of queue (two stacks implement one queue) 2. Destructor 2.1 […]
Application of const and volatile in instance member functions
There are almost no restrictions on the scope of use of const and volatile const or volatile can appear after the parameters of the instance member function, both of which are used to modify the object pointed to by the implicit parameter this of the function. const appears after the parameter list of the instance […]
Export all Yuque documents as markdown files (no super membership required)
Foreword: On October 23, 2023, Yuque hung up for a while, which made me unable to write documents. This made me realize that it was unreliable to put all the documents on the cloud server. Make a local backup, so the content of this article is available.Important note: The code has not been rigorously tested, […]
C++: Default member function of class ——copy constructor && assignment operator overloading
Table of Contents I. Introduction 2. Copy constructor Concept of copy constructor Copy constructor characteristics Explanation feature 2: The copy constructor has only one parameter and must be passed by reference. Using the pass-by-value method will cause infinite recursive calls. Explanation feature 3: If no definition is displayed, the system generates a default copy constructor. […]
Budokan membership management website based on Python
IT Jump Valley Graduation Exhibition Personal profile: I am a computer ape who has been in the computer industry for ten years and has rich experience. I have worked hard in various programming languages and software projects, from the initial rookie to the later computer professional training instructor. I love sharing experiences, recording practical videos […]
[Golang]Multiple return value functions, defer keyword, built-in functions, variable parameter functions, class member functions, anonymous functions
Function Article directory function multiple return function Pass by value, pass by reference class member function change external variables variadic function defer and trace illustrate Some common operations accomplish Using `defer` to implement code tracing Record function parameters and return values Common built-in functions Pass function as parameter Closure Example Closure returns function as return […]