Callable object checking if a product type contains no fields based on any of the selected identifier.
#include <kumi/algorithm/contains.hpp>
constexpr auto contains_none(T && t, IDs
const&... ids)
noexcept;
constexpr contains_none_t contains_none
Callable object checking if a product type contains no fields based on any of the selected identifier...
Definition contains.hpp:275
identifier definition class
Definition identifier.hpp:86
- t: The product type to inspect
- ids: The identifiers to check for
- std::true_type if t contains no field labeled with any of the ids, std::false_type otherwise.
template<kumi::concepts::product_type T, kumi::concepts::identifier... IDs>
struct contains_none
{
};
template<kumi::concepts::product_type T, kumi::concepts::identifier... IDs>
using contains_none_t = typename kumi::result::contains_none<T, IDs...>::type;
Computes the return type of a call to kumi:contains_none
#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});
}
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