Replace template operator() of util::function with a fixed-arg version to put all implicit conversions & list initializations to the actual call site
This commit is contained in:
parent
4dc8b6a183
commit
42260d4d7d
1 changed files with 3 additions and 5 deletions
|
|
@ -74,8 +74,7 @@ namespace psemek::util
|
|||
return static_cast<bool>(vtable_);
|
||||
}
|
||||
|
||||
template <typename ... Args1>
|
||||
R operator()(Args1 && ... args) const;
|
||||
R operator()(Args ... args) const;
|
||||
|
||||
void reset();
|
||||
|
||||
|
|
@ -168,13 +167,12 @@ namespace psemek::util
|
|||
}
|
||||
|
||||
template <typename R, typename ... Args>
|
||||
template <typename ... Args1>
|
||||
R function<R(Args...)>::operator()(Args1 && ... args) const
|
||||
R function<R(Args...)>::operator()(Args ... args) const
|
||||
{
|
||||
if (!vtable_)
|
||||
throw empty_function_error{};
|
||||
|
||||
return vtable_->call(const_cast<void *>(static_cast<void const *>(&storage_)), std::forward<Args1>(args)...);
|
||||
return vtable_->call(const_cast<void *>(static_cast<void const *>(&storage_)), std::forward<Args>(args)...);
|
||||
}
|
||||
|
||||
template <typename R, typename ... Args>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue