c++ manipulator question
- by robert
i have a class:
template<class T>
class matrix
{
private:
int COLS,ROWS;
public:
inline matrix(int r,int c){
this->COLS=r;
this->ROWS=c;
}
template<class T2>
friend ostream& info(ostream& os);
};
i tried in so many ways to implement the info class.but none is succeed.
i want to use it in main function
Matrix<int> M(10,20);
cout<<info<<M;
i want to out put the Matrix class's cols, and rows information.
i have tried so many time in implementing the friend class info, but failed.
any one can tell me how can do it?