KUMI v5.0.0
Gorgeous Garnet
Loading...
Searching...
No Matches
kumi::function::get_or

Returns the Ith element of t if t is a kumi::product_type, an instance of v otherwise. More...

Functions

template<std::size_t I, typename T, typename V>
constexpr decltype(auto) kumi::function::get_or (T &&t, V &&v)

Detailed Description

Returns the Ith element of t if t is a kumi::product_type, an instance of v otherwise.

Function Documentation

◆ get_or()

template<std::size_t I, typename T, typename V>
decltype(auto) kumi::function::get_or ( T && t,
V && v )
inlinenodiscardconstexpr
Note
Does not participate in overload resolution if I is out of [0, kumi::size_v<T>).
Template Parameters
ICompile-time index of the element to access
Parameters
tType to inspect
vFallback value
Returns
A reference to the selected element of t if t is a kumi::product_type, the parameter v otherwise.