C++Philosophy

Posted songyuc

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了C++Philosophy相关的知识,希望对你有一定的参考价值。

1. RAII: Resource Acquisition Is Initialization

RAII(网上翻译成 “资源获取即初始化”);

学习资料

关于RAII的示例讲解,请参考博文《C++中的RAII技术及典型应用》
关于RAII哲学的教程,请参考视频《Back to Basics: RAII in C++ - Andre Kostur - CppCon 2022》

RAII无法解决 Resource Loops 问题

2. STL-Container: better choice for pointers or reference

3. Type Erasure

Type Erasure的提出主要是为了解决实际场景中派生带来的一系列问题,具体的描述请观看视频《Breaking Dependencies: Type Erasure - A Design Analysis - Klaus Iglberger - CppCon 2021》
请参考博文《【C++】Type Erasure 学习笔记》

以上是关于C++Philosophy的主要内容,如果未能解决你的问题,请参考以下文章