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

Status : 


Sign in
to vote
ID 773505 Comments
Status Closed Workarounds
Type Bug Repros 1
Opened 12/5/2012 1:25:19 AM
Access Restriction Public


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;

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
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:
Posted by Microsoft on 12/28/2012 at 12:25 PM
    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(