# Introduction

Relevant code is on [Github](https://github.com/navining/gocpp). Please give me a star if you benifit from it!

😀 These notes are for：

1. People who have already learned C and want to learn C++
2. People who already know C++ and want to learn in depth
3. People who are preparing for recruitment and want to crack the technical interviews (like me)
4. People who want to use C++ in practical projects and want to know about common programming techniques

🙁 These notes are not for:

1. People who have no programming experience with C-style programming languages
2. People who want to delve into the details of C++ standards

**Have fun!**

## Contents

### **Chapter 1: What You Must Know First**

1. [Virtual Address Space of Process: Memory Partition and Layout](/gocpp/chapter-1/virtual-address-space-of-process-memory-partition-and-layout.md)
2. [Function Call: Stack Frame](/gocpp/chapter-1/function-call-stack-frame.md)
3. [Program Compiling and Linking](/gocpp/chapter-1/program-compiling-and-linking.md)

### **Chapter 2: C++ Basics Improvement**

1. [Default Parameters](/gocpp/chapter-2/default-parameters.md)
2. [Inline Function](/gocpp/chapter-2/inline-function.md)
3. [Function Overloading](/gocpp/chapter-2/function-overloading.md)
4. [`new` and `delete`](/gocpp/chapter-2/new-and-delete.md)
5. [`const` and Pointers](/gocpp/chapter-2/const-and-pointers.md)
6. [References in Detail](/gocpp/chapter-2/references-in-detail.md)

### **Chapter 3: Object-Oriented Principles**

1. [Class and Object](/gocpp/class-and-object.md)
2. [Constructor and Destructor](/gocpp/constructor-and-destructor.md)
3. [Shallow Copy and Deep Copy](/gocpp/shallow-copy-and-deep-copy.md)
4. [Initializer List](/gocpp/initializer-list.md)
5. [Various Member Functions](/gocpp/various-member-functions.md)
6. [Pointer to Class Members](/gocpp/pointer-to-class-members.md)

### **Chapter 4: Template Programming**

1. [Function Templates](/gocpp/function-templates.md)
2. [Class Templates](/gocpp/class-templates.md)
3. [Memory Allocators](/gocpp/memory-allocators.md)

### **Chapter 5: Operator Overloading**

1. [Operator Overloading](/gocpp/chapter-5/operator-overloading.md)
2. [Introduction to Iterators](/gocpp/chapter-5/introduction-to-iterators.md)
3. [Issues of Iterator Invalidation](/gocpp/chapter-5/issues-of-iterator-invalidation.md)
4. [More about `new` and `delete`](/gocpp/chapter-5/more-about-new-and-delete.md)
5. [Overloading of `new` and `delete`: Object Pool](/gocpp/chapter-5/overloading-of-new-and-delete-object-pool.md)

### **Chapter 6: Inheritance and Polymorphism**

1. [Look inside Inheritance](/gocpp/chapter-6/look-inside-inheritance.md)
2. [More about Inheritance](/gocpp/chapter-6/more-about-inheritance.md)
3. [Virtual Functions, Static Binding and Dynamic Binding](/gocpp/chapter-6/virtual-functions-static-binding-and-dynamic-binding.md)
4. [More about Virtual Functions](/gocpp/chapter-6/more-about-virtual-functions.md)
5. [Understanding Polymorphism](/gocpp/chapter-6/understanding-polymorphism.md)
6. [Abstract Classes](/gocpp/chapter-6/abstract-classes.md)
7. [Frequently Asked Interview Questions: Polymorphism](/gocpp/chapter-6/frequently-asked-interview-questions-polymorphism.md)

### **Chapter 7: Multiple Inheritance**

1. [Virtual Inheritance and Virtual Base Classes](/gocpp/chapter-7/virtual-inheritance-and-virtual-base-classes.md)
2. [Diamond Problem](/gocpp/chapter-7/diamond-problem.md)
3. [Four Kinds of Type Conversions](/gocpp/chapter-7/four-kinds-of-type-conversions.md)

### **Chapter 8: Standard Template Library**

1. [Sequence Containers](/gocpp/chapter-8/sequence-containers.md)
2. [Container Adapters](/gocpp/chapter-8/container-adaptors.md)
3. [Associative Containers](/gocpp/chapter-8/associative-containers.md)
4. [More about Iterators](/gocpp/chapter-8/more-about-iterators.md)
5. [Function Objects](/gocpp/chapter-8/function-objects.md)
6. [Generic Algorithms, Binders and Lambda Expressions](/gocpp/chapter-8/generic-algorithms-binders-and-lambda-expressions.md)

### **Chapter 9: Object Optimization**

1. [Behind the Object](/gocpp/chapter-9-object-optimization/behind-the-object.md)
2. [Optimizing Objects in Functions](/gocpp/chapter-9-object-optimization/optimizing-objects-in-functions.md)
3. [Member Functions with Rvalue References](/gocpp/chapter-9-object-optimization/member-functions-with-rvalue-references.md)
4. [Move Semantics and Perfect Forwarding](/gocpp/chapter-9-object-optimization/move-semantics-and-perfect-forwarding.md)

### **Chapter 10:** Smart Pointers

1. [Smart Pointers](/gocpp/chapter-10-smart-pointers/smart-pointers.md)
2. [Smart Pointers without Reference Counting](/gocpp/chapter-10-smart-pointers/smart-pointers-without-reference-counting.md)
3. [Smart Pointers with Reference Counting](/gocpp/chapter-10-smart-pointers/smart-pointers-with-reference-counting.md)
4. [Custom Deleters](/gocpp/chapter-10-smart-pointers/custom-deleters.md)

### **Chapter 11:** Function Objects and Binders

1. [More about Binders](/gocpp/chapter-11-function-objects-and-binders/more-about-binders.md)
2. [Introduction to *std::function*](/gocpp/chapter-11-function-objects-and-binders/introduction-to-std-function.md)
3. [Template Specialization and Argument Deduction](/gocpp/chapter-11-function-objects-and-binders/template-specialization-and-argument-deduction.md)
4. [More about *std::function*](/gocpp/chapter-11-function-objects-and-binders/more-about-std-function.md)
5. [*std::bind()*: A Simple Thread Pool](/gocpp/chapter-11-function-objects-and-binders/std-bind-a-simple-thread-pool.md)
6. [More about Lambda Expressions](/gocpp/chapter-11-function-objects-and-binders/more-about-lambda-expressions.md)

### **Chapter 12:** Multithreading

1. [Important Features in C++11](/gocpp/chapter-12-multithreading/important-features-in-c++11.md)
2. [Multithreaded Programming with *std::thread*](/gocpp/chapter-12-multithreading/multithreaded-programming-with-std-thread.md)
3. [Mutual Exclusion](/gocpp/chapter-12-multithreading/mutual-exclusion.md)
4. [Producer-Consumer Problem](/gocpp/chapter-12-multithreading/producer-consumer-problem.md)
5. [Atomic Operations](/gocpp/chapter-12-multithreading/atomic-operations.md)
6. [Thread Visibility and `volatile`](/gocpp/chapter-12-multithreading/thread-visibility-and-volatile.md)

### Chapter 13: Design Patterns

1. [Singleton Pattern](/gocpp/chapter-13-design-patterns/singleton-pattern.md)
2. [Factory Pattern](/gocpp/chapter-13-design-patterns/factory-pattern.md)
3. [Proxy Pattern](/gocpp/chapter-13-design-patterns/proxy-pattern.md)
4. [Decorator Pattern](/gocpp/chapter-13-design-patterns/decorator-pattern.md)
5. [Adapter Pattern](/gocpp/chapter-13-design-patterns/adapter-pattern.md)
6. [Observer Pattern](/gocpp/chapter-13-design-patterns/observer-pattern.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://navining.gitbook.io/gocpp/master.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
