使用带参数线程出现错误 C2672 “std::invoke”: 未找到匹配的重载函数
short Axis::MM_HY( const long nDelayTime, unsigned short &nHomeStatus )
{
auto start = std::chrono::high_resolution_clock::now();
std::thread thHomeState = std::thread( [this]( long nDelayTime, unsigned short &nHomeStatus ) {
auto start = std::chrono::high_resolution_clock::now();
do
{
short nRes = GetHomingStatus( m_nAxisIndex, &nHomeStatus );
if( nRes != 0 )
{
return -1;
}
if( ( nHomeStatus == 3 ) || ( nHomeStatus == 1 ) )
{
return -1;
}
if( nHomeStatus == 5 )
{
return -1;
}
auto end = std::chrono::high_resolution_clock::now();
if( std::chrono::duration_cast<std::chrono::milliseconds>( end - start ).count() > nDelayTime ) {
return -1;
}
} while( true );
}, nDelayTime, &nHomeStatus );
thHomeState.detach();
}
上述代码出现如下错误

能否解释原因和如何修改,nHomeStatus 值是要传出的