Array of struct pointers error

Tobias Pankrath tobias at pankrath.net
Wed Feb 26 03:21:59 PST 2014


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 reduced buggy program here.
>>
>> Bye,
>> bearophile
>
> 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.

No offense: But an example should be reduced until we can compile 
it without additional code, excluding phobos and maybe dub'ed 
projects. But then you would need to provide a package.json.

I do think that's related to [1] and a bug with dmd 2.065. Does 
it work with 2.064?

[1] 
http://www.reddit.com/r/programming/comments/1ytfc5/d_2065_released_with_396_fixes_and_improvements/cfnmkih


More information about the Digitalmars-d-learn mailing list