Modern C++

Modern C++, I'm coming...

cpp_logo.png

C++是对象视角,变量只是一个有名称的对象。因此,对象也像C语言的automatic variable一样,在作用域之外,立即被清理(非new动态对象,自动调用destructor释放资源)。

C++复杂和让人迷惑的地方,在于通过对象管理资源。所谓面向对象编程,OOP,大部分时间是在设计和实现各种对象(type)。

template的种类很多:class, function, type alias, variable。

main之前,全局对象执行constructor,main之后,全局对象执行destrcutor!

-- 目录[0] --

-- 文章[52] --