how to use the origin new operator after override it

P

Pierric

Hi everyone:
recently I find a bug in my application, it's because I have override
the operator new. So now I want to use the origin one in only some part
of the codes.
Is there a way to do it, without disabling the overriding ?

Thank you.
 
F

Frederick Gotham

Pierric posted:
Hi everyone:
recently I find a bug in my application, it's because I have override
the operator new. So now I want to use the origin one in only some part
of the codes.
Is there a way to do it, without disabling the overriding ?


Stick two colons before it.

::new


(PS. The adjective of "origin" is "original")
 
J

Jens Theisen

Frederick said:
Stick two colons before it.

::new

I suppose he overrode the global new, in which case, from the language
points of view, there is only his implementation and the other one is
gone. I think this is usually implemented by a weak symbol you're
overwriting with a strong one, but I don't really know.

That makes his problem more difficult I think.

Jens
 
P

Pierric

I'm truely sorry for my poor english. :)

Yes, i have overrode the global new like this:
void* operator new(size_t size)
{}

:: just mean calling the gobal one, and now it is overrode.Does that
mean the original one can never be find back again?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,438
Messages
2,571,699
Members
48,796
Latest member
Greg L.
Top