# cpp-notebook **Repository Path**: cpp-thinkmore/cpp-notebook ## Basic Information - **Project Name**: cpp-notebook - **Description**: cpp系列课程视频学习笔记 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-01-25 - **Last Updated**: 2026-01-25 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # C++ Notebook This is a C++ learning notebook project that covers the core features and advanced usage of modern C++. The project demonstrates various C++ concepts and techniques through numerous code examples, making it an excellent reference for learning C++. ## Project Features - **Comprehensive Content**: Covers multiple topics including templates, memory management, concurrency, STL, and more - **Example-Driven**: Each topic includes runnable code examples - **Progressive Learning**: Progresses from basic to advanced concepts step by step - **Chinese Comments**: Both code and documentation include Chinese annotations for easier understanding ## Directory Structure ``` cpp-notebook/ ├── alias/ # Alias Template ├── allocator/ # Memory Allocator ├── complex/ # Implementation of Complex Class and String Class ├── const_none_const/ # const and non-const Member Functions ├── cpp_memory_management/ # C++ Memory Management Mechanisms ├── decltype/ # decltype Usage ├── deque/ # deque Container Examples ├── for_each/ # STL Algorithm Examples ├── inherit/ # Inheritance Examples ├── lambda/ # Lambda Expressions ├── new_delete_reload/ # Overloading operator new/delete ├── new_handler/ # Out-of-Memory Handling ├── partial_spacialization/ # Partial Specialization ├── reference_wrapper/ # reference_wrapper Usage ├── reload_new_delete/ # Reloading new/delete ├── rvalue_reference/ # Rvalue References and Perfect Forwarding ├── template_method/ # Template Method Pattern ├── template_spacialization/ # Template Specialization ├── thread_conmunication/ # Thread Communication ├── trait/ # Type Traits and Iterators ├── tuple/ # tuple Implementation ├── variadic/ # Variadic Templates └── variadic_template/ # Variadic Template Examples ``` ## Main Content ### Templates - **Template Specialization**: Specializing function and class templates - **Partial Specialization**: Partially specializing for pointer types - **Variadic Templates**: Expanding parameter packs using variadic templates - **Alias Templates**: Defining type aliases using `using` ### Memory Management - **Memory Management Mechanisms**: Deep understanding of `new` and `delete` - **Class-Specific Allocators**: Custom memory allocation strategies for specific classes - **Global/Class Overloading**: Overloading global or class-specific `operator new/delete` - **Placement New**: Using placement `new` expressions ### Concurrent Programming - **Thread Examples**: Basic thread creation and usage - **Asynchronous Operations**: Usage of `std::async` - **Exception Handling**: Exception propagation within threads ### Practical Features - **Lambda Expressions**: Anonymous functions and capture mechanisms - **Rvalue References**: Move semantics and perfect forwarding - **decltype**: Type deduction - **tuple**: Implementation and usage of tuples - **reference_wrapper**: Reference wrapper ## Compilation and Execution ### Environment Requirements - C++11 or higher compiler - CMake or Make build tools ### Compilation Examples Navigate to the respective directory and compile: ```bash # Enter the example directory cd alias g++ -std=c++11 -o main main.cpp ./main # Or use CMake mkdir build && cd build cmake .. make ``` ## Contribution Guidelines Contributions via Issues and Pull Requests are welcome. You can contribute by: - Adding more examples - Improving documentation - Fixing code bugs - Adding test cases ## License This project is licensed under the MIT License. See the LICENSE file for details. ## References - C++ Primer - Effective C++ - Effective Modern C++ - C++ Standard Library Documentation