TIP: Click on subject to list as thread! ANSI
echo: c_plusplus
to: BALOG PAL
from: CLIFF RHODES
date: 1997-08-28 17:00:00
subject: Overloading NEW & DELETE

--> Balog Pal wrote to Cliff Rhodes <--
BP> CR> If you are overloading the global new operator, you won't be
BP> CR> able to get the 'original' global new.
 
BP>Why? Overloading never removes an existing function.
new/delete are operators, not functions.
BP>You can define
BP>further new() functions that take different number and/or type of
BP>arguments, but you will still have the original new.
That's true, but it won't be what the system calls when you want the 
operator. The operator types have specific signatures.
If you overload the global new with a function of the correct 
signature, you lose access to the original new--it has been redefined.
Calling new inside your implementation, even with ::, just results in 
infinite recursion.
Cliff Rhodes
cliff.rhodes@juge.com
crhodes@flash.net
X CMPQwk 1.42 1692 X"Charms strike the sight, but merit wins the soul." - 
Alexander Pope
--- Maximus/2 3.01
---------------
* Origin: COMM Port OS/2 juge.com 204.89.247.1 (281) 980-9671 (1:106/2000)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.