Re: find difference between two struct instances.

2017-07-21 Thread FoxyBrown via Digitalmars-d-learn
On Saturday, 22 July 2017 at 01:04:48 UTC, Nicholas Wilson wrote: On Friday, 21 July 2017 at 23:38:51 UTC, FoxyBrown wrote: [...] use opCmp in conjunction with __traits(allMembers,T) struct Example { int a,b,c; string d,e,f; } void difference(alias func, T)(T t1, T t2)

Re: find difference between two struct instances.

2017-07-21 Thread Nicholas Wilson via Digitalmars-d-learn
On Friday, 21 July 2017 at 23:38:51 UTC, FoxyBrown wrote: On Friday, 21 July 2017 at 22:35:20 UTC, Era Scarecrow wrote: On Friday, 21 July 2017 at 21:03:22 UTC, FoxyBrown wrote: Is there a way to easily find the differences between to struct instances? I would like to report only the

Re: find difference between two struct instances.

2017-07-21 Thread FoxyBrown via Digitalmars-d-learn
On Friday, 21 July 2017 at 22:35:20 UTC, Era Scarecrow wrote: On Friday, 21 July 2017 at 21:03:22 UTC, FoxyBrown wrote: Is there a way to easily find the differences between to struct instances? I would like to report only the differences e.g., writeln(s1 - s2); prints only what is

Re: find difference between two struct instances.

2017-07-21 Thread Era Scarecrow via Digitalmars-d-learn
On Friday, 21 July 2017 at 21:03:22 UTC, FoxyBrown wrote: Is there a way to easily find the differences between to struct instances? I would like to report only the differences e.g., writeln(s1 - s2); prints only what is different between s1 and s2. This is entirely dependent on the

find difference between two struct instances.

2017-07-21 Thread FoxyBrown via Digitalmars-d-learn
Is there a way to easily find the differences between to struct instances? I would like to report only the differences e.g., writeln(s1 - s2); prints only what is different between s1 and s2.