KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches

◆ element_or_t

template<std::size_t I, typename T, typename U>
using kumi::function::element_or_t = std::remove_cvref_t<decltype(kumi::function::get_or<I>(std::declval<T>(), std::declval<U>()))>

#include <kumi/functional/monadic.hpp>

Computes the Ith element type of a kumi::product_type, or a fallback type U otherwise.

If T is a kumi::product_type and I is within its size, this alias resolves to element_t<I,T>, otherwise it resolves to U.

Template Parameters
IIndex of the element type to retrieve
TType to access
UFallback type

Helper type

namespace kumi
{
template<std::size_t I, typename T, typename U> using element_or_t = typename element_or<I,T,U>::type;
}
std::remove_cvref_t< decltype(kumi::function::get_or< I >(std::declval< T >(), std::declval< U >()))> element_or_t
Computes the Ith element type of a kumi::product_type, or a fallback type U otherwise.
Definition monadic.hpp:77
Main KUMI namespace.
Definition algorithm.hpp:11