我试图在异步任务中定义一个上下文,但它会让我回到错误之下。不确定陈述
有什么问题In file included from /usr/include/c++/5/thread:39:0,
from assgn4.cpp:17:
/usr/include/c++/5/functional: In instantiation of ‘struct std::_Bind_simple<void (*(std::reference_wrapper<TTAS()>))(TTAS)>’:
/usr/include/c++/5/thread:137:59: required from ‘std::thread::thread(_Callable&&, _Args&& ...) [with _Callable = void (&)(TTAS); _Args = {std::reference_wrapper<TTAS()>}]’
assgn4.cpp:186:60: required from here
/usr/include/c++/5/functional:1505:61: error: no type named ‘type’ in ‘class std::result_of<void (*(std::reference_wrapper<TTAS()>))(TTAS)>’
typedef typename result_of<_Callable(_Args...)>::type result_type;
^
/usr/include/c++/5/functional:1526:9: error: no type named ‘type’ in ‘class std::result_of<void (*(std::reference_wrapper<TTAS()>))(TTAS)>’
_M_invoke(_Index_tuple<_Indices...>)
^
这里说“无效的方法声明,需要返回类型”
有人可以帮忙!
答案 0 :(得分:0)