opAddAssign still works
Steven Schveighoffer
schveiguy at yahoo.com
Tue May 11 04:38:28 PDT 2010
On Mon, 10 May 2010 19:38:53 -0400, Trass3r <un at known.com> wrote:
> Yeah it still works for compatibility reasons but is deprecated.
Yeah, but should the old method override the new one?
I assumed one nice thing about "backwards compatibility" is you could do
something like this:
T opOpAssign(string op)(T other) if (op == "+=")
{
return opAddAssign(other);
}
But this function never gets called. I found out recently that template
functions are not allowed in interfaces, which makes it impossible to use
the new operator overloads on interfaces.
-Steve
More information about the Digitalmars-d-learn
mailing list