.. _file_include_sorted.hpp: File sorted.hpp =============== |exhale_lsh| :ref:`Parent directory ` (``include``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS Compile-time quicksort over a heterogenous typelist. .. contents:: Contents :local: :backlinks: none Definition (``include/sorted.hpp``) ----------------------------------- .. toctree:: :maxdepth: 1 program_listing_file_include_sorted.hpp.rst Detailed Description -------------------- Sorts a ``detail::HTList<...>`` whose elements satisfy ``HasStaticSize`` (i.e., each exposes a ``static constexpr size`` convertible to ``std::size_t``). Order is controlled by ``Order::{Asc,Desc}`` and comparisons are routed through ``op_type<"...">`` predicates like ``"<"_ct``, ``">="_ct``, etc. Example structA{staticconstexprstd::size_tsize=3;}; structB{staticconstexprstd::size_tsize=1;}; structC{staticconstexprstd::size_tsize=2;}; usingL=:ref:`exhale_struct_structctql_1_1detail_1_1HTList`; usingSorted=:ref:`exhale_struct_structctql_1_1sort__list`;//==>HTList **Key mapping with TypeSort** //IfSizeisa"key"typethatitselfsatisfiesHasStaticSize(e.g.,Size::size=T::size), //TypeSortproducesalistofthekeys(nottheoriginalTs): usingOut=:ref:`exhale_typedef_sorted_8hpp_1ae6127fc54c05e4d80ea5380deec6f144`;//HTList,Size,Size> This is a quicksort-style split on the first element; it is not stable. @complexity Expected O(n log n) template instantiations; worst-case O(n^2). Includes -------- - ``htlist.hpp`` (:ref:`file_include_htlist.hpp`) - ``partition.hpp`` (:ref:`file_include_partition.hpp`) - ``predicates.hpp`` (:ref:`file_include_predicates.hpp`) Namespaces ---------- - :ref:`namespace_ctql` Classes ------- - :ref:`exhale_struct_structctql_1_1sort__list` - :ref:`exhale_struct_structctql_1_1sort__list_3_01Ord_00_01detail_1_1HTList_3_01T0_00_01TRest_8_8_8_01_4_01_4` - :ref:`exhale_struct_structctql_1_1sort__list_3_01Ord_00_01detail_1_1HTList_3_4_01_4` Enums ----- - :ref:`exhale_enum_sorted_8hpp_1a713d45acd6845b169e35ad797ecdd397` Typedefs -------- - :ref:`exhale_typedef_sorted_8hpp_1ae6127fc54c05e4d80ea5380deec6f144`