rendered paste bodyint main(int argc, char* argv[]) {
std::vector<std::auto_ptr<int> > foo;
foo.push_back(std::auto_ptr<int>(new int));
return 0;
}
test.cpp: In function `int main(int, char**)':
test.cpp:9: error: no matching function for call to `std::auto_ptr<int>::auto_ptr(std::auto_ptr<int>)'
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/memory:351: note: candidates are: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr_ref<_Tp>) [with _Tp = int]
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/memory:213: note: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr<_Tp1>&) [with _Tp1 = int, _Tp = int]
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/memory:200: note: std::auto_ptr<_Tp>::auto_ptr(std::auto_ptr<_Tp>&) [with _Tp = int]
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h: In function `void std::_Construct(_T1*, const _T2&) [with _T1 = std::auto_ptr<int>, _T2 = std::auto_ptr<int>]':
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:560: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::auto_ptr<int>, _Alloc = std::allocator<std::auto_ptr<int> >]'
test.cpp:9: instantiated from here
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_construct.h:81: error: passing `const std::auto_ptr<int>' as `this' argument of `std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>() [with _Tp1 = int, _Tp = int]' discards qualifiers
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc: In member function `void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename _Alloc::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = std::auto_ptr<int>, _Alloc = std::allocator<std::auto_ptr<int> >]':
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/stl_vector.h:564: instantiated from `void std::vector<_Tp, _Alloc>::push_back(const _Tp&) [with _Tp = std::auto_ptr<int>, _Alloc = std::allocator<std::auto_ptr<int> >]'
test.cpp:9: instantiated from here
/usr/lib/gcc/i486-slackware-linux/3.4.6/../../../../include/c++/3.4.6/bits/vector.tcc:234: error: passing `const std::auto_ptr<int>' as `this' argument of `std::auto_ptr<_Tp>::operator std::auto_ptr_ref<_Tp1>() [with _Tp1 = int, _Tp = int]' discards qualifiers