I am trying to compile google's sparse hash map, but there is an error. The error message seems to be related to using unique_ptr
. After I removed unique_ptr
compiling succeeded.
google::sparse_hash_map<std::string, std::unique_ptr<int>> testers_;
The error message is as below. Any suggestions? Thanks a lot!
build/libgcc/include/c++/trunk/bits/stl_pair.h:127:17: note: explicitly defaulted function was implicitly deleted here
constexpr pair(const pair&) = default;
^
build/libgcc/include/c++/trunk/bits/stl_pair.h:102:11: note: copy constructor of 'pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char>, std::basic_string<char> >, std::unique_ptr<int, std::default_delete<int> > >' is implicitly deleted because field 'second' has a deleted copy constructor
_T2 second; /// @c second is a copy of the second object
^
/build/libgcc/include/c++/trunk/bits/unique_ptr.h:356:7: note: 'unique_ptr' has been explicitly marked deleted here
unique_ptr(const unique_ptr&) = delete;