sparsepp icon indicating copy to clipboard operation
sparsepp copied to clipboard

Can sparse_hash_map support unique_ptr?

Open cookieli opened this issue 5 years ago • 0 comments

I have a class member like this:

HashMap<String, std::unique_ptr<Klass>> _classes;// HashMap is sparse_hash_map alias

And it will get following errors:

In file included from /usr/include/c++/7/memory:80:0,
                 from /home/lzx/LiVM/include/sparsepp/spp.h:53,
                 from /home/lzx/LiVM/include/shared/hashMap.h:7,
                 from /home/lzx/LiVM/include/LiVM/classpath/system.h:8,
                 from /home/lzx/LiVM/src/LiVM/classpath/system.cpp:4:
/usr/include/c++/7/bits/unique_ptr.h: In instantiation of ‘void std::default_delete<_Tp>::operator()(_Tp*) const [with _Tp = LiVM::Klass]’:
blahblah

And when i change it to:

HashMap<String, Klass*> _classes;

everything is ok,so what happened?

cookieli avatar May 25 '20 11:05 cookieli