Re: Access Violation in @safe Code

2016-01-30 Thread Matt Elkins via Digitalmars-d-learn
On Saturday, 30 January 2016 at 13:37:43 UTC, Kagamin wrote: Alias templates require stack pointer, init probably has it set to null. Try this: FooType foo = FooType(); Yes, that fixed it. Interesting.

Re: Access Violation in @safe Code

2016-01-30 Thread Kagamin via Digitalmars-d-learn
Alias templates require stack pointer, init probably has it set to null. Try this: FooType foo = FooType();

Re: Access Violation in @safe Code

2016-01-29 Thread Matt Elkins via Digitalmars-d-learn
On Saturday, 30 January 2016 at 05:18:08 UTC, Steven Schveighoffer wrote: https://issues.dlang.org/enter_bug.cgi -Steve Added! https://issues.dlang.org/show_bug.cgi?id=15627 Thanks for the help.

Re: Access Violation in @safe Code

2016-01-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 1/29/16 11:53 PM, Matt Elkins wrote: Title says it; I get an access violation in code marked @safe. Here's a minimal example: [code] @safe: struct Foo(alias Callback) { ~this() {Callback();} } unittest { uint stackVar; alias FooType = Foo!((){++stackVar;}); FooType[1] f

Access Violation in @safe Code

2016-01-29 Thread Matt Elkins via Digitalmars-d-learn
Title says it; I get an access violation in code marked @safe. Here's a minimal example: [code] @safe: struct Foo(alias Callback) { ~this() {Callback();} } unittest { uint stackVar; alias FooType = Foo!((){++stackVar;}); FooType[1] foos; foos[0] = FooType.init; } [/code]