My goal is to be able to overload the ++ operator transparently to the
code, but I can't.
import std.stdio;
struct Arc {
int I = 0;
// This is void, but the error appears under all return types
void opUnary(string op)() if( op == ++ ) {
++I;
}
}
struct HasArc {
Arc
On 02/08/2012 10:48 PM, Zach the Mystic wrote:
My goal is to be able to overload the ++ operator transparently to the
code, but I can't.
import std.stdio;
struct Arc {
int I = 0;
// This is void, but the error appears under all return types
void opUnary(string op)() if( op == ++ ) {
++I;
}
}