eos-vm icon indicating copy to clipboard operation
eos-vm copied to clipboard

replace is_callable_v workaround with is_invocable_v; fixes build on clang12

Open spoonincode opened this issue 3 years ago • 2 comments

This removes the is_callable_v workaround and replaces it with std::is_invocable_v as the workaround is causing a

template argument for non-type template parameter must be an expression

error on clang12. Fixes clang12 and also is compiling on gcc8, clang6, and XCode 10.2 -- pretty much the bare minimum for eosio. But, I'm not sure if it's desirable for eos-vm to support a wider range of compilers and the workaround should be fixed instead. Or if I've just completely missed the purpose of this code in the first place... so please review carefully.

spoonincode avatar Jun 11 '21 02:06 spoonincode

is_invokable_v is wrong. is_callable_v is used here to distinguish (member) function pointers from function objects. OTOH, I have no idea how the is_callable_v ever worked, as clang is obviously correct to diagnose it as an error.

swatanabe avatar Apr 07 '22 17:04 swatanabe

It would be useful to add a unit test that exercises this code then, as far as I can remember all unit tests did pass with is_invocable_v

spoonincode avatar Apr 07 '22 19:04 spoonincode