Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

modern_messagebus.hpp是不是有啥问题? #37

Open
stoneboy100200 opened this issue Jan 26, 2021 · 2 comments
Open

modern_messagebus.hpp是不是有啥问题? #37

stoneboy100200 opened this issue Jan 26, 2021 · 2 comments

Comments

@stoneboy100200
Copy link

请教下,编译的时候报错:
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

@qicosmos
Copy link
Owner

这个是c++14的特性,需要用c++14

@qljsky
Copy link

qljsky commented Aug 22, 2022

这个是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}”

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants