Le 2010-11-13 à 20:54, Don Clugston a écrit :

> That's not a bug in the spec. That's a bug in the compiler -- that
> shouldn't compile. Please change it to @trusted.

@trusted should make it compile, but that doesn't mean it is appropriate to 
make assumeUnique @trusted.

A trusted function should safely encapsulate the unsafe state, but assumeUnique 
is just a shortcut for a cast and it leaks the potentially unsafe state to the 
caller. There's nothing you can trust in assumeUnique, it's the caller that 
must be trusted to do the right thing. Thus, the caller should be the one 
marked @trusted.

-- 
Michel Fortin
[email protected]
http://michelf.com/



_______________________________________________
phobos mailing list
[email protected]
http://lists.puremagic.com/mailman/listinfo/phobos

Reply via email to