This commit is contained in:
2025-07-04 12:24:34 +03:00
parent 08b582b895
commit b3b275edd8
10 changed files with 1342 additions and 47 deletions

View File

@@ -124,15 +124,26 @@ template <typename F>
struct mcc_func_traits<F&&> : mcc_func_traits<F> {
};
// type of the returned value
template <typename T>
using mcc_retval_t = typename mcc_func_traits<T>::ret_t;
// type of the first argument of callable
template <typename T>
using mcc_func_arg1_t = typename mcc_func_traits<T>::arg1_t;
// type of the N-th argument of callable
// NOTE: starts from 1 not from 0!!!
template <typename T, size_t N = 1>
using mcc_func_argN_t = std::
conditional_t<N >= mcc_func_traits<T>::arity, std::tuple_element_t<N, typename mcc_func_traits<T>::args_t>, void>;
using mcc_func_argN_t = std::conditional_t<N >= mcc_func_traits<T>::arity,
std::tuple_element_t<N - 1, typename mcc_func_traits<T>::args_t>,
void>;
// non-const lvalue reference, constructible from CtorArgTs (an output argument of function)
template <typename T, typename... CtorArgTs>
concept mcc_output_arg_c = !std::is_const_v<std::remove_reference_t<T>> && std::is_lvalue_reference_v<T> &&
std::constructible_from<std::remove_reference_t<T>, CtorArgTs...>;
namespace details
{