fork(1) download
  1. #define _GLIBCXX_DEBUG 1
  2. #define _GLIBCXX_DEBUG_PEDANTIC 1
  3. #define _FORTIFY_SOURCE 2
  4.  
  5. #include <bits/stdc++.h>
  6.  
  7. int main() {
  8. std::set<int> set{1,2,3,4,5};
  9. auto it = set.begin();
  10. set.erase(set.begin());
  11. std::cout << *it << std::endl;
  12. }
Runtime error #stdin #stdout #stderr 0s 4536KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/include/c++/8/debug/safe_iterator.h:270:
Error: attempt to dereference a singular iterator.

Objects involved in the operation:
    iterator "this" @ 0x0x7ffe990da790 {
      type = __gnu_debug::_Safe_iterator<std::_Rb_tree_const_iterator<int>, std::__debug::set<int, std::less<int>, std::allocator<int> > > (mutable iterator);
      state = singular;
      references sequence with type 'std::__debug::set<int, std::less<int>, std::allocator<int> >' @ 0x0x7ffe990da830
    }