Witajcie,
Mam klase Mipmap
: https://github.com/patrykbajos/ZinotEngine/blob/master/src/zinot/tools/textool/conv/Mipmap.hpp. Używałem jej w ten sposób:
Mipmap mipmap;
mipmap.createFromFiBitmap(fiBitmap, destWidth, destHeight,
0, it, configuration.getMipmapFilter());
if(mipmap.getData() == nullptr)
return false;
mipmaps.push_back(mipmap);
mipmaps
to std::vector
Chyba to powoduje problem. Dostaję taką litanię błędów:
[ 58%] Building CXX object CMakeFiles/Textool.dir/src/zinot/tools/textool/conv/Mipmap.cpp.o
In file included from /usr/include/x86_64-linux-gnu/c++/4.9/bits/c++allocator.h:33:0,
from /usr/include/c++/4.9/bits/allocator.h:46,
from /usr/include/c++/4.9/vector:61,
from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.hpp:8,
from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.cpp:5:
/usr/include/c++/4.9/ext/new_allocator.h: In instantiation of ‘void __gnu_cxx::new_allocator<_Tp>::construct(_Up*, _Args&& ...) [with _Up = Zinot::Textool::Mipmap; _Args = {const Zinot::Textool::Mipmap&}; _Tp = Zinot::Textool::Mipmap]’:
/usr/include/c++/4.9/bits/alloc_traits.h:253:4: required from ‘static std::_Require<typename std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::type> std::allocator_traits<_Alloc>::_S_construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Zinot::Textool::Mipmap; _Args = {const Zinot::Textool::Mipmap&}; _Alloc = std::allocator<Zinot::Textool::Mipmap>; std::_Require<typename std::allocator_traits<_Alloc>::__construct_helper<_Tp, _Args>::type> = void]’
/usr/include/c++/4.9/bits/alloc_traits.h:399:57: required from ‘static decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) std::allocator_traits<_Alloc>::construct(_Alloc&, _Tp*, _Args&& ...) [with _Tp = Zinot::Textool::Mipmap; _Args = {const Zinot::Textool::Mipmap&}; _Alloc = std::allocator<Zinot::Textool::Mipmap>; decltype (_S_construct(__a, __p, (forward<_Args>)(std::allocator_traits::construct::__args)...)) = <type error>]’
/usr/include/c++/4.9/bits/stl_vector.h:918:34: required from ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = Zinot::Textool::Mipmap; _Alloc = std::allocator<Zinot::Textool::Mipmap>; std::vector<_Tp, _Alloc>::value_type = Zinot::Textool::Mipmap]’
/home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.cpp:108:29: required from here
/usr/include/c++/4.9/ext/new_allocator.h:120:4: error: use of deleted function ‘Zinot::Textool::Mipmap::Mipmap(const Zinot::Textool::Mipmap&)’
{ ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
^
In file included from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.hpp:12:0,
from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.cpp:5:
/home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/Mipmap.hpp:17:9: note: ‘Zinot::Textool::Mipmap::Mipmap(const Zinot::Textool::Mipmap&)’ is implicitly deleted because the default definition would be ill-formed:
class Mipmap
^
/home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/Mipmap.hpp:17:9: error: use of deleted function ‘std::unique_ptr<_Tp [], _Dp>::unique_ptr(const std::unique_ptr<_Tp [], _Dp>&) [with _Tp = unsigned char; _Dp = std::default_delete<unsigned char []>]’
In file included from /usr/include/c++/4.9/memory:81:0,
from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.hpp:9,
from /home/patryk/ClionProjects/BennuEngine/src/zinot/tools/textool/conv/PngConverter.cpp:5:
/usr/include/c++/4.9/bits/unique_ptr.h:598:7: note: declared here
unique_ptr(const unique_ptr&) = delete;
^
Całe repo: https://github.com/patrykbajos/ZinotEngine.