Why is std.array litered with @trusted delegates?

Ex:

in the clear method in Appender.

void clear() @safe pure nothrow
{
   if(_data)
   {
      _data.arr = ()@trusted { return _data.arr.ptr[0 .. 0]; }();
   }
}

Is it to enable @safe? And should it be allowed i mean the code does deal with pointers so it really should be made @trusted? Or is the reasoning that as much of the standard library should be @safe as possible so some small hacks are ok?

Reply via email to