Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

emplace calls copy constructor. #70

Closed
philippecp opened this issue Sep 14, 2018 · 1 comment
Closed

emplace calls copy constructor. #70

philippecp opened this issue Sep 14, 2018 · 1 comment

Comments

@philippecp
Copy link

The following code doesn't compile with sparse_hash_map but works fine with std::unordered_map;

int main()
{
	using StringPtr = std::unique_ptr<std::string>;
#if 1
	using StringPtrContainer = spp::sparse_hash_map<StringPtr, StringPtr>;
#else
	using StringPtrContainer = unordered_map<StringPtr, StringPtr>;
#endif
	StringPtrContainer c;

	c.emplace(std::piecewise_construct, std::forward_as_tuple(new string{ "key" }), std::forward_as_tuple(new string{ "value" }));
}
greg7mdp added a commit that referenced this issue Sep 16, 2018
@greg7mdp
Copy link
Owner

I believe that the last version of spp.h fixes the issue. Please let me know if you still have problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants