VIPRA Documentation
Loading...
Searching...
No Matches
include
vipra
util
invoke_result_or.hpp
1
#pragma once
2
3
#include <type_traits>
4
5
#include "vipra/types/util/result_or_void.hpp"
6
7
namespace
VIPRA::Util {
15
template
<
typename
result_t,
typename
func_t,
typename
... arg_ts>
16
// NOLINTNEXTLINE(readability-identifier-naming) utility struct
17
struct
invoke_result_or
{
18
using
type =
typename
std::conditional<std::is_same_v<func_t, VOID>, result_t,
19
std::invoke_result_t<func_t, arg_ts...>>::type;
20
};
21
29
template
<
typename
result_t,
typename
func_t,
typename
... arg_ts>
30
using
invoke_result_or_t =
typename
invoke_result_or
<result_t, func_t, arg_ts...>::type;
31
}
// namespace VIPRA::Util
VIPRA::Util::invoke_result_or
Utility class for getting the result of a function or a default type if the function returns void.
Definition
invoke_result_or.hpp:17
Generated by
1.13.2