kumi v3.1.0
Exquisite Epidote
 
Loading...
Searching...
No Matches

◆ member_cast()

template<typename Target , product_type T>
constexpr auto kumi::member_cast ( T &&  t)
inlineconstexpr

Converts a product_type<Ts...> to an instance of a product_type<Target...>

Template Parameters
Targetdestination type to assocaite to each member of the product type
Parameters
tProduct type to convert
Returns
A Product type containing the values of b where each member is of type Target

Helper type

namespace kumi::result
{
template<typename Target, product_type T> struct member_cast;
template<typename Target, Product_type T>
using member_cast_t = typename member_cast<Target, T>::type;
}
constexpr auto member_cast(T &&t)
Converts a product_type<Ts...> to an instance of a product_type<Target...>
Definition cast.hpp:84

Computes the return type of a call to kumi::member_cast

Example

#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
kumi::tuple a = { 14.f, 42, 55, short{89} };
auto b = kumi::member_cast<char>(a);
std::cout << a << "\n";
std::cout << b << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:37