[ create a new paste ] login | about

Link: http://codepad.org/r3XR7b81    [ raw code | output | fork ]

C++, pasted on May 28:
1
2
3
4
5
6
7
8
9
10
#include <list>

int main ()
{
   std::list <int> src (10); // источник размером 10
   std::list <int> dst (5);  // получатель размером меньше чем источник
                             // если поставите сюда размер как у источника, исключения не будет.

   std::copy (src.begin(), src.end(), dst.begin());
}


Output:
1
2
3
4
5
6
7
8
9
10
11
/usr/local/lib/gcc/i686-pc-linux-gnu/4.1.2/../../../../include/c++/4.1.2/debug/safe_iterator.h:181:
    error: attempt to dereference a past-the-end iterator.

Objects involved in the operation:
iterator "this" @ 0x0xfff34590 {
type = N11__gnu_debug14_Safe_iteratorIN10__gnu_norm14_List_iteratorIiEEN15__gnu_debug_def4listIiSaIiEEEEE (mutable iterator);
  state = past-the-end;
  references sequence with type `N15__gnu_debug_def4listIiSaIiEEE' @ 0x0xfff34590
}

Disallowed system call: SYS_kill


Create a new paste based on this one


Comments: