Mail Archives: djgpp/1998/04/01/09:45:45
Nate Eldredge wrote:
>
> At 10:26 3/29/1998 -0800, Charles Terry wrote:
> >Michael Krause wrote:
> >>
> >> Is there anyway to get the new operator to throw a bad_alloc exception
> >> instead of just returning zero?
> >>
> >> Mike Krause
> >> mhkrause AT umich DOT edu
> >yes but you will have to download the source code and
> >modify the new function and recompile.
>
> I don't think that's necessary, is it? My C++ knowledge is minimal, but I'm
> pretty sure one of its major features is the ability to define your own
> versions of operators. This can be done without tampering at all with the
> library sources.
>
> Nate Eldredge
> eldredge AT ap DOT net
Yea that is how it works, I think SET also pointed that out.
I do use c++ a bit but never had occasion to overload the standard
operators- just class operators. But my impression was that to
overload it had to be datatype::new(sizeof(datatype)).
In otherwords the operator overloaded for a specific type.
I agree recompileing the library is not neccesary but
I'd still look at the library code to make sure I wasn't missing
anything that could (and probably would) come back to haunt me.
Charles
- Raw text -