Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- template <typename T> class Matrix;
- template <typename T> std::ostream& operator<<(
- std::ostream& ostr, const Matrix<T>& m);
- template <typename T>
- class Matrix {
- private:
- int _rank;
- friend std::ostream& operator<< <> (
- std::ostream& ostr, const Matrix& m );
- };
- template <typename T> std::ostream& operator<<(
- std::ostream& ostr, const Matrix<T>& m )
- {
- (void) m._rank; // test friendship
- return ostr;
- }
- void f(const Matrix<int>& m)
- {
- std::cout << m;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement