Uh... destructors?
Steven Schveighoffer
schveiguy at yahoo.com
Wed Mar 9 05:32:29 PST 2011
On Tue, 08 Mar 2011 18:33:31 -0500, Bruno Medeiros
<brunodomedeiros+spam at com.gmail> wrote:
> I'm not saying all pointer arithmetic and manipulation should be
> illegal. It could be allowed, but only so long as the coder maintains
> the contract of the pure attribute. So this means that you could use
> pointers to manipulate whatever is transitively reachable from the
> function parameters (or stuff that was created inside the pure
> function), but the rest should not be accessed through pointer
> arithmetic, precisely because the compiler would not be able to
> determine that from the function signature.
> Note that when I said "illegal" I didn't necessarily mean compiler
> verified illegal code. That might be too complex to implement in the
> language, so instead it might just be a unchecked contract. Breaking
> that contract would result in /undefined behavior/.
Then I think we are saying the same thing :)
-Steve
More information about the Digitalmars-d
mailing list