Re: Question about generation of template functions

2019-08-29 Thread Machine Code via Digitalmars-d-learn
That's right, thank you all guys. Found my mistake; should be: serialize!(typeof(field))(__traits(getMember, output, fieldName));

Re: Question about generation of template functions

2019-08-29 Thread Jesse Phillips via Digitalmars-d-learn
On Wednesday, 28 August 2019 at 20:56:25 UTC, Machine Code wrote: I was writing a recursive function that uses template, I thought it would generate the proper template function on the fly to match the type in the parameter but it seems to not so so and try to use the called function, resulting

Re: Question about generation of template functions

2019-08-28 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, August 28, 2019 2:56:25 PM MDT Machine Code via Digitalmars-d- learn wrote: > I was writing a recursive function that uses template, I thought > it would generate the proper template function on the fly to > match the type in the parameter but it seems to not so so and try > > to use

Question about generation of template functions

2019-08-28 Thread Machine Code via Digitalmars-d-learn
I was writing a recursive function that uses template, I thought it would generate the proper template function on the fly to match the type in the parameter but it seems to not so so and try to use the called function, resulting in the error: Error: function foo.serialize!(B).serialize(ref B