Checks if a product type contains no fields based on any of the selected identifiers.
#include <kumi/kumi.hpp>
#include <iostream>
using namespace kumi::literals;
template<kumi::concepts::product_type T>
void check_contains(T const& )
{
std::cout << "Correct product_type\n";
else
std::cout << "Incorrect product type\n";
}
int main()
{
check_contains(
kumi::tuple{
"active"_id = std::bool_constant<true>{}});
check_contains(
kumi::tuple{
"malus"_id = 6.5,
"value"_id = 17} );
check_contains(
kumi::tuple{
"active"_id = std::bool_constant<true>{},
"value"_id = 17} );
check_contains(
kumi::tuple{
"active"_id = std::bool_constant<true>{},
"value"_id = 17,
"other"_id =
false});
}
constexpr bool contains_none(T &&t, Is const &... ids) noexcept
Checks if a product type contains no fields based on any of the selected identifiers.
Definition contains.hpp:119
Fixed-size collection of heterogeneous values.
Definition tuple.hpp:33
#include <kumi/kumi.hpp>
#include <iostream>
using namespace kumi::literals;
template<kumi::concepts::product_type T>
void check_contains(T const& )
{
std::cout << "Correct product_type\n";
else
std::cout << "Incorrect product type\n";
}
int main()
{
check_contains(
kumi::record{
"active"_id = std::bool_constant<true>{}});
check_contains(
kumi::record{
"malus"_id = 6.5,
"value"_id = 17} );
check_contains(
kumi::record{
"active"_id = std::bool_constant<true>{},
"value"_id = 17} );
check_contains(
kumi::record{
"active"_id = std::bool_constant<true>{},
"value"_id = 17,
"other"_id =
false});
}
Fixed-size collection of heterogeneous tagged fields, tags are unique.
Definition record.hpp:36