@trust is an encapsulation method, not an escape

via Digitalmars-d digitalmars-d at puremagic.com
Fri Feb 6 00:51:11 PST 2015


On Friday, 6 February 2015 at 05:32:48 UTC, Walter Bright wrote:
> Good point. Then a constraint can be added to the function 
> signature that T is copyable.
>
> D's type system is strong enough for that.

Yes, if you remember to add it.  The ideal would be to have the 
default constrained to proper value-types. D inherits some of C's 
weaker typing properties by trying to stay Cish to the programmer.

The fact that so many messages has been posted to this thread 
before someone caught it is testament to the burden put upon 
reviewers with "@trusted". After all, in debate-like threads like 
this people will look with higher scrutiny at posted code than in 
an average review...


More information about the Digitalmars-d mailing list