Checks if product type contains a given identifier.
#include <kumi/kumi.hpp>
#include <iostream>
using namespace kumi::literals;
template<kumi::concepts::product_type T>
void check_contains(T const& t)
{
std::cout <<
"Correct product_type: " <<
get<
"value"_id>(t) <<
'\n';
else
std::cout << "Incorrect product type\n";
}
int main()
{
check_contains(
kumi::tuple{
"malus"_id = 6.5,
"value"_id = 17} );
}
constexpr bool contains(T &&t, K const &k) noexcept
Checks if product type contains a given identifier.
Definition contains.hpp:31
constexpr decltype(auto) get(record< Ts... > &&r) noexcept
This is an overloaded member function, provided for convenience. It differs from the above function o...
Definition record.hpp:506
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:29
#include <kumi/kumi.hpp>
#include <iostream>
using namespace kumi::literals;
template<kumi::concepts::product_type T>
void check_contains(T const& t)
{
std::cout <<
"Correct product_type: " <<
get<
"value"_id>(t) <<
'\n';
else
std::cout << "Incorrect product type\n";
}
int main()
{
check_contains(
kumi::record{
"malus"_id = 6.5,
"value"_id = 17} );
}
Fixed-size collection of heterogeneous fields necessarily named, names are unique.
Definition record.hpp:29