c++ - EX_BAD_ACCESS when calling vector.empty() -
i'm getting ex_bad_access
when calling vector.empty
on empty vector.
bool empty = elements.empty();
its throwing exception here;
/** * returns read-only (constant) iterator points 1 past * last element in %vector. iteration done in * ordinary element order. */ const_iterator end() const { return const_iterator(this->_m_impl._m_finish); } // exception
when calling;
/** * returns true if %vector empty. (thus begin() * equal end().) */ bool empty() const { return begin() == end(); } // exception
the reason elements
invalid object @ point. should never exception valid vector object.
Comments
Post a Comment