3#include "type_traits.hpp"
4#include "http/response.hpp"
20 template<
typename...>
typename V,
25 using type = V<http::response<Vargs>...>;
43 using unwrap_variant = std::conditional_t<std::variant_size_v<V> == 1, std::variant_alternative_t<0, V>, V>;
55 using bodies_for_t = std::invoke_result_t<
decltype(&F::body_for),
const F*,
const typename F::header_type&>;
58 template<
typename Bodies>
64 template<
typename Filter>
Definition: type_traits.hpp:123
Namespace for metaprogramming utils.
std::conditional_t< std::variant_size_v< V >==1, std::variant_alternative_t< 0, V >, V > unwrap_variant
Pattern: unwrap_variant<variant<T>> -> T unwrap_variant<variant<T, ...> -> std::variant<T,...
Definition: mp.hpp:43
unwrap_variant< V > body_type
Converts from a variant of possible bodies to the actual body type taken by callbacks.
Definition: mp.hpp:50
std::invoke_result_t< decltype(&F::body_for), const F *, const typename F::header_type & > bodies_for_t
Resolves the body type used by a filter F.
Definition: mp.hpp:55
typename decltype(detail::conv_to_resp_helper{std::declval< Bodies >()})::type to_responses
Converts a variant<T...> where T is body to a variant<response<T>...>
Definition: mp.hpp:60
unwrap_variant< to_responses< bodies_for_t< Filter > > > filter_resp_t
Resolves to the type that must be taken in callbacks handling responses for Filter.
Definition: mp.hpp:65
Helper to map variant<T...> to variant<response<T>...>
Definition: mp.hpp:24