#include <kumi/kumi.hpp>
#include <iostream>
#include <string>
using namespace kumi::literals;
struct my_struct
{
int i;
float f;
};
template<std::size_t I>
decltype(
auto)
get(my_struct
const & m)
noexcept
{
}
template<std::size_t I>
decltype(
auto)
get(my_struct & m)
noexcept
{
}
template<>
{};
template<>
struct std::tuple_size<my_struct> : std::integral_constant<std::size_t,3>
{};
template<> struct std::tuple_element<0,my_struct> { using type = kumi::field<kumi::name<"i"> , int >; };
template<> struct std::tuple_element<1,my_struct> { using type = kumi::field<kumi::name<"f"> , float >; };
template<> struct std::tuple_element<2,my_struct> { using type = kumi::field<kumi::name<"name">, std::string>; };
int main()
{
using namespace kumi::literals;
std::cout << a << "\n";
std::cout << b.i << ' ' << b.f << ' ' << b.name << "\n";
}
decltype(auto) constexpr capture_field(T &&t) noexcept
Creates a field from a given value keeping the qualifiers.
Definition field.hpp:253
Opt-in traits for types behaving like a kumi::product_type.
Definition traits.hpp:97
Compile-time text based identifier.
Definition identifier.hpp:162
decltype(auto) constexpr get(record< Ts... > &r) noexcept
Extracts the Ith field from a kumi::record.
Definition record.hpp:604