Hi everyone,
is there anyway to do this with operators overloading? :
class Tester
{
double x = 0.0;
double opBinary(string op:+)(double value)
{
return x+value;
}
Tester opBinary(string op:+)(Tester other)
{
Dan wrote:
Hi everyone,
is there anyway to do this with operators overloading? :
class Tester
{
double x = 0.0;
double opBinary(string op:+)(double value)
{
return x+value;
}
Tester opBinary(string op:+)(Tester other)
{
On 02/05/10 07:14, Dan wrote:
Hi everyone,
is there anyway to do this with operators overloading? :
The following code does it:
class Tester
{
double x = 0.0;
T opBinary(string op:+, T)(T value) if(is(T : double))
{
return x+value;
}