Home Dashboard Directory Help
Search

std::forward and variadic templates failed in Nov 2012 CTP by imoldman


Status: 

Closed


2
0
Sign in
to vote
Type: Bug
ID: 773505
Opened: 12/5/2012 1:25:19 AM
Access Restriction: Public
0
Workaround(s)
view
1
User(s) can reproduce this bug

Description

the code snippet fail in Nov 2012 CTP

#include <memory>
#include <string>

template<typename T, typename ...Args>
std::unique_ptr<T> make_unique( Args&& ...args ) {
    return std::unique_ptr<T>( new T( std::forward<Args>(args)... ) );
}

int main() {
    auto p = make_unique<std::string>(std::string("foobar"));
    return 0;
}

================================
output:
error C2065: 'basic_string<char,std::char_traits<char>,std::allocator<char> >' : undeclared identifier
error C2974: 'std::forward' : invalid template argument for '_Ty', type expected
Details
Sign in to post a comment.
Posted by Microsoft 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 Microsoft on 12/28/2012 at 12:25 PM
Hi:
    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 Microsoft on 12/5/2012 at 10:46 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 12/5/2012 at 1:50 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.
File Name Submitted By Submitted On File Size  
VsInfo.xml (restricted) 12/5/2012 -
UploadSummary-121205092508.xml (restricted) 12/5/2012 -
DxDiagOutput.txt (restricted) 12/5/2012 -