mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-14 08:45:36 +08:00
refs #624 Use std alias traits.
This commit is contained in:
@@ -187,14 +187,14 @@ namespace BlackMisc
|
||||
|
||||
//! Uniform way to invoke either a functor or a method.
|
||||
template <typename T, typename F, typename... Ts>
|
||||
static auto invoke(T *object, F func, Ts &&... args) -> typename std::enable_if<std::is_member_function_pointer<F>::value>::type
|
||||
static auto invoke(T *object, F func, Ts &&... args) -> std::enable_if_t<std::is_member_function_pointer<F>::value>
|
||||
{
|
||||
return (object->*func)(std::forward<Ts>(args)...);
|
||||
}
|
||||
|
||||
//! Uniform way to invoke either a functor or a method.
|
||||
template <typename T, typename F, typename... Ts>
|
||||
static auto invoke(T *, F func, Ts &&... args) -> typename std::enable_if<! std::is_member_function_pointer<F>::value>::type
|
||||
static auto invoke(T *, F func, Ts &&... args) -> std::enable_if_t<! std::is_member_function_pointer<F>::value>
|
||||
{
|
||||
return func(std::forward<Ts>(args)...);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user