Z
Zoran Stipanicev
I'm trying to port simple expression template to generics but I
get some strange errors. The code is shown below and the errors are:
(1) 'l_' : is not a member of 'IExpresion'
(2) syntax error : '('
generic <class Lhs, class Rhs>
where Lhs:IExpresion
where Rhs:IExpresion
ref struct Expression : public DotNetMat::IExpresion
{
typedef float tip;
Expression( Lhs% lhs, Rhs% rhs)
: l_(lhs), r_(rhs)
{
}
virtual tip% operator () (int r, int c)
{
(2) return l_.(r, c) + r_.(r, c);
}
virtual int GetRowNum()
{
(1) return l_.GetRowNum();
}
private:
Lhs l_;
Rhs r_;
};
public interface class IExpresion
{
public:
typedef System::Single tip;
virtual tip% operator () (int r, int c);
virtual int GetRowNum();
};
Any ideas how to solve this problem?
Has anyone tried to this and can this be done?
Thx a lot!
Best regards,
Zoran Stipanicev.
get some strange errors. The code is shown below and the errors are:
(1) 'l_' : is not a member of 'IExpresion'
(2) syntax error : '('
generic <class Lhs, class Rhs>
where Lhs:IExpresion
where Rhs:IExpresion
ref struct Expression : public DotNetMat::IExpresion
{
typedef float tip;
Expression( Lhs% lhs, Rhs% rhs)
: l_(lhs), r_(rhs)
{
}
virtual tip% operator () (int r, int c)
{
(2) return l_.(r, c) + r_.(r, c);
}
virtual int GetRowNum()
{
(1) return l_.GetRowNum();
}
private:
Lhs l_;
Rhs r_;
};
public interface class IExpresion
{
public:
typedef System::Single tip;
virtual tip% operator () (int r, int c);
virtual int GetRowNum();
};
Any ideas how to solve this problem?
Has anyone tried to this and can this be done?
Thx a lot!
Best regards,
Zoran Stipanicev.