Home Dashboard Directory Help
Search

VC11: map and unordered_map operater[] requires mapped_type to be CopyConstructible or MoveConstructible by jhansw


Status: 

Closed


1
0
Sign in
to vote
Type: Bug
ID: 776500
Opened: 1/14/2013 9:37:28 AM
Access Restriction: Public
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Here are the requirements for operater[] of std::map and std::unordered_map from the C++11 standard:

mapped_type& operator[](const key_type& k);
mapped_type& operator[](key_type&& k);

Requires: mapped_type shall be DefaultConstructible. For the first operator, key_type shall be CopyConstructible. For the second operator, key_type shall be MoveConstructible.


Note that it doesn't say that mapped_type shall be CopyConstructible or MoveConstructible, but the implementation in VC11 requires this.
Details
Sign in to post a comment.
Posted by Microsoft on 4/29/2014 at 12:31 PM
Thank you for reporting this issue. This issue has been fixed in Visual Studio 2013. You can install a trial version of Visual Studio 2013 with the fix from: http://go.microsoft.com/?linkid=9832436
Posted by Microsoft on 2/11/2013 at 3:12 PM
Hello,

Thank you for reporting this issue. We have fixed this bug and the fix will be present in the next version of the Visual C++ libraries. While we were investigating this bug, we also wrote extensive tests to verify that our container implementations are correct and adhere to the new C++11 fine-grained container requirements for value types; we found a number of other issues and fixes for those issues will also be present in the next version of the Visual C++ libraries.

If you do find further issues where the Visual C++ 2012 Standard Library containers do not conform to the C++11 fine-grained container requirements, please open another Connect bug or contact me directly, just so we can verify that we've fixed the issues.

Note: Connect doesn't notify me about comments. If you have any further questions, please e-mail me.

James McNellis
Visual C++ Libraries
james.mcnellis@microsoft.com
Posted by Microsoft on 1/14/2013 at 10:21 PM
Thanks for your feedback.

We are rerouting this issue to the appropriate group within the Visual Studio Product Team for triage and resolution. These specialized experts will follow-up with your issue.
Posted by Microsoft on 1/14/2013 at 9:51 AM
Thank you for your feedback, we are currently reviewing the issue you have submitted. If this issue is urgent, please contact support directly(http://support.microsoft.com)
Sign in to post a workaround.