Original Post
is it possible to do something like this? //errors
#include <iostream>
using namespace std;
namespace MyNew{
void* operator new(size_t size){
cout << "Allocating : "<< size << " bytes/n";
void* p = ::operator new(size); //call global new op
return p;
}
}
int main()
{
int* i = MyNew::operator new int(); //call my new op
getchar();
}
Error 1 error C2440: 'initializing' : cannot convert from 'void *(__cdecl *)(size_t)' to 'int *'
Error 2 error C2144: syntax error : 'int' should be preceded by ';'