This commit is contained in:
Timur A. Fatkhullin
2024-01-21 01:57:15 +03:00
parent 096e74c099
commit 41a9c70e70
5 changed files with 224 additions and 43 deletions

View File

@@ -1,5 +1,6 @@
#pragma once
#include <ranges>
#include <tuple>
#include <type_traits>
@@ -14,6 +15,10 @@
namespace adc::traits
{
// range of char/const char
template <typename R>
concept adc_char_range = std::ranges::range<R> && std::is_same_v<std::remove_cv_t<std::ranges::range_value_t<R>>, char>;
// deduce returned type of callable
template <typename T>
using adc_retval_t = std::invoke_result_t<std::remove_cvref_t<T>>;
@@ -74,7 +79,7 @@ using adc_deduced_type =
// perfect-forwarding wrapper
template <typename T, typename... Ts>
auto adc_pf_wrapper(T&& v, Ts&&... vs)
constexpr static auto adc_pf_wrapper(T&& v, Ts&&... vs)
{
return std::tuple<adc_deduced_type<T>, adc_deduced_type<Ts>...>(std::forward<T>(v), std::forward<Ts>(vs)...);
}