摘要:
常规的new是分配内存,然后调用相应的构造函数,而定位new是在已经分配内存的上面调用构造函数: // ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace st 阅读全文
摘要:
// ConsoleApplication7.cpp : 定义控制台应用程序的入口点。 #include "stdafx.h" #include<iostream> using namespace std; class myallocator { public: void* allocate(siz 阅读全文