http://d.puremagic.com/issues/show_bug.cgi?id=8185



--- Comment #46 from Steven Schveighoffer <schvei...@yahoo.com> 2012-06-04 
10:59:49 PDT ---
(In reply to comment #45)
> (In reply to comment #44)
> Still thinking about the rest of the proposal, but:
> 
> > […] or @trusted functions […]
> If a @trusted function accepts a pointer, it must _under no circumstances_
> access anything except for the pointer target, because it can be called from
> @safe code.

The point of @trusted is that it is treated as @safe, but can do unsafe things.
 At that point, you are telling the compiler that you know better than it does
that the code is safe.

The compiler is going to assume you did not access anything else beyond the
target, so you have to keep that in mind when writing a @trusted function that
accepts a pointer parameter.

Off the top of my head, I can't think of any valid usage of this, but it
doesn't mean we should necessarily put a restriction on @trusted functions. 
This is a systems language, and @trusted is a tool used to circumvent @safe-ty
when you know it is actually @safe.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to