Skip to content

Can sparse_hash_map support unique_ptr? #89

@cookieli

Description

@cookieli

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions