File partition.hpp
↰ Parent directory (include
)
Compile-time partitioning of a typelist based on a binary relation.
Definition (include/partition.hpp
)
Detailed Description
Splits an HTList<Ts...>
into two lists: those that satisfy a relation Rel<Pivot, T>::value
(the pass bucket) and those that don’t (the fail bucket). Aliases filter_by
and reject_if_by
expose the two buckets directly, and partition_by_key
lets you partition on derived key types (e.g., Size<T>
).
Example
//GivenRelthatcomparesElemvsPivotbysize(seePredBy/op_taginpredicates.hpp): usingL=:ref:exhale_struct_structctql_1_1detail_1_1HTList; usingP=:ref:exhale_struct_structctql_1_1partition__by; usingLeft=P::pass;//elementsXwithLessRel::pred<A,X>::value==true usingRight=P::fail;
Rel<Pivot, T>
must define a static constexpr bool value
.
Includes
htlist.hpp
(File htlist.hpp)predicates.hpp
(File predicates.hpp)type_traits