M
mente_fredda
Hi
I'm in trouble with operator new:
I have overloaded it to track allocated memory, but what I really need
is to get constructor argument.
/////////////CODE:
class myClass {
public:
myClass(int n) { p = new int[n];}:
~myClass() {delete []p;}
int* p;
void* operator new( size_t stAllocateBlock );
};
/////////////ENDCODE
Then I call my own operator new:
myClass* point = new myClass ( 10 );
What I want is to know constructor argument inside operator new.
Is it possible or it's just a dream?
please answer me. Thanks
I'm in trouble with operator new:
I have overloaded it to track allocated memory, but what I really need
is to get constructor argument.
/////////////CODE:
class myClass {
public:
myClass(int n) { p = new int[n];}:
~myClass() {delete []p;}
int* p;
void* operator new( size_t stAllocateBlock );
};
/////////////ENDCODE
Then I call my own operator new:
myClass* point = new myClass ( 10 );
What I want is to know constructor argument inside operator new.
Is it possible or it's just a dream?
please answer me. Thanks