3#include "type_traits.hpp"
4#include "http/response.hpp"
22 template<
typename...>
typename V,
27 using type = V<http::response<Vargs>...>;
45 using unwrap_variant = std::conditional_t<std::variant_size_v<V> == 1, std::variant_alternative_t<0, V>, V>;
57 using bodies_for_t = std::invoke_result_t<
decltype(&F::body_for),
const F*,
const typename F::header_type&>;
60 template<
typename Bodies>
66 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:45
unwrap_variant< V > body_type
Converts from a variant of possible bodies to the actual body type taken by callbacks.
Definition: mp.hpp:52
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:57
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:62
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:67
Helper to map variant<T...> to variant<response<T>...>
Definition: mp.hpp:26