空のベクターEX_BAD_ACCESS
を呼び出すと、エラーが発生します。vector.empty
bool empty = elements.empty();
ここで例外をスローします。
/**
* Returns a read-only (constant) iterator that points one past
* the last element in the %vector. Iteration is done in
* ordinary element order.
*/
const_iterator
end() const
{ return const_iterator(this->_M_impl._M_finish); } // EXCEPTION
呼び出すとき;
/**
* Returns true if the %vector is empty. (Thus begin() would
* equal end().)
*/
bool
empty() const
{ return begin() == end(); } // EXCEPTION