Posts
![ClassIdioms](https://www.modernescpp.com/wp-content/uploads/2023/01/ClassIdioms.png)
Covariant Return Type
/
0 Comments
The Covariant Return Type of a member function allows an overriding member function to return a narrower…
![patterns](https://www.modernescpp.com/wp-content/uploads/2022/06/patterns.png)
The Proxy Pattern
The Proxy Pattern is probably the most influential design pattern for C++. The Proxy provides a placeholder…
![patterns](https://www.modernescpp.com/wp-content/uploads/2022/06/patterns.png)
The Bridge Pattern
The Bridge Pattern is a structural pattern. It decouples the interface from the implementation. In C++,…
![TimelineCpp20](https://www.modernescpp.com/wp-content/uploads/2017/02/TimelineCpp20.png)
Barriers and Atomic Smart Pointers in C++20
In my last post, I introduced latches in C++20. A latch enables its threads to wait until a counter becomes…
![relay race](https://www.modernescpp.com/wp-content/uploads/2017/12/relay-race.png)
C++ Core Guidelines: Passing Smart Pointers
Passing smart pointers is a critical topic that is seldom addressed. This ends with the C++ core guidelines…
![gold 513062 640](https://www.modernescpp.com/wp-content/uploads/2017/12/gold-513062_640.png)
C++ Core Guidelines: Rules for Smart Pointers
There were a lot of C++ experts who said that smart pointers were the essential feature of C++11. Today,…
![sharedPtr](https://www.modernescpp.com/wp-content/uploads/2016/12/sharedPtr.jpg)
Atomic Smart Pointers
C++20 will have atomic smart pointers. To be exact, we will get a std::atomic_shared_ptr and a std::atomic_weak_ptr.…
![weakPtr](https://www.modernescpp.com/wp-content/uploads/2016/12/weakPtr.png)
std::weak_ptr
std::unique_ptr models the concept of exclusive ownership, std::shared_ptr the concept of shared ownership.…
![enabledShared](https://www.modernescpp.com/wp-content/uploads/2016/12/enabledShared.png)
Specialities of std::shared_ptr
After I draw the big picture of a std::shared_ptr in the last post, I want to present two special aspects…
![sharedPtr](https://www.modernescpp.com/wp-content/uploads/2016/12/sharedPtr.jpg)
std::shared_ptr
std::shared_ptr's share the resource. The shared reference counter counts the number of owners. Copying…