STL
qq_24003917
这个作者很懒,什么都没留下…
展开
-
C++中typename关键字的使用方法和注意事项
起因近日,看到这样一行代码:typedef typename __type_traits<T>::has_trivial_destructor trivial_destructor;虽说已经有多年C++经验,但上面这短短一行代码却看得我头皮发麻。看起来它应该是定义一个类型别名,但是typedef不应该是像这样使用么,typedef+原类型名+新类型名:typede...转载 2019-10-31 11:18:58 · 439 阅读 · 0 评论 -
C++中的new、operator new与placement new
1、C++中的new/delete与operator new/operator delete new operator/delete operator就是new和delete操作符,而operator new/operator delete是函数。 new operator (1)调用operator new分配足够的空间,并调用相关对象的构造函数 ...转载 2019-10-29 20:31:24 · 138 阅读 · 0 评论