#include <iostream> #include <memory> using namespace std; struct Noisy { ~Noisy(){cout<<" destruktor "<<endl;} }; int main() { // your code goes here unique_ptr<Noisy> ptr(new Noisy[10]); return 0; }
Standard input is empty
destruktor
*** Error in `./prog': munmap_chunk(): invalid pointer: 0x000055d083c9cc28 *** ======= Backtrace: ========= /lib/x86_64-linux-gnu/libc.so.6(+0x70bcb)[0x2b86eb964bcb] /lib/x86_64-linux-gnu/libc.so.6(+0x76f96)[0x2b86eb96af96] ./prog(+0x96c)[0x55d0827b096c] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf1)[0x2b86eb9142b1] ./prog(+0x9ca)[0x55d0827b09ca] ======= Memory map: ======== 2b86eac14000-2b86eac37000 r-xp 00000000 fd:00 2840974 /lib/x86_64-linux-gnu/ld-2.24.so 2b86eac37000-2b86eac3b000 rw-p 00000000 00:00 0 2b86eac44000-2b86eac49000 rw-p 00000000 00:00 0 2b86eae37000-2b86eae38000 r--p 00023000 fd:00 2840974 /lib/x86_64-linux-gnu/ld-2.24.so 2b86eae38000-2b86eae39000 rw-p 00024000 fd:00 2840974 /lib/x86_64-linux-gnu/ld-2.24.so 2b86eae39000-2b86eae3a000 rw-p 00000000 00:00 0 2b86eae3a000-2b86eafac000 r-xp 00000000 fd:00 2967755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 2b86eafac000-2b86eb1ac000 ---p 00172000 fd:00 2967755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 2b86eb1ac000-2b86eb1b6000 r--p 00172000 fd:00 2967755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 2b86eb1b6000-2b86eb1b8000 rw-p 0017c000 fd:00 2967755 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.22 2b86eb1b8000-2b86eb1bc000 rw-p 00000000 00:00 0 2b86eb1bc000-2b86eb2bf000 r-xp 00000000 fd:00 2841003 /lib/x86_64-linux-gnu/libm-2.24.so 2b86eb2bf000-2b86eb4be000 ---p 00103000 fd:00 2841003 /lib/x86_64-linux-gnu/libm-2.24.so 2b86eb4be000-2b86eb4bf000 r--p 00102000 fd:00 2841003 /lib/x86_64-linux-gnu/libm-2.24.so 2b86eb4bf000-2b86eb4c0000 rw-p 00103000 fd:00 2841003 /lib/x86_64-linux-gnu/libm-2.24.so 2b86eb4c0000-2b86eb4d6000 r-xp 00000000 fd:00 2840941 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b86eb4d6000-2b86eb6d5000 ---p 00016000 fd:00 2840941 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b86eb6d5000-2b86eb6d6000 r--p 00015000 fd:00 2840941 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b86eb6d6000-2b86eb6d7000 rw-p 00016000 fd:00 2840941 /lib/x86_64-linux-gnu/libgcc_s.so.1 2b86eb6d7000-2b86eb6ef000 r-xp 00000000 fd:00 2840960 /lib/x86_64-linux-gnu/libpthread-2.24.so 2b86eb6ef000-2b86eb8ee000 ---p 00018000 fd:00 2840960 /lib/x86_64-linux-gnu/libpthread-2.24.so 2b86eb8ee000-2b86eb8ef000 r--p 00017000 fd:00 2840960 /lib/x86_64-linux-gnu/libpthread-2.24.so 2b86eb8ef000-2b86eb8f0000 rw-p 00018000 fd:00 2840960 /lib/x86_64-linux-gnu/libpthread-2.24.so 2b86eb8f0000-2b86eb8f4000 rw-p 00000000 00:00 0 2b86eb8f4000-2b86eba89000 r-xp 00000000 fd:00 2841097 /lib/x86_64-linux-gnu/libc-2.24.so 2b86eba89000-2b86ebc88000 ---p 00195000 fd:00 2841097 /lib/x86_64-linux-gnu/libc-2.24.so 2b86ebc88000-2b86ebc8c000 r--p 00194000 fd:00 2841097 /lib/x86_64-linux-gnu/libc-2.24.so 2b86ebc8c000-2b86ebc8e000 rw-p 00198000 fd:00 2841097 /lib/x86_64-linux-gnu/libc-2.24.so 2b86ebc8e000-2b86ebc92000 rw-p 00000000 00:00 0 55d0827b0000-55d0827b1000 r-xp 00000000 fd:00 16773124 /home/eXPCAZ/prog 55d0829b0000-55d0829b1000 r--p 00000000 fd:00 16773124 /home/eXPCAZ/prog 55d0829b1000-55d0829b2000 rw-p 00001000 fd:00 16773124 /home/eXPCAZ/prog 55d083c8b000-55d083cbd000 rw-p 00000000 00:00 0 [heap] 7ffcd7d22000-7ffcd7d43000 rw-p 00000000 00:00 0 [stack] 7ffcd7dd2000-7ffcd7dd4000 r-xp 00000000 00:00 0 [vdso] 7ffcd7dd4000-7ffcd7dd6000 r--p 00000000 00:00 0 [vvar] ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]