Re: null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
On Monday, 21 November 2016 at 10:25:17 UTC, Satoshi wrote: Hello, how can calling method on local struct throw "null this"? struct is initialized by .init and have default values. struct Foo { Bar bar; static struct Bar { float x, y, z; } Bar getBar() {

Re: null this

2016-11-21 Thread rikki cattermole via Digitalmars-d-learn
On 21/11/2016 11:25 PM, Satoshi wrote: Hello, how can calling method on local struct throw "null this"? struct is initialized by .init and have default values. struct Foo { Bar bar; static struct Bar { float x, y, z; } Bar getBar() { return bar; } } then Foo foo

Re: null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
cast(ulong)&foo but is not null. It won't work just in special cases what I cannot reproduce easily.

null this

2016-11-21 Thread Satoshi via Digitalmars-d-learn
Hello, how can calling method on local struct throw "null this"? struct is initialized by .init and have default values. struct Foo { Bar bar; static struct Bar { float x, y, z; } Bar getBar() { return bar; } } then Foo foo = Foo.init; auto b = foo.getBar(); // t

Re: "null this"

2013-12-09 Thread Mineko
On Monday, 9 December 2013 at 19:53:09 UTC, Adam D. Ruppe wrote: When you used the class, did you remember to new it? Unlike C++, "Io io;" in D would be null. You have to create it with "io = new Io();" You got me thinking in the right direction, turns out I was putting in a bad parameter at

Re: "null this"

2013-12-09 Thread Adam D. Ruppe
When you used the class, did you remember to new it? Unlike C++, "Io io;" in D would be null. You have to create it with "io = new Io();"

"null this"

2013-12-09 Thread Mineko
So, I was doing some coding to my IO.d, and came across the strangest error, I looked it up and tried some different asserts, which is why it shows up as something different from "null this" now, anyway here, I seriously can't figure this out, the code is here: http://pasteb

Re: task! with a static template method gives "null this"

2013-02-23 Thread Lee Braiden
On Sat, 23 Feb 2013 17:09:06 -0800, Ali Çehreli wrote: > The following is minimized code, which does not have any compilation > errors: > > [snip] > > You can replace my stub functions with your code to help identify the > problem. > > Ali Thanks Ali; much appreciated. -- Lee

Re: task! with a static template method gives "null this"

2013-02-23 Thread Ali Çehreli
On 02/23/2013 03:23 PM, Lee Braiden wrote: Hi all, I'm defining a template class with a static method, and adding a call to that to a taskpool. However, when I run it, I get a "null this" error from parallelism.d. Here's the minimised code: class Population(GeneT

task! with a static template method gives "null this"

2013-02-23 Thread Lee Braiden
Hi all, I'm defining a template class with a static method, and adding a call to that to a taskpool. However, when I run it, I get a "null this" error from parallelism.d. Here's the minimised code: class Population(GeneType) { alias Population!(GeneType) ThisT