cast(!const) proposal

James Dennett jdennett at acm.org
Sun Sep 9 14:25:58 PDT 2007


Janice Caron wrote:
>> It will also allow you to grep your or other peoples source for this
>> kind of cast, which is currently not possible at all in D, but is in C++.
> 
> Actually, it's not possible is C++, because even though you can grep
> for const_cast, you can't grep for the old-fashioned C way of casting,
> and that's still legal in C++.

But can be disallowed by coding conventions, and reported by
tools; working in a sensible subset that bans C-style casts,
and grepping is effective.

(I'm oversimplifying unfortunately, as C++ also has functional
style casts, which have the same semantics as C-style casts.)

> D would automatically become the winner.

;)

-- James



More information about the Digitalmars-d mailing list