35 template <
typename T, std::
size_t N>
44 template <auto GetArray, auto Predicate>
45 requires std::predicate<
decltype(Predicate),
typename decltype(GetArray())::value_type>
47 using value_type = typename decltype(GetArray())::value_type;
49 static constexpr auto value = [] {
50 constexpr auto array = GetArray();
51 constexpr auto actual_size = std::count_if(array.begin(), array.end(), Predicate);
54 std::array<value_type, actual_size> result{};
56 for (
auto&& item : array) {
57 if (Predicate(item)) {
58 result[index++] = item;
66 template <auto GetArray, auto Predicate>
67 requires std::predicate<
decltype(Predicate),
typename decltype(GetArray())::value_type>
68 inline constexpr auto filter_array_v = filter_array<GetArray, Predicate>::value;