It does not work to instantiate a template with two different anonymous enums - by Erik Olofsson

Status : 

  Fixed<br /><br />
		This item has been fixed in the current or upcoming version of this product.<br /><br />
		A more detailed explanation for the resolution of this particular item may have been provided in the comments section.


1
0
Sign in
to vote
ID 746042 Comments
Status Closed Workarounds
Type Bug Repros 0
Opened 6/2/2012 11:34:29 AM
Access Restriction Public

Description

Compiling the code below gives compiler error:

error C2664: 'TestTemplateFunc' : cannot convert parameter 1 from '' to '&&'
1>          Reason: cannot convert from '' to ''

template <typename tf_CType>
void TestTemplateFunc(tf_CType &&_Functor)
{
}

enum 
{
 UnnamedEnum_0
};

enum
{
 UnnamedEnum_1
};


int _tmain(int argc, _TCHAR* argv[])
{
 TestTemplateFunc(UnnamedEnum_0);
 TestTemplateFunc(UnnamedEnum_1);

 return 0;
}

Sign in to post a comment.
Posted by Deon [MSFT] on 4/29/2014 at 12:22 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 Xiang [MSFT] on 11/15/2012 at 11:29 AM
Hi Erik:
    Thanks for reporting the issue.
    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 Erik Olofsson on 9/11/2012 at 11:46 AM
Any progress on this?
Posted by Helen [MSFT] on 6/4/2012 at 11:18 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 MS-Moderator01 on 6/2/2012 at 11:42 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)