Converts a product_type<Types...> to an instance of a product_type<Ts...>
- Template Parameters
-
| Ts | destination types to of each member of the product type |
- Parameters
-
- Returns
- A Product type containing the values of t where each member type is the corresponding type in the input pack.
Helper type
namespace kumi::result
{
using type_cast_t =
typename type_cast<Ts..., T>::type;
}
Concept specifying a type follows the Product Type semantic.
Definition concepts.hpp:33
constexpr auto type_cast(T &&t)
Converts a product_type<Types...> to an instance of a product_type<Ts...>
Definition cast.hpp:44
Computes the return type of a call to kumi::type_cast
Example
#include <kumi/kumi.hpp>
#include <iostream>
int main()
{
auto b = kumi::type_cast<int, bool, float, char>(a);
std::cout << a << "\n";
std::cout << b << "\n";
}
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:37