將具有6個參數或更多參數的函數傳遞給QtConcurrent::run()
時出現編譯錯誤。當我將它們減少到5個參數時,我不會再遇到這個錯誤。QtConcurrent :: run()不能處理超過5個參數?
這個虛擬的代碼重現錯誤對我來說:
void foo(int, int, int, int, int, int)
{
}
QtConcurrent::run(foo, 1, 2, 3, 4, 5, 6);
編譯器錯誤是:
error: no matching function for call to 'run(void (&)(int, int, int, int, int, int), int, int, int, int, int, int)'
難道這應該是這樣的嗎?最多是否限制了5個參數QtConcurrent::run()
?
如果它有限,它不會讓我感到驚訝。畢竟,它必須與預C++ 11編譯器一起工作。 – Angew