正在加载图片...
Throwing an exception(cont class iterator overflow publIc iterator overflow(int index, int max) m index(index), m max(max)i int index(f return m index; 1 int max(f return m max; j void what happened( ostream& os=cerr) os<<“ Internal error: current index”<< m index <"exceeds the maximum bound: '7<<m max private Int m index, m maxThrowing an exception (cont.) class iterator_overflow { public: iterator_overflow(int index, int max) : m_index(index), m_max(max) {}; int index() { return m_index; } int max() { return m_max; } void what_happened(ostream& os = cerr) { os << “Internal error: current index” << m_index << “exceeds the maximum bound: ” << m_max; } private: int m_index, m_max; }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有