Stories About C++ | Your Journey from Beginner to Advanced | Deep Dive into Modern C++
- Stories About C++
Thank you for your support of Stories About C++. The content is also available on Bilibili in video format for easier learning. Welcome to star, share, and submit PRs.
Online Personal Blog: Light City Lab
Online Learning Site: Stories About C++
- Chinese Name: C++ 那些事
- English Name: Stories About C Plus Plus
This repository is designed for beginners to advance from entry level to mastery. It addresses the needs of interviewees and learners who want to deeply understand C++ and get started with C++. Beyond the fundamentals, this repository also covers more advanced topics such as in-depth source code analysis and multi-threaded concurrency. It is a comprehensive C++ learning resource, from beginner to advanced improvement.
🎯 Target Audience: C++ beginners, interview candidates, developers wanting to systematically learn Modern C++ 📚 Content Covered: C++11/14/17/20 new features, STL source code analysis, design patterns, concurrency programming 🔧 Practice-Oriented: Complete code examples and practical projects included
A series of featured projects have been launched to guide you through practical C++ learning. Combined with this open-source project, you'll grow rapidly!
Direct Link: Click Here
The WeChat Official Account has opened two major entry points: albums and menus. You can directly read Stories About C++ content on WeChat, paired with the code in this repository for an excellent experience. We recommend following us.
Personal WeChat Official Account: guangcity
Or scan the QR code below. We welcome your feedback and C++ discussions. I have created a C++ Stories exchange group on WeChat, a high-quality C++ resource exchange area. Please follow the above official account, click the bottom right corner → Contact Me, and I'll add you to the group.
Follow Me
If you find this helpful, follow me~
![]() Planet |
![]() WeChat Official Account |
|---|
A Docker environment without development setup is now available. You can pull the following image:
docker pull xingfranics/cplusplusthings:latest
Episode 1: Step By Step Compiling This Project
Episode 2: Docker Environment Without Setup
Episode 3: Reading HashTable Together, Thoroughly Understanding C++ STL
Episode 4: Reading STL enable_shared_from_this Together
Episode 5: Reading STL Threads Together, From C++11 thread to C++20 jthread
Episode 6: Reading STL condition_variable, condition_variable_any Together
Episode 7: Reading STL Mutex Together
Episode 8: Reading STL RAII Lock Together
Internet Big Company Interview Records
Essential Interview Guide for Landing Offers
- Stories About
const - Stories About
static - Stories About
this - Stories About
inline - Stories About
sizeof - Stories About Function Pointers
- Stories About Pure Virtual Functions and Abstract Classes
- Stories About
vptr_vtable - Stories About
virtual - Stories About
volatile - Stories About
assert - Stories About Bit Fields
- Stories About
extern - Stories About
struct - Stories About
structandclass - Stories About
union - Stories About Implementing C++ Polymorphism in C
- Stories About
explicit - Stories About
friend - Stories About
using - Stories About
:: - Stories About
enum - Stories About
decltype - Stories About References and Pointers
- Stories About Macros
C++2.0 is a shorthand for "Modern C++", including C++11/14/17/20.
-
Spaces in Template Expressions
vector<list<int> > // ok in each C++ version vector<list<int>> // before C++11 error: '>>' should be '> >' within a nested template argument list, compiles normally from C++11 onwards
-
for(decl:col) { statement } -
If you define a
ctoryourself, the compiler won't provide adefault ctor. If you force add=default, you can regain and use thedefault ctor. -
Alias (化名) Template (template typedef)
-
Container Structure and Classification
- (1) Sequential containers include:
array(new in C++2.0),vector,deque,list,forward_list(new in C++2.0) - (2) Associative containers include:
set/multiset,map/multimap - (3) Unordered containers (new in C++2.0, replacing
hash_xxxwithunordered_xxx) include:unordered_map/unordered_multimap,unordered_set/unordered_multiset
- (1) Sequential containers include:
-
Learning Material: https://www.bilibili.com/video/av51863195?from=search&seid=3610634846288253061
To be updated...
STL Source Code Analysis: gcc 4.9.1
- array
- deque
- queue and stack
- list
- vector
- typename
- traits
- iterator
- Discussion on STL Design - EBO Optimization
- rb_tree
- set and multiset
- map and multimap
- hashtable
- myhashtable
- unordered_map
Learning Material: https://downdemo.gitbook.io/cpp-concurrency-in-action-2ed/
Source:
https://www.youtube.com/watch?v=eZ8yKZo-PGw&list=PLk6CEY9XxSIAeK-EAh3hB4fgNvYkYmghp&index=4
- 1. Class Initializers
- 2. Replace Enum with Namespace
- 3. RAII (Resource Acquisition Is Initialization)
- 4. copy and swap
- 5. pImpl (Pointer to Implementation)
- Heap, Stack, RAII: How to Manage Resources in C++?
- Implementing C++ Smart Pointers
- What Problem Do Rvalue References and Move Solve?
- Containers 1
- Containers 2
- Exceptions
- Literals, Static Assertions, and Member Function Specifiers
- Should We Return Objects?
- Compile-Time Polymorphism: Generic Programming and Template Introduction
- What Can Be Done at Compile Time? A Complete Computing World
- SFINAE: What Does "Substitution Failure Is Not An Error" Mean?
- constexpr: A Constant World
- Function Objects and Lambda: Entering Functional Programming
- Memory Model and Atomic: Understanding the Complexity of Concurrency
Modified code, Click here for the code
Input:
map<int, int> mp{
{1, 1},
{2, 4},
{3, 9}};
cout << mp << endl;Output:
{ 1 => 1, 2 => 4, 3 => 9 }

