[PATCH] Fix std::unordered_map key range insertion

François Dumont frs.dumont@gmail.com
Thu Feb 23 21:14:48 GMT 2023


Hi

Based on my work on PR 96088 for std::map I imagine this use case of 
inserting a range of keys into an associative container. It behaves as 
operator[] by inserting a default value for each key.

I wonder if the Standard says that it should work. Or maybe we want to 
support it ?

I haven't checked if it used to work before we introduced the 
_ConvertToValueType type. I have no old enough gcc to do so.

It is not supported by std::map neither, even without 
_ConvertToValueType so I guess it was not working for std::unordered_map 
prior to it.

If it can be considered as a bug I'll create a PR.

François

-------------- next part --------------
A non-text attachment was scrubbed...
Name: umap.patch
Type: text/x-patch
Size: 2821 bytes
Desc: not available
URL: <https://gcc.gnu.org/pipermail/libstdc++/attachments/20230223/2e2d4fad/attachment.bin>


More information about the Libstdc++ mailing list