Implicit move constructor does not work properly - by summerlight

Status : 

  Deferred<br /><br />
		The product team has reviewed this issue and has deferred it for consideration at a later time.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


2
0
Sign in
to vote
ID 785972 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 4/30/2013 11:22:40 PM
Access Restriction Public

Description

#include <string>
#include <cstdio>

struct test
{
  std::string a;
};

int main()
{
  test a;
  a.a = "test";
  test b = std::move(a);
  printf("%s, %s", a.a.c_str(), b.a.c_str());
}

Above code is the example that generates implicit move constructor which should call move constructor of the internal member 'std::string a'. However, the member gets copied instead of moved.
Sign in to post a comment.
Posted by Microsoft on 5/7/2013 at 4:50 PM
Hi summerlight,

You are correct in that this is nonstandard behavior, but we've decided not to address this issue at this time. We will, however, consider fixing the behavior in a future release of Visual Studio.

Karl Niu
VC++ Team
Posted by Microsoft on 5/2/2013 at 12:22 AM
Thank you for submitting feedback on Visual Studio and .NET Framework. Your issue has been routed to the appropriate VS development team for investigation. We will contact you if we require any additional information.
Posted by Microsoft on 4/30/2013 at 11:50 PM
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)