#define _GLIBCXX_DEBUG 1
#define _GLIBCXX_DEBUG_PEDANTIC 1
#define _FORTIFY_SOURCE 2
#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using vi = std::vector<int>;
int main() {
vi arr{1,2,3,4};
auto ptr = arr.begin();
arr.push_back(5);
std::cout << *ptr << std::endl;
}
I2RlZmluZSBfR0xJQkNYWF9ERUJVRyAxCiNkZWZpbmUgX0dMSUJDWFhfREVCVUdfUEVEQU5USUMgMQojZGVmaW5lIF9GT1JUSUZZX1NPVVJDRSAyCgojaW5jbHVkZSA8Yml0cy9zdGRjKysuaD4KCiNkZWZpbmUgYWxsKHgpICh4KS5iZWdpbigpLCh4KS5lbmQoKQoKdXNpbmcgdmkgPSBzdGQ6OnZlY3RvcjxpbnQ+OwoKaW50IG1haW4oKSB7CiAgICB2aSBhcnJ7MSwyLDMsNH07CiAgICBhdXRvIHB0ciA9IGFyci5iZWdpbigpOwogICAgYXJyLnB1c2hfYmFjayg1KTsKICAgIHN0ZDo6Y291dCA8PCAqcHRyIDw8IHN0ZDo6ZW5kbDsKfQ==
/usr/include/c++/8/debug/safe_iterator.h:270:
Error: attempt to dereference a singular iterator.
Objects involved in the operation:
iterator "this" @ 0x0x7fff25afaf10 {
type = __gnu_debug::_Safe_iterator<__gnu_cxx::__normal_iterator<int*, std::__cxx1998::vector<int, std::allocator<int> > >, std::__debug::vector<int, std::allocator<int> > > (mutable iterator);
state = singular;
references sequence with type 'std::__debug::vector<int, std::allocator<int> >' @ 0x0x7fff25afaf40
}