I'm using MinGW 4.8.0 (included in QtCreator 5.1) with C++11. The problem is that I get a compile time error but I can not find the source of the error.
typedef std::unique_ptr< ADMessageReqRSSingle > MsgType;
typedef std::vector< MsgType > Cont;
typedef Cont::const_iterator MsgCIter;
Cont mCont; // Inside another clas
Is there a diagnostic tool that is a little more specific?
The gcc log is the following:
Makefile.Debug:1491: recipe for target 'debug/adsync.o' failed
In file included from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\memory:64:0,
from ..\aams/iocontroller/iocontroller.hpp:15,
from ..\aams/aams/aamscontext.h:13,
from ..\aams\src\aams\adsync.cpp:8:
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_construct.h: In instantiation of 'void std::_Construct(_T1*, _Args&& ...) [with _T1 = std::unique_ptr<aams::device::ADMessageReqRSSingle>; _Args = {const std::unique_ptr<aams::device::ADMessageReqRSSingle, std::default_delete<aams::device::ADMessageReqRSSingle> >&}]':
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_uninitialized.h:75:53: required from 'static _ForwardIterator std::__uninitialized_copy<_TrivialValueTypes>::__uninit_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<aams::device::ADMessageReqRSSingle>*, std::vector<std::unique_ptr<aams::device::ADMessageReqRSSingle> > >; _ForwardIterator = std::unique_ptr<aams::device::ADMessageReqRSSingle>*; bool _TrivialValueTypes = false]'
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_uninitialized.h:117:41: required from '_ForwardIterator std::uninitialized_copy(_InputIterator, _InputIterator, _ForwardIterator) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<aams::device::ADMessageReqRSSingle>*, std::vector<std::unique_ptr<aams::device::ADMessageReqRSSingle> > >; _ForwardIterator = std::unique_ptr<aams::device::ADMessageReqRSSingle>*]'
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_uninitialized.h:258:63: required from '_ForwardIterator std::__uninitialized_copy_a(_InputIterator, _InputIterator, _ForwardIterator, std::allocator<_Tp>&) [with _InputIterator = __gnu_cxx::__normal_iterator<const std::unique_ptr<aams::device::ADMessageReqRSSingle>*, std::vector<std::unique_ptr<aams::device::ADMessageReqRSSingle> > >; _ForwardIterator = std::unique_ptr<aams::device::ADMessageReqRSSingle>*; _Tp = std::unique_ptr<aams::device::ADMessageReqRSSingle>]'
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_vector.h:316:32: required from 'std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = std::unique_ptr<aams::device::ADMessageReqRSSingle>; _Alloc = std::allocator<std::unique_ptr<aams::device::ADMessageReqRSSingle> >]'
..\aams/aams/device/admessagereq.h:687:50: required from here
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\stl_construct.h:75:7: error: use of deleted function 'std::unique_ptr<_Tp, _Dp>::unique_ptr(const std::unique_ptr<_Tp, _Dp>&) [with _Tp = aams::device::ADMessageReqRSSingle; _Dp = std::default_delete<aams::device::ADMessageReqRSSingle>]'
{ ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
^
In file included from c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\memory:81:0,
from ..\aams/iocontroller/iocontroller.hpp:15,
from ..\aams/aams/aamscontext.h:13,
from ..\aams\src\aams\adsync.cpp:8:
c:\qt\tools\mingw48_32\lib\gcc\i686-w64-mingw32\4.8.0\include\c++\bits\unique_ptr.h:273:7: error: declared here
unique_ptr(const unique_ptr&) = delete;
^