I have a question about template friend functions. Is the declaration in the Stack class correct? It compiles in 2 different compilers, so I guess its correct but what does the '<>' operator mean in this context? its not a template specialization but what is it?
Code:template <typename T, unsigned int N> class Stack { public: friend ostream &operator<< <>(ostream &os, const Stack<T, N> &s); private: T m_stack[N]; }; template<typename T, unsigned int N> ostream &operator<<(ostream &os, const Stack<T, N> &s) { if (!s.empty()) { T *cur = s.m_cur; while (cur != s.m_stack) { os << *--cur << ' '; } } return os; }



LinkBack URL
About LinkBacks




stream& operator<<(std:
CornedBee