#include <memory>
#include <vector>
int main() {
std::vector<std::unique_ptr<int*>> tablica;
tablica[0] = new int(5);
}
I2luY2x1ZGUgPG1lbW9yeT4KI2luY2x1ZGUgPHZlY3Rvcj4KCmludCBtYWluKCkgewogICAgc3RkOjp2ZWN0b3I8c3RkOjp1bmlxdWVfcHRyPGludCo+PiB0YWJsaWNhOwogICAgdGFibGljYVswXSA9IG5ldyBpbnQoNSk7Cn0=
prog.cpp: In function ‘int main()’:
prog.cpp:6:27: error: no match for ‘operator=’ in ‘tablica.std::vector<_Tp, _Alloc>::operator[]<std::unique_ptr<int*>, std::allocator<std::unique_ptr<int*> > >(0u) = (operator new(4u), (<statement>, ((int*)<anonymous>)))’
prog.cpp:6:27: note: candidates are:
In file included from /usr/include/c++/4.7/memory:86:0,
from prog.cpp:1:
/usr/include/c++/4.7/bits/unique_ptr.h:179:7: note: std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::unique_ptr<_Tp, _Dp>&&) [with _Tp = int*; _Dp = std::default_delete<int*>; std::unique_ptr<_Tp, _Dp> = std::unique_ptr<int*>]
/usr/include/c++/4.7/bits/unique_ptr.h:179:7: note: no known conversion for argument 1 from ‘int*’ to ‘std::unique_ptr<int*>&&’
/usr/include/c++/4.7/bits/unique_ptr.h:192:2: note: template<class _Up, class _Ep, class> std::unique_ptr& std::unique_ptr::operator=(std::unique_ptr<_Up, _Ep>&&) [with _Up = _Up; _Ep = _Ep; <template-parameter-2-3> = <template-parameter-1-3>; _Tp = int*; _Dp = std::default_delete<int*>]
/usr/include/c++/4.7/bits/unique_ptr.h:192:2: note: template argument deduction/substitution failed:
prog.cpp:6:27: note: mismatched types ‘std::unique_ptr<_Up, _Ep>’ and ‘int*’
In file included from /usr/include/c++/4.7/memory:86:0,
from prog.cpp:1:
/usr/include/c++/4.7/bits/unique_ptr.h:200:7: note: std::unique_ptr<_Tp, _Dp>& std::unique_ptr<_Tp, _Dp>::operator=(std::nullptr_t) [with _Tp = int*; _Dp = std::default_delete<int*>; std::unique_ptr<_Tp, _Dp> = std::unique_ptr<int*>; std::nullptr_t = std::nullptr_t]
/usr/include/c++/4.7/bits/unique_ptr.h:200:7: note: no known conversion for argument 1 from ‘int*’ to ‘std::nullptr_t’