modern_messagebus.hpp是不是有啥问题?
Opened this issue · 2 comments
请教下,编译的时候报错:
message_bus.h:56:32: error: 'timax' has not been declared
function_traits.h:32:21: error: 'remove_cv_t' is not a member of 'std'
GCC 版本:5.5.0
c++11
这个是c++14的特性,需要用c++14
这个是c++14的特性,需要用c++14
modern_messagebus c++14下使用正常, 在c++17,c++20 环境下 编译报错,这个怎样修改?
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(55,4): error C2672: “message_bus::invoker::call”: 未找到匹配的重载函数
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(51): message : 在编译 类 模板 成员函数“void message_bus::invoker::apply(const Function &,void *,void *)”时
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(13): message : 查看对正在编译的函数 模板 实例化“void message_bus::invoker::apply(const Function &,void *,void *)”的引用
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(13): message : 查看对正在编译的 类 模板 实例化“message_bus::invoker”的引用
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\HashSwitchTest.cpp(130): message : 查看对正在编译的函数 模板 实例化“void message_bus::register_handler<main::<lambda_6135af8a1ce15222d2edc40eb9168f59>>(const std::string &,const Function &)”的引用
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(55,1): error C2893: 未能使函数模板“std::enable_if<std::is_void<std::invoke_result_t<F(Args...),>::type>::value,void>::type message_bus::invoker::call(const F &,const std::tuple<_Types2...> &,void *)”专用化
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(60): message : 参见“message_bus::invoker::call”的声明
1> with
1> [
1> Function=main::<lambda_6135af8a1ce15222d2edc40eb9168f59>
1> ]
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(55,1): message : 用下列模板参数:
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(55,1): message : “F=Function”
1>X:\vistual studio\vs2019\test_study\HashSwitchTest\modern_messagebus.hpp(55,1): message : “Args={const char *, int}”