.. _file_include_partition.hpp: File partition.hpp ================== |exhale_lsh| :ref:`Parent directory ` (``include``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS Compile-time partitioning of a typelist based on a binary relation. .. contents:: Contents :local: :backlinks: none Definition (``include/partition.hpp``) -------------------------------------- .. toctree:: :maxdepth: 1 program_listing_file_include_partition.hpp.rst Detailed Description -------------------- Splits an ``HTList`` into two lists: those that satisfy a relation ``Rel::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``). **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::value==true usingRight=P::fail; ``Rel`` must define a ``static constexpr bool value``. Includes -------- - ``htlist.hpp`` (:ref:`file_include_htlist.hpp`) - ``predicates.hpp`` (:ref:`file_include_predicates.hpp`) - ``type_traits`` Included By ----------- - :ref:`file_include_sorted.hpp` Namespaces ---------- - :ref:`namespace_ctql` Classes ------- - :ref:`exhale_struct_structctql_1_1partition__by` Typedefs -------- - :ref:`exhale_typedef_partition_8hpp_1a707849ebf32a3cf2aa9252430aa8f3ed` - :ref:`exhale_typedef_partition_8hpp_1a5b67c1b739e6cf726914dfa1b1536fee` - :ref:`exhale_typedef_partition_8hpp_1a32d0ffacbd052d05b6f8a74c23274a04`