eos-vm
eos-vm copied to clipboard
replace is_callable_v workaround with is_invocable_v; fixes build on clang12
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.
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.
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