templated lambda with {} cause GC

learnfirst1 learnfirst1 at gmail.com
Fri Aug 10 11:10:55 UTC 2018


On Friday, 10 August 2018 at 10:38:53 UTC, Simen Kjærås wrote:
> What you should do instead is:
>     T!((t){
>             printf("test 2 name = %s\n".ptr, t.name.ptr);
>         }, "test");
>
> (note the lack of the => arrow)
>
> --
>   Simen


rikki cattermole , Paul Backus, Simen Kjærås: thanks for the 
explain, it work.


Still,  if my first example is use GC, why dmd not throw error at 
compile time, instead at link time report symbols is missing.   
Is this a bug ?



More information about the Digitalmars-d-learn mailing list