The project aims to explore modern language features, standard library, design pattern, and memory management capabilities in C++. It's crucial to comprehend how black magic works. The C++ programming language keeps improving.
C++ 11, C++ 14, C++ 17, and C++ 20 are used usually.
In ubuntu,I use the vscode to mkbuild
, cmake
, compile
, run
, rmbuild
and clean
the project.
I write the tasks.json
and launch.json
files to use easily the project.
command + shift + B # select "compile" or "run" or "cmake" or "mkbuild" tasks.json
Then select the following options:
- mkbuild. It will build directory for the compile and run.
- cmake. It will issue the Makefile.
- compile. It will build the project.
- run. It will run the some executable file in tasks.json.
- rmbuild. It can help you to delete the build file, which can re-generate the build files.
- clean. It can help clean the executable file of build directory.
F5 # debug launch.json
If you may add the different cpp files, you should add executable file in CMakeLists.txt
.
- 01
final
andoverride
Document Code - 02 lambda and functor Document Code
- 03
typdef
,typename
andusing
Document Code - 04
enum
Document Code - 05
auto
,decltype
and deducing types Document Code - 06 initializer list and uniform initialization Document Code
- 07 Covariant Return Types Document
- 08
explicit
Code - 09 Rule of Five Document Code
- 10 How to write special member functions correctly in modern C++
- 11
inline
Document Code Code Code - 12
nullptr
, 0, andNULL
Document Code - 13 From variadic templates to Fold Expression: An Template Recursive Techniques Document Code
- 14 Default Initializers for Member Variables and POD Document Code
- 15 Return Value Optimization cppreference Document Code
- SL1 std::optional Document Document Code
- SL2 std::bind and std::function bind everythings Code
- SL3 hash
- SL4 Allocator
- SL5 std::any Document Code
- SL6 std::variant and union Document
- SL7 std::string Code
- SL8 std::invoke call everythings Code
- DP1 ScopeGuard and RAII ScopeGuard Code RAII Code
- DP2 CRTP and
virtual clone
virtual constructor design idiom Code1 Code2 - DP3 PImpl Document Code1 Code2
- DP4 Template Method Document Code1 Code2 Code3
- DP5 Strategy design pattern and Policy-based idiom Code1 Code2 Code3 Code4
- DP6 Observer Design Pattern Code
- DP7 Factory Design Pattern
- DP8 SFINAE Code
- MM1 class memory layout imgs1 imgs2 Code
- MM2 object layout and EBCO Code
- MM3 virtual function layout
- MM4 smart pointer Document unique_ptr shared_ptr Nest Smart Pointer
- MM5 move semantics
- TT1 Template Specialization Code
Please open pull requests if you want to add new features.
- https://arne-mertz.de/category/cpp/modern-cpp/
- Effective Modern C++, by Scott Meyers
- C++ Crash Course: A Fast-Paced Introduction, by Josh Lospinoso
- C++ Template: The Completion Guide (2nd), by David Vandevoorde
- C++ Concurrency in Action (2nd). by Anthony Williams
- C++ core guidelines https://isocpp.github.io/CppCoreGuidelines/CppCoreGuidelines