cast(string) for mutable array

Vindex9 tech.vindex at gmail.com
Fri Jul 31 13:52:12 UTC 2026


Is this code normal? Why can't it be marked with `@safe`? Can 
only `idup` be used for `@safe` in such cases?

```d
string fn() @trusted pure {
     char[] arr;
     // some manipulations...
     return cast(string) arr;
}
```

Where is the line between cases where the `@trusted` tag can be 
used and cases where the `@system` tag can be used?


More information about the Digitalmars-d-learn mailing list