C++ Essence Library 0.1.0
A Utility Library for Modern C++ Programming
Loading...
Searching...
No Matches
essence::index_if< List, Predicate > Struct Template Reference

Static Public Attributes

static constexpr auto value
 

Member Data Documentation

◆ value

template<type_list_like List, auto Predicate>
auto essence::index_if< List, Predicate >::value
staticconstexpr
Initial value:
= for_each_as_values<List>([]<typename... Ts>(std::type_identity<Ts>...) {
bool found{};
std::size_t index{std::numeric_limits<std::size_t>::max()};
auto handler = [&, counter = static_cast<std::size_t>(0)]<typename U>(std::type_identity<U>) mutable {
if (!found && Predicate(std::type_identity<U>{})) {
found = true;
index = counter;
}
counter++;
};
return (handler(std::type_identity<Ts>{}), ..., index);
})

The documentation for this struct was generated from the following file: