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

replace is_callable_v workaround with is_invocable_v; fixes build on clang12 #210

Open
wants to merge 1 commit into
base: eosio
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 2 additions & 8 deletions include/eosio/vm/function_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,6 @@ namespace eosio { namespace vm {
inline constexpr U&& make_dependent(U&& u) { return static_cast<U&&>(u); }
}

template <auto FN>
inline constexpr static bool is_callable_v = EOS_VM_HAS_MEMBER(AUTO_PARAM_WORKAROUND(FN), operator());

template <typename F>
constexpr bool is_callable(F&& fn) { return EOS_VM_HAS_MEMBER(fn, operator()); }

namespace detail {
template <bool Decay, typename R, typename... Args>
constexpr auto get_types(R(Args...)) -> std::tuple<R, freestanding,
Expand All @@ -102,7 +96,7 @@ namespace eosio { namespace vm {
std::tuple<std::conditional_t<Decay, std::decay_t<Args>, Args>...>>;
template <bool Decay, typename F>
constexpr auto get_types(F&& fn) {
if constexpr (is_callable_v<decltype(fn)>)
if constexpr (std::is_invocable_v<decltype(fn)>)
return get_types<Decay>(&F::operator());
else
return get_types<Decay>(fn);
Expand Down Expand Up @@ -144,7 +138,7 @@ namespace eosio { namespace vm {
constexpr auto parameters_from_impl(R(Cls::*)(Args...)const &&) -> pack_from_t<N, Args...>;
template <std::size_t N, typename F>
constexpr auto parameters_from_impl(F&& fn) {
if constexpr (is_callable_v<decltype(fn)>)
if constexpr (std::is_invocable_v<decltype(fn)>)
return parameters_from_impl<N>(&F::operator());
else
return parameters_from_impl<N>(fn);
Expand Down