Simply, it should be replaced by:
void safeFunc() @safe {
unsafe {
auto vi = doUnsafeCall();
}
}
@trusted functions are prohibited by d-idiom (so I don't know why
are still in D).
So, when I need to create a simple window with OpenGL context I
need to write about 10-15 calls to
On Friday, 25 November 2016 at 10:14:46 UTC, Satoshi wrote:
Simply, it should be replaced by:
void safeFunc() @safe {
unsafe {
auto vi = doUnsafeCall();
}
}
@trusted functions are prohibited by d-idiom (so I don't know
why are still in D).
So, when I need to create a simple win
On Friday, 25 November 2016 at 10:14:46 UTC, Satoshi wrote:
but writing 20 times something like:
auto vi = (() @trusted => glXChooseXFBConfig(...))();
That's an anti-pattern and you should almost never actually do
it. That is breaking the trusted thing, and is not what the blog
means when it
On 11/25/16 5:14 AM, Satoshi wrote:
void safeFunc() @safe {
unsafe {
auto vi = doUnsafeCall();
}
}
How would this work for marking C functions assumed to be safe as
trusted? -- Andrei
On Friday, 25 November 2016 at 10:14:46 UTC, Satoshi wrote:
@trusted functions are prohibited by d-idiom (so I don't know
why are still in D).
Uh? No. I wonder where you've read this.
On Friday, 25 November 2016 at 15:01:43 UTC, Andrei Alexandrescu
wrote:
How would this work for marking C functions assumed to be safe
as trusted? -- Andrei
You'd presumably just mark the prototypes as @safe too.
On 11/25/16 5:14 AM, Satoshi wrote:
Simply, it should be replaced by:
void safeFunc() @safe {
unsafe {
auto vi = doUnsafeCall();
}
}
@trusted functions are prohibited by d-idiom (so I don't know why are
still in D).
No, they are not. @trusted escapes are for use when you can r
On 11/25/16 10:30 AM, Adam D. Ruppe wrote:
On Friday, 25 November 2016 at 15:01:43 UTC, Andrei Alexandrescu wrote:
How would this work for marking C functions assumed to be safe as
trusted? -- Andrei
You'd presumably just mark the prototypes as @safe too.
Hmmm... ok, that would work by means
On Friday, 25 November 2016 at 16:03:27 UTC, Andrei Alexandrescu
wrote:
Hmmm... ok, that would work by means of the convention "@safe +
no implementation really means trusted". Not too convenient I'd
say. -- andrei
It works today, though. The compiler will allow you to put @safe
with no body
On Friday, 25 November 2016 at 10:14:46 UTC, Satoshi wrote:
but writing 20 times something like:
auto vi = (() @trusted => glXChooseXFBConfig(...))();
or:
auto vi = () @trusted { return glXChooseXFBConfig(...); }();
Trusted blocks are used for safety inference in generic code, so
that only co
On Friday, 25 November 2016 at 16:03:27 UTC, Andrei Alexandrescu
wrote:
Hmmm... ok, that would work by means of the convention "@safe +
no implementation really means trusted". Not too convenient I'd
say.
@trusted means "@safe interface, @system implementation", so when
you have only interfac
11 matches
Mail list logo