摘要: 常规的new是分配内存,然后调用相应的构造函数,而定位new是在已经分配内存的上面调用构造函数: // ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace st 阅读全文
posted @ 2020-08-23 19:09 sunshine_gzw 阅读(137) 评论(0) 推荐(0) 编辑
摘要: // ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace std; class myallocator { public: void* allocate(siz 阅读全文
posted @ 2020-08-23 19:00 sunshine_gzw 阅读(221) 评论(0) 推荐(0) 编辑