正在加载图片...
Throwing an exception(cont u midx may be set to certain value in constructor u Thus Iterator will have the potential danger that exceeds the allowed maximum size of static vector in Fibonacci u How to notify the user this exception? line void Fibonacci Iterator:check integrity if(m idx > Fibonacci m IMaxElems) throw iterator overflow(m idx, Fibonacci: m iMaxElems if(m idx >=FibonacciS elems size) Fibonacci gen elems(m idx 1)Throwing an exception (cont.) ◼ m_iIdx may be set to certain value in constructor ◼ Thus Iterator will have the potential danger that exceeds the allowed maximum size of static vector in Fibonacci ◼ How to notify the user this exception? inline void Fibonacci_Iterator::check_integrity() { if (m_iIdx >= Fibonacci::m_iMaxElems) throw iterator_overflow(m_iIdx, Fibonacci::m_iMaxElems); if (m_iIdx >= Fibonacci::s_elems.size()) Fibonacci::gen_elems(m_iIdx + 1); }
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有