Error using templates: "cannot use template to add field to aggregate ''"

2016-01-25 Thread pineapple via Digitalmars-d-learn
I'm getting several of these since I'm trying to do the same thing in a few places. Here's a complete error: path\to\file.d(55): Error: variable units.unitvalue.opmethod!("sum(in unitvalue value)", "add(value)").methodtemplate cannot use template to add field to aggregate 'unitvalue'

Re: Error using templates: "cannot use template to add field to aggregate ''"

2016-01-25 Thread pineapple via Digitalmars-d-learn
Thanks so much for the help! I'm still getting used to D's compile-time code.

Re: Error using templates: "cannot use template to add field to aggregate ''"

2016-01-25 Thread anonymous via Digitalmars-d-learn
On 25.01.2016 15:51, pineapple wrote: class unitvalue{ double coefficient; int[unit] exponents; unitvalue copy(){ unitvalue value = new unitvalue(); value.coefficient = this.coefficient; value.exponents = this.exponents.dup; return value;

Re: Error using templates: "cannot use template to add field to aggregate ''"

2016-01-25 Thread Chris Wright via Digitalmars-d-learn
On Mon, 25 Jan 2016 14:51:21 +, pineapple wrote: > I'm getting several of these since I'm trying to do the same thing in a > few places. Here's a complete error: > > path\to\file.d(55): Error: variable > units.unitvalue.opmethod!("sum(in unitvalue value)", > "add(value)").methodtemplate