Ошибка C2893: не удалось специализировать шаблон функций «Неизвестный тип std :: invoke (_callable &&, _ types && ...) nC++

Программы на C++. Форум разработчиков
Ответить Пред. темаСлед. тема
Anonymous
 Ошибка C2893: не удалось специализировать шаблон функций «Неизвестный тип std :: invoke (_callable &&, _ types && ...) n

Сообщение Anonymous »

Ниже приведена определенная программа, которая дает ошибки времени компиляции. Это должно делать в основном с функцией BOO в классе D. Я в конечном итоге пытаюсь использовать ряд потоков, чтобы вызвать метод решения, но в настоящее время это не очень хорошо работает, чтобы получить так далеко. < /P>

Ошибки: < /p>

1>d:\dummy\project1\trash.cpp(37): warning C4101: 'd': unreferenced local variable
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(240): error C2672: 'std::invoke': no matching overloaded function found
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(248): note: see reference to function template instantiation 'void std::_LaunchPad::_Execute(std::tuple &,std::integer_sequence)' being compiled
1> with
1> [
1> _Target=std::unique_ptr,
1> _Ty=::size_t
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(247): note: see reference to function template instantiation 'void std::_LaunchPad::_Execute(std::tuple &,std::integer_sequence)' being compiled
1> with
1> [
1> _Target=std::unique_ptr,
1> _Ty=::size_t
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(244): note: while compiling class template member function 'void std::_LaunchPad::_Run(std::_LaunchPad *) noexcept'
1> with
1> [
1> _Target=std::unique_ptr
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(232): note: see reference to function template instantiation 'void std::_LaunchPad::_Run(std::_LaunchPad *) noexcept' being compiled
1> with
1> [
1> _Target=std::unique_ptr
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(259): note: see reference to class template instantiation 'std::_LaunchPad' being compiled
1> with
1> [
1> _Target=std::unique_ptr
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thread(48): note: see reference to function template instantiation 'void std::_Launch(_Thrd_t *,_Target &&)' being compiled
1> with
1> [
1> _Ty=std::tuple,
1> _Target=std::unique_ptr
1> ]
1>d:\trash\project1\trash.cpp(26): note: see reference to function template instantiation 'std::thread::thread(_Fn &&,C &)' being compiled
1> with
1> [
1> _Fn=void (__thiscall A::* )(C)
1> ]
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(240): error C2893: Failed to specialize function template 'unknown-type std::invoke(_Callable &&,_Types &&...) noexcept()'
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(240): note: With the following template arguments:
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(240): note: '_Callable=void (__thiscall A::* )(C)'
1>c:\program files (x86)\microsoft visual studio\2017\community1\vc\tools\msvc\14.11.25503\include\thr\xthread(240): note: '_Types={C}'
1>Done building project "Project1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
< /code>

Код: < /p>

class C {
};

class A {
public:
virtual void solve(C c) = 0;
};

class B:A {
public:
void solve(C c) {};
};

class D {
public:
void Boo(B* b, C &c)
{
auto thread1 = std::thread(&A::solve,c);
thread1.join();
}
};

int main()
{
B b;
C c;
D d;
}
< /code>

Спасибо за ваше время! :)

Подробнее здесь: https://stackoverflow.com/questions/474 ... tdinvoke-c
Реклама
Ответить Пред. темаСлед. тема

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

  • Похожие темы
    Ответы
    Просмотры
    Последнее сообщение
  • Набрать приверженность с помощью параметра или args (`` callable [p, any] | Callable [[], any] `)
    Anonymous » » в форуме Python
    0 Ответы
    9 Просмотры
    Последнее сообщение Anonymous
  • Набрать приверженность с помощью параметра или args (`` callable [p, any] | Callable [[], any] `)
    Anonymous » » в форуме Python
    0 Ответы
    11 Просмотры
    Последнее сообщение Anonymous
  • Набрать приверженность с помощью параметра или args (`` callable [p, any] | Callable [[], any] `)
    Anonymous » » в форуме Python
    0 Ответы
    6 Просмотры
    Последнее сообщение Anonymous
  • Как специализировать шаблон метода, используя концепции?
    Anonymous » » в форуме C++
    0 Ответы
    9 Просмотры
    Последнее сообщение Anonymous
  • Как специализировать шаблон метода, используя концепции?
    Anonymous » » в форуме C++
    0 Ответы
    9 Просмотры
    Последнее сообщение Anonymous

Вернуться в «C++»