Ableton / link

Ableton Link
Other
1.09k stars 149 forks source link

Link doesn't compile with Cxx20 #119

Closed JoergAtGithub closed 2 years ago

JoergAtGithub commented 2 years ago

If I set(CMAKE_CXX_STANDARD 20) in a project which includes Link, the build fails with: include\ableton\discovery\PeerGateways.hpp(38): error C2039: 'result_of': is not a member of 'std' because std::result_of was removed in C++20: https://en.cppreference.com/w/cpp/types/result_of

cdi-ableton commented 2 years ago

Hello, thanks for bringing this up. Could you please replace using Gateway = typename std::result_of<Ga... in PeerGateways.hpp with

using Gateway = decltype(std::declval<GatewayFactory>()(std::declval<NodeState>(),
    std::declval<util::Injected<IoType&>>(),
    std::declval<asio::ip::address>()));

and check if this works for your project.

JoergAtGithub commented 2 years ago

I checked this, it compiles now with set(CMAKE_CXX_STANDARD 20) and Link seems to work (found other devices and synced tempo). Thank you!

cdi-ableton commented 2 years ago

Thanks for testing. I pushed a commit that should resolve the issue then: 8bbd58f5c723417760a291bc7820f2cfb1348c38