Open GuillaumeDua opened 9 months ago
WIP: https://godbolt.org/z/9vzT69f9G
// filters // Note: about `template <typename...> typename predicate` // instead of template <typename> typename predicate -> clang template <template <typename...> typename, typename> struct filters; template <template <typename...> typename predicate, template <typename...> typename pack, typename ... Ts> requires requires { ((predicate<Ts>::value) and ...); } struct filters<predicate, pack<Ts...>> : flatten_once< pack< std::conditional_t<predicate<Ts>::value, pack<Ts>, pack<>>... > > {}; template <template <typename...> typename predicate, typename pack> using filters_t = typename filters<predicate, pack>::type;
WIP: https://godbolt.org/z/9vzT69f9G