Templa 0.0.1-alpha
C++ Metaprogramming Utilities
Loading...
Searching...
No Matches
convert.hpp
Go to the documentation of this file.
1#pragma once
2#include <iostream>
3#include <variant>
7
12namespace templa::convert
13{
14
25 template <typename... Ts>
26 struct convert_to_variant : std::type_identity<std::variant<Ts...>>
27 {
28 };
29
47 template <template <typename...> class From, typename... Ts>
48 struct convert_to_variant<From<Ts...>> : std::type_identity<std::variant<Ts...>>
49 {
50 };
51
62 template <typename... Ts>
63 struct convert_to_tuple : std::type_identity<std::tuple<Ts...>>
64 {
65 };
66
84 template <template <typename...> class From, typename... Ts>
85 struct convert_to_tuple<From<Ts...>> : std::type_identity<std::tuple<Ts...>>
86 {
87 };
88}
Converts a pack of types into a std::tuple of those types.
Definition convert.hpp:64
Converts a pack of types into a std::variant of those types.
Definition convert.hpp:27