L
laniik
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:perator bool()
Line 1030 + 0x12 C++
std::vector<bool,std::allocator<bool> >::reference:perator=() Line
1006 +0x8 C++
std::_Copy_opt<std::vector<bool,std::allocator<bool>::iterator,std::vector<bool,std::allocator<bool>::iterator>(std::vector<bool,std::allocator<bool>::iterator_First={...},std::vector<bool,std::allocator<bool>::iterator_Last={...},std::vector<bool,std::allocator<bool>>::iterator_Dest={...},std::_Nonscalar_ptr_iterator_tag__formal={...})
Line 1022 + 0x26 C++
std::copy<std::vector<bool,std::allocator<bool>::iterator,std::vector<bool,std::allocator<bool>::iterator>(std::vector<bool,std::allocator<bool>::iterator_First={...},std::vector<bool,std::allocator<bool>::iterator_Last={...},std::vector<bool,std::allocator<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> >:op_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
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:perator bool()
Line 1030 + 0x12 C++
std::vector<bool,std::allocator<bool> >::reference:perator=() Line
1006 +0x8 C++
std::_Copy_opt<std::vector<bool,std::allocator<bool>::iterator,std::vector<bool,std::allocator<bool>::iterator>(std::vector<bool,std::allocator<bool>::iterator_First={...},std::vector<bool,std::allocator<bool>::iterator_Last={...},std::vector<bool,std::allocator<bool>>::iterator_Dest={...},std::_Nonscalar_ptr_iterator_tag__formal={...})
Line 1022 + 0x26 C++
std::copy<std::vector<bool,std::allocator<bool>::iterator,std::vector<bool,std::allocator<bool>::iterator>(std::vector<bool,std::allocator<bool>::iterator_First={...},std::vector<bool,std::allocator<bool>::iterator_Last={...},std::vector<bool,std::allocator<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> >:op_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