This commit is contained in:
Timur A. Fatkhullin
2024-05-01 17:17:05 +03:00
parent 066cb7cf95
commit 0d64e0cf44
5 changed files with 35 additions and 14 deletions

View File

@@ -55,6 +55,7 @@ struct adc_func_traits_helper_t<R> {
using ret_t = R;
using args_t = std::tuple<>;
using arg1_t = void;
static constexpr size_t arity = 0;
};
template <typename R, typename Arg, typename... Args>
@@ -62,6 +63,7 @@ struct adc_func_traits_helper_t<R, Arg, Args...> {
using ret_t = R;
using args_t = std::tuple<Arg, Args...>;
using arg1_t = Arg;
static constexpr size_t arity = sizeof...(Args) + 1;
};
@@ -109,7 +111,7 @@ using adc_func_arg1_t = typename adc_func_traits<T>::arg1_t;
template <typename T>
using adc_deduced_type =
std::conditional_t<std::is_lvalue_reference_v<T> && !std::is_const_v<std::remove_reference_t<T>>,
T,
T&,
std::remove_cvref_t<T>>;