Topic: Void pointer question


Author: rfg@netcom.com (Ronald F. Guilmette)
Date: Mon, 1 Nov 1993 05:07:08 GMT
Raw View
In article <CFnxFu.Dut@cbnewse.cb.att.com> grumpy@cbnewse.cb.att.com (Paul J Lucas) writes:
>From article <4995@hpwala.wal.hp.com>, by pabloh@hpwala.wal.hp.com (Pablo Halpern ):
>> In article <rfgCFG15J.MKo@netcom.com>, rfg@netcom.com (Ronald F. Guilmette) writes:
>> |> Indeed, I (for one) would hold out some hope that the final standard will
>> |> actually MANDATE errors for any and all delete expressions whose operands
>> |> have type `void*'.
>>
>> I whole-heartedly agree.  This is not malloc() we're talking about.  delete
>> should only work on an object *of some type*.  With a void*, you can't even
>> call a virtual destructor!
>
> While I agree, regardless of what the standard says, just don't
> do it.  (Doctor, it huts when I do this.  So don't do that.)

Part of the point of using a "type safe" higher level language is that
compilers can often find your mistakes for you.  I'm not perfect, and
occasionally I write some code I should not have written.  Thankfully,
compilers often tell me when I've done that.

--

-- Ronald F. Guilmette, Sunnyvale, California -------------------------------
------ domain address: rfg@netcom.com ---------------------------------------
------ uucp address: ...!uunet!netcom.com!rfg -------------------------------