1
내가 비주얼 스튜디오 2013에서 다음 코드를 컴파일하기 위해 노력하고있어
을 가진 make_unique
std::unique_ptr<std::thread> threadPtr;
threadPtr.reset(std::make_unique<std::thread>([&]
{
//...
}));
: 내가 사용으로
error C2664: 'void std::unique_ptr<std::thread,std::default_delete<_Ty>>::
reset(std::thread *) throw()' : cannot convert argument 1 from
'std::unique_ptr<std::thread,std::default_delete<_Ty>>' to 'std::thread *'
이 이상한 것 같다 std::make_unique
다른 곳에서는 문제가 없습니다.
std::unique_ptr<std::thread> threadPtr;
threadPtr.reset(new std::thread([&]
{
//...
}));
내가 여기 뭔가 잘못하고 있는가, 또는이 컴파일러 문제 : 그러나, 나는 std::make_unique
를 사용하지 않는 대신 new
을 사용, 그것은 작동?
좋은 전화. 'threadPtr = std :: make_unique ... '를 사용할 수 있습니까? –
@NicolasHolthaus 자동으로 예. –