Hi. For some reason I am getting a crash on pop_back() and Im not sure
why.
sorry I cant post the whole code because the vector is used in a bunch
of places.
i have a
vector<bool> complete;
right before i pop back, i set the last element to overwrite on of the
ones in the array.
complete[j] = complete[complete.size()-1];
complete.pop_back();
the crash looks like:
unhandled exception: 0xC00000005 Access Violation reading 0x203f5a34
the size of complete before it crashes is 32, so it is not empty.
the code it crashes on is:
operator bool() const
{ // test if bit is set
return ((*_Getptr() & _Mask()) != 0);
}
at:
std::vector<bool,std::allocator<bool> >::reference::operator bool()
Line 1030 + 0x12 C++
std::vector<bool,std::allocator<bool> >::reference::operator=() Line
1006 +0x8 C++
std::_Copy_opt<std::vector<bool,std::allocator<boo l>::iterator,std::vector<bool,std::allocator<bool> ::iterator>(std::vector<bool,std::allocator<bool>: :iterator_First={...},std::vector<bool,std::alloca tor<bool>::iterator_Last={...},std::vector<bool,st d::allocator<bool>>::iterator_Dest={...},std::_Non scalar_ptr_iterator_tag__formal={...})
Line 1022 + 0x26 C++
std::copy<std::vector<bool,std::allocator<bool>::i terator,std::vector<bool,std::allocator<bool>::ite rator>(std::vector<bool,std::allocator<bool>::iter ator_First={...},std::vector<bool,std::allocator<b ool>::iterator_Last={...},std::vector<bool,std::al locator<bool>>::iterator_Dest={...})
Line 1040 + 0x3e C++
std::vector<bool,std::allocator<bool>::erase(std:: vector<bool,std::allocator<bool>::iterator_Where={ ...})
Line 1562 + 0x42 C++
std::vector<bool,std::allocator<bool> >::pop_back() Line 1483 C++
If anyone has experenced anything like this before, or has some idea
what might be causing the crash, that would be great. thanks!
oliver