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. #define all(x) (x).begin(),(x).end()
  8.  
  9. using vi = std::vector<int>;
  10.  
  11. int main() {
  12. vi left = {1,2,3};
  13. vi right = {3,1,2};
  14. vi res;
  15. std::merge(all(left), all(right), std::back_inserter(res));
  16. }
Runtime error #stdin #stdout #stderr 0s 4368KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
/usr/include/c++/8/bits/stl_algo.h:4931:
Error: elements in iterator range [__first2, __last2) are not sorted.

Objects involved in the operation:
    iterator "__first2" @ 0x0x7ffe0c7f5a20 {
      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 = dereferenceable (start-of-sequence);
      references sequence with type 'std::__debug::vector<int, std::allocator<int> >' @ 0x0x7ffe0c7f5ac0
    }
    iterator "__last2" @ 0x0x7ffe0c7f5a50 {
      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 = past-the-end;
      references sequence with type 'std::__debug::vector<int, std::allocator<int> >' @ 0x0x7ffe0c7f5ac0
    }