mirror of
https://github.com/ETLCPP/etl.git
synced 2026-04-30 19:09:10 +08:00
Synchronised etl::invoke_result with that in the etl::inplace_function branch
This commit is contained in:
parent
c8dc46ec9b
commit
06057b59ae
@ -183,19 +183,34 @@ namespace etl
|
||||
|
||||
//****************************************************************************
|
||||
/// invoke_result<TFunction, TArgs...>
|
||||
template <typename TFunction, typename ... TArgs>
|
||||
struct invoke_result;
|
||||
template <typename TFunction, typename, typename... TArgs>
|
||||
struct invoke_result
|
||||
{
|
||||
using type = void;
|
||||
};
|
||||
|
||||
//*******************************************
|
||||
template <typename TFunction, typename... TArgs>
|
||||
struct invoke_result<TFunction,
|
||||
etl::void_t<decltype(etl::invoke(etl::declval<TFunction>(), etl::declval<TArgs>()...))>,
|
||||
TArgs...>
|
||||
TArgs...>
|
||||
{
|
||||
using type = decltype(etl::invoke(etl::declval<TFunction>(), etl::declval<TArgs>()...));
|
||||
};
|
||||
|
||||
//*******************************************
|
||||
// Specialization to allow `etl::type_list<...>` as the second template parameter.
|
||||
template <typename TFunction, typename... TArgs>
|
||||
using invoke_result_t = typename invoke_result<TFunction, TArgs...>::type;
|
||||
struct invoke_result<TFunction,
|
||||
etl::void_t<decltype(etl::invoke(etl::declval<TFunction>(), etl::declval<TArgs>()...))>,
|
||||
etl::type_list<TArgs...>>
|
||||
{
|
||||
using type = decltype(etl::invoke(etl::declval<TFunction>(), etl::declval<TArgs>()...));
|
||||
};
|
||||
|
||||
//*******************************************
|
||||
template <typename TFunction, typename... TArgs>
|
||||
using invoke_result_t = typename invoke_result<TFunction, void, TArgs...>::type;
|
||||
|
||||
//****************************************************************************
|
||||
/// is_invocable<TFunction, TArgs...>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user