Z
Zoran Stipanicev
Hi!
I've changed the code to use Apply instead of operator() and now I get
this errors:
(1) left of '.Apply' must have class/struct/union
(2) left of '.GetRowNum' must have class/struct/union
(3) 'return' : cannot convert from
'Expression<Lhs,Rhs>' to 'Expression<Lhs,Rhs>'
Cannot copy construct struct 'Expression<Lhs,Rhs>' due to
ambiguous copy constructors or no available copy constructor
public interface class IExpression
{
public:
typedef System::Single tip;
virtual tip Apply(int r, int c);
virtual int GetRowNum();
};
generic <class Lhs, class Rhs>
where Lhs:IExpresion
where Rhs:IExpresion
ref struct Expression : public IExpresion
{
typedef float tip;
Expression( Lhs% lhs, Rhs% rhs)
: l_(lhs), r_(rhs)
{
}
virtual tip Apply (int r, int c)
{
(1) return l_.Apply(r, c) + r_.Apply(r, c);
}
virtual int GetRowNum()
{
(2) return l_.GetRowNum();
}
private:
Lhs l_;
Rhs r_;
}
generic <class Lhs, class Rhs>
where Lhs:IExpression
where Rhs:IExpression
Expression<Lhs, Rhs> operator +(Lhs% lhs, Rhs% rhs)
{
(3) return Expression<Lhs, Rhs>(lhs, rhs);
}
I've changed the code to use Apply instead of operator() and now I get
this errors:
(1) left of '.Apply' must have class/struct/union
(2) left of '.GetRowNum' must have class/struct/union
(3) 'return' : cannot convert from
'Expression<Lhs,Rhs>' to 'Expression<Lhs,Rhs>'
Cannot copy construct struct 'Expression<Lhs,Rhs>' due to
ambiguous copy constructors or no available copy constructor
public interface class IExpression
{
public:
typedef System::Single tip;
virtual tip Apply(int r, int c);
virtual int GetRowNum();
};
generic <class Lhs, class Rhs>
where Lhs:IExpresion
where Rhs:IExpresion
ref struct Expression : public IExpresion
{
typedef float tip;
Expression( Lhs% lhs, Rhs% rhs)
: l_(lhs), r_(rhs)
{
}
virtual tip Apply (int r, int c)
{
(1) return l_.Apply(r, c) + r_.Apply(r, c);
}
virtual int GetRowNum()
{
(2) return l_.GetRowNum();
}
private:
Lhs l_;
Rhs r_;
}
generic <class Lhs, class Rhs>
where Lhs:IExpression
where Rhs:IExpression
Expression<Lhs, Rhs> operator +(Lhs% lhs, Rhs% rhs)
{
(3) return Expression<Lhs, Rhs>(lhs, rhs);
}