Home Dashboard Directory Help
Search

Incorrectly duplicating object when it is a native one(NDT) in vs2010sp1(C++) by UnitUniverse


Status: 

Closed
 as Fixed Help for as Fixed


1
0
Sign in
to vote
Type: Bug
ID: 679623
Opened: 7/16/2011 2:36:15 PM
Access Restriction: Public
Moderator Decision: Sent to Engineering Team for consideration
0
Workaround(s)
view
0
User(s) can reproduce this bug

Description

Recently i wrote a C++ TEMPLATE Library that should pass the type info transparently from the referenced sources to the target. Then I found the rvalue-referenced object being copied from the source(incorrectly maybe) rather than referencing to the original one like doing to const lvalue references.
The 'error' is exactly like this:
If a source is a UDT object from struct/union/class, there is no such error at all;
If a source is a NDT object like int/char/float, etc, thers is such limitation there.
I don't think the micro-code optimization to CPU is an excuse for this error(sorry about the word, i just attempt to say that is logically-possible reason for) while to rvalue references or constant lvalue references.
The sample code shows what i told, Assuming those were the instantiated templates.

Regards
Details
Sign in to post a comment.
Posted by UnitUniverse on 3/7/2012 at 7:45 PM
Hard to explain by several words...
I have figured out a way to solve this, working on both 2010(sp1) and v11.

I made a source file to describe what i said, which has been uploaded as the 'Attach a file'.

Thanks.
Posted by Microsoft on 11/23/2011 at 11:47 AM
Hi:
    A fix for this issue has been checked into the compiler sources. The fix should show up in the next release of Visual C++.

Xiang Fan
Visual C++ Team
Posted by UnitUniverse on 7/20/2011 at 1:23 PM
Any idea?
Posted by MS-Moderator08 [Feedback Moderator] on 7/17/2011 at 8:18 PM
Thank you for submitting feedback on Visual Studio 2010 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 MS-Moderator01 on 7/16/2011 at 2:48 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)
Sign in to post a workaround.
File Name Submitted By Submitted On File Size  
rvtuple.cpp 3/7/2012 4 KB