Re: Array of struct pointers error

2014-02-26 Thread Szymon Gatner
On Wednesday, 26 February 2014 at 11:21:37 UTC, bearophile wrote: Szymon Gatner: That would be just it: import dchip.all; void main() { cpBody* bodies[]; auto b = cpBodyNew(0, 0); bodies ~= b; } where dchip is pulled using dub. As described earlier, wrapping cpBody* in another struct or

Re: Array of struct pointers error

2014-02-26 Thread Szymon Gatner
On Wednesday, 26 February 2014 at 11:22:00 UTC, Tobias Pankrath wrote: On Wednesday, 26 February 2014 at 11:07:44 UTC, Szymon Gatner wrote: On Wednesday, 26 February 2014 at 10:59:39 UTC, bearophile wrote: Szymon Gatner: I want to keep a list of pointers-to-C-struct but this line: Please re

Re: Array of struct pointers error

2014-02-26 Thread bearophile
Szymon Gatner: That would be just it: import dchip.all; void main() { cpBody* bodies[]; auto b = cpBodyNew(0, 0); bodies ~= b; } where dchip is pulled using dub. As described earlier, wrapping cpBody* in another struct or Tuple works. Now you have to remove all imports from the code

Re: Array of struct pointers error

2014-02-26 Thread Tobias Pankrath
On Wednesday, 26 February 2014 at 11:07:44 UTC, Szymon Gatner wrote: On Wednesday, 26 February 2014 at 10:59:39 UTC, bearophile wrote: Szymon Gatner: I want to keep a list of pointers-to-C-struct but this line: Please reduce your code as much as possible, and show the whole compilable reduc

Re: Array of struct pointers error

2014-02-26 Thread Szymon Gatner
On Wednesday, 26 February 2014 at 10:59:39 UTC, bearophile wrote: Szymon Gatner: I want to keep a list of pointers-to-C-struct but this line: Please reduce your code as much as possible, and show the whole compilable reduced buggy program here. Bye, bearophile That would be just it: imp

Re: Array of struct pointers error

2014-02-26 Thread bearophile
Szymon Gatner: Is there a different array declaration syntax for pointers? There is not. But the D-style syntax is preferred for arrays. Bye, bearophile

Re: Array of struct pointers error

2014-02-26 Thread bearophile
Szymon Gatner: I want to keep a list of pointers-to-C-struct but this line: Please reduce your code as much as possible, and show the whole compilable reduced buggy program here. Bye, bearophile

Re: Array of struct pointers error

2014-02-26 Thread Szymon Gatner
On Wednesday, 26 February 2014 at 10:01:53 UTC, Tobias Pankrath wrote: On Wednesday, 26 February 2014 at 09:56:39 UTC, Szymon Gatner wrote: I want to keep a list of pointers-to-C-struct but this line: cpBody* cpBodies_[]; which I use as a workaround. I am using DMD 2.065. cpBody*[] cpBodies;

Re: Array of struct pointers error

2014-02-26 Thread Tobias Pankrath
On Wednesday, 26 February 2014 at 09:56:39 UTC, Szymon Gatner wrote: I want to keep a list of pointers-to-C-struct but this line: cpBody* cpBodies_[]; which I use as a workaround. I am using DMD 2.065. cpBody*[] cpBodies;