C++ Modern Coding Guide
簡介
RAII
Smart Pointer
Mutex & Lock
IO
Thread
Legacy C code
Constructors, Assignments, and Destructors
Function
OOP
其他
Named Cast
auto
使用 {} 初始化物件
使用 nullptr 取代 NULL
使用 using 取代 typedef
Enum
namespace AA::BB
在 if 或 switch 定義參數
std::filesystem
使用 std::array 取代 T[]
傳統 C 的迷思
不要:使用goto end來釋放資源
不要:不使用 exception
不要:宣告所有變數在 function 開頭
Powered by
GitBook
簡介
read this article on GitBook
C++ Modern Coding Guide
目的
介紹 C++11/14/17 新的觀念或是技巧
在 C++ 不應該繼續使用的 legacy C 觀念
這裡所有的範例都可以在 C++14 使用,少部分需要 C++17
Reference (按照建議排序)
C++ Core Guidelines
Effective Modern C++
Effective C++
results matching "
"
No results matching "
"