On Monday, 1 July 2013 at 23:36:27 UTC, John wrote:
struct Mass(T, S) {
        ...
        
        Mass!(T,S) opAdd(Mass!(T,S) other) {

You can't overload non-templates with templates, yet. It's supposed to work, but not implemented. The workaround is simple enough:

Mass!(T,S) opAdd()(Mass!(T,S) other) { // note the () after opAdd

                return op!"+"(other);
        }
        
Mass!(O,S) opAdd(O)(Mass!(O,S) other) if (typeof(O) != typeof(T)) {

That constraint should be: if (!is(O == T))

                return op!"+"(other);
        }
...
}

Reply via email to