[Issue 14125] std.file has gotten out of hand

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Wed Feb 4 15:57:04 PST 2015


https://issues.dlang.org/show_bug.cgi?id=14125

--- Comment #7 from Andrei Alexandrescu <andrei at erdani.com> ---
(In reply to Orvid King from comment #4)
> I would actually argue that the way it's implemented currently is better
> than what you're suggesting.
> If I'm understanding correctly, you want std.file.read to be @trusted rather
> than @safe.

Correct.

> The way it's implemented currently limits the amount of code in the @trusted
> section significantly, and the rest is in the @safe version. This is done so
> that the only parts of the method that need to be @trusted are in @trusted
> blocks.

I understand the intent. The moment I need to define dung like:

    static trustedRef(T)(ref T buf) @trusted
    {
        return &buf;
    }

I know there's a problem with the application of the idiom.

--


More information about the Digitalmars-d-bugs mailing list