\hypertarget{sort_8h_source}{}\doxysection{sort.\+h} \label{sort_8h_source}\index{kblib/sort.h@{kblib/sort.h}} \mbox{\hyperlink{sort_8h}{Go to the documentation of this file.}} \begin{DoxyCode}{0} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00001}00001 \textcolor{comment}{/* *****************************************************************************}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00002}00002 \textcolor{comment}{ * kblib is a general utility library for C++14 and C++17, intended to provide}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00003}00003 \textcolor{comment}{ * performant high-\/level abstractions and more expressive ways to do simple}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00004}00004 \textcolor{comment}{ * things.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00005}00005 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00006}00006 \textcolor{comment}{ * Copyright (c) 2021 killerbee}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00007}00007 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00008}00008 \textcolor{comment}{ * This program is free software: you can redistribute it and/or modify}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00009}00009 \textcolor{comment}{ * it under the terms of the GNU General Public License as published by}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00010}00010 \textcolor{comment}{ * the Free Software Foundation, either version 3 of the License, or}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00011}00011 \textcolor{comment}{ * (at your option) any later version.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00012}00012 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00013}00013 \textcolor{comment}{ * This program is distributed in the hope that it will be useful,}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00014}00014 \textcolor{comment}{ * but WITHOUT ANY WARRANTY; without even the implied warranty of}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00015}00015 \textcolor{comment}{ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00016}00016 \textcolor{comment}{ * GNU General Public License for more details.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00017}00017 \textcolor{comment}{ *}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00018}00018 \textcolor{comment}{ * You should have received a copy of the GNU General Public License}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00019}00019 \textcolor{comment}{ * along with this program. If not, see .}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00020}00020 \textcolor{comment}{ * ****************************************************************************/}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00021}00021 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00031}00031 \textcolor{preprocessor}{\#ifndef SORT\_H}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00032}00032 \textcolor{preprocessor}{\#define SORT\_H}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00033}00033 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00034}00034 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{algorithm_8h}{algorithm.h}}"{}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00035}00035 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{bits_8h}{bits.h}}"{}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00036}00036 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{fakestd_8h}{fakestd.h}}"{}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00037}00037 \textcolor{preprocessor}{\#include "{}\mbox{\hyperlink{simple_8h}{simple.h}}"{}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00038}00038 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00039}00039 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00040}00040 \textcolor{preprocessor}{\#include }} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00041}00041 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00042}00042 \textcolor{keyword}{namespace }\mbox{\hyperlink{tdecl_8h_a4b5c574c663a392148218cd4410fd7a1}{KBLIB\_NS}} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00043}00043 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00056}00056 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} Compare = std::less<>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00057}\mbox{\hyperlink{namespacekblib_a43cda388d529e7f9553850b366ef3380}{00057}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a43cda388d529e7f9553850b366ef3380}{insertion\_sort}}(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00058}00058 \textcolor{keyword}{const} RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00059}00059 Compare\&\& compare} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00060}00060 = \{\}) \textcolor{keyword}{noexcept}(\textcolor{keyword}{noexcept}(\mbox{\hyperlink{namespacekblib_a4aadfdece3872e99551aa812ac3bac27}{swap}}(*begin, *begin)) and \textcolor{keyword}{noexcept}(compare(*begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00061}00061 *begin)))} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00062}00062 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00063}00063 \textcolor{comment}{// Trivial inputs are trivially already sorted.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00064}00064 \textcolor{keywordflow}{if} (end -\/ begin <= 1) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00065}00065 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00066}00066 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00067}00067 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} pos = begin + 1; pos != end; ++pos) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00068}00068 \textcolor{comment}{// This search is linear, not binary, because insertion\_sort is meant}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00069}00069 \textcolor{comment}{// to never be used for arrays large enough for binary search.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00070}00070 \textcolor{keyword}{auto} index = \mbox{\hyperlink{namespacekblib_a4b49eacc73a9295677cb08d9b7892ff6}{kblib::find\_if}}(begin, pos, [\&compare, pos](\textcolor{keyword}{const} \textcolor{keyword}{auto}\& \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00071}00071 \textcolor{keywordflow}{return} compare(*pos, \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00072}00072 \});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00073}00073 \mbox{\hyperlink{namespacekblib_abe51624618b4a7c9f20e295b8c89bf47}{kblib::rotate}}(index, pos, pos + 1);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00074}00074 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00075}00075 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00076}00076 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00077}00077 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00091}00091 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} RandomAccessIt2,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00092}00092 \textcolor{keyword}{typename} Compare = std::less<>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00093}\mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{00093}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{insertion\_sort\_copy}}(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00094}00094 \textcolor{keyword}{const} RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00095}00095 \textcolor{keyword}{const} RandomAccessIt2 d\_begin, \textcolor{keyword}{const} RandomAccessIt2 d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00096}00096 Compare\&\& compare} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00097}00097 = \{\}) \textcolor{keyword}{noexcept}(\textcolor{keyword}{noexcept}(detail\_algorithm::} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00098}00098 \mbox{\hyperlink{namespacekblib_1_1detail__algorithm_a7e9dcc6ba8db08f7ca672ea9f6f20f5a}{shift\_backward}}(d\_begin, d\_begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00099}00099 d\_end)) and \textcolor{keyword}{noexcept}(*d\_begin} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00100}00100 = *begin))} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00101}00101 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00102}00102 \textcolor{keyword}{const} \textcolor{keyword}{auto} dist = end -\/ begin;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00103}00103 assert(end -\/ begin == d\_end -\/ d\_begin);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00104}00104 \textcolor{keywordflow}{if} (dist == 0) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00105}00105 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00106}00106 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (dist == 1) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00107}00107 \textcolor{comment}{// ranges of 1 are trivial to sort}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00108}00108 *d\_begin = *begin;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00109}00109 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00110}00110 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (dist == 2) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00111}00111 \textcolor{comment}{// Special case distance=2 to perform no swaps, and because the loop}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00112}00112 \textcolor{comment}{// for the general case assumes 3 or more elements.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00113}00113 \textcolor{keywordflow}{if} (compare(*begin, *(begin + 1))) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00114}00114 *d\_begin = *begin;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00115}00115 *(d\_begin + 1) = *(begin + 1);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00116}00116 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00117}00117 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00118}00118 *d\_begin = *(begin + 1);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00119}00119 *(d\_begin + 1) = *begin;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00120}00120 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00121}00121 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00122}00122 \textcolor{comment}{// This loop writes in reverse because shifting backwards can be done}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00123}00123 \textcolor{comment}{// in a forward pass, making it simpler than a forward shift, and is}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00124}00124 \textcolor{comment}{// sufficient for the algorithm, and reads in reverse to avoid worst-\/}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00125}00125 \textcolor{comment}{// case complexity for sorted inputs, given that it writes in reverse.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00126}00126 \textcolor{keyword}{auto} read = std::prev(end);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00127}00127 \textcolor{keyword}{auto} write = std::prev(d\_end);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00128}00128 \textcolor{comment}{// push first element to get the loop invariant}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00129}00129 *write = *read;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00130}00130 \textcolor{keywordflow}{do} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00131}00131 -\/-\/read, -\/-\/write;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00132}00132 \textcolor{comment}{// This search is linear, not binary, because insertion\_sort\_copy}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00133}00133 \textcolor{comment}{// is meant to never be used for arrays large enough for binary}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00134}00134 \textcolor{comment}{// search.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00135}00135 \textcolor{preprocessor}{\#if 1}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00136}00136 \textcolor{keyword}{auto} index = \mbox{\hyperlink{namespacekblib_a4b49eacc73a9295677cb08d9b7892ff6}{kblib::find\_if}}(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00137}00137 write + 1, d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00138}00138 [\&compare, read](\textcolor{keyword}{const} \textcolor{keyword}{auto}\& \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}) \{ \textcolor{keywordflow}{return} not compare(\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, *read); \});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00139}00139 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00140}00140 \textcolor{keyword}{auto} index = \mbox{\hyperlink{namespacekblib_a4b49eacc73a9295677cb08d9b7892ff6}{kblib::find\_if}}(write + 1, d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00141}00141 [\&compare, read](\textcolor{keyword}{const} \textcolor{keyword}{auto}\& \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00142}00142 \textcolor{keywordflow}{if} (stable) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00143}00143 \textcolor{comment}{// find first element greater than}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00144}00144 \textcolor{comment}{// *read}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00145}00145 \textcolor{keywordflow}{return} compare(*read, \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00146}00146 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00147}00147 \textcolor{comment}{// find first element greater than}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00148}00148 \textcolor{comment}{// or equal to *read}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00149}00149 \textcolor{keywordflow}{return} ! compare(\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, *read);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00150}00150 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00151}00151 \});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00152}00152 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00153}00153 \mbox{\hyperlink{namespacekblib_1_1detail__algorithm_a7e9dcc6ba8db08f7ca672ea9f6f20f5a}{detail\_algorithm::shift\_backward}}(write, write + 1, index);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00154}00154 *(index -\/ 1) = *read;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00155}00155 \} \textcolor{keywordflow}{while} (write != d\_begin);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00156}00156 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00157}00157 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00158}00158 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00159}00159 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00176}00176 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} RandomAccessIt2,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00177}00177 \textcolor{keyword}{typename} Compare = std::less<>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00178}\mbox{\hyperlink{namespacekblib_a707446076d1cc9e803e1041117924a73}{00178}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a707446076d1cc9e803e1041117924a73}{adaptive\_insertion\_sort\_copy}}(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00179}00179 \textcolor{keyword}{const} RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00180}00180 \textcolor{keyword}{const} RandomAccessIt2 d\_begin, \textcolor{keyword}{const} RandomAccessIt2 d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00181}00181 Compare\&\& compare} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00182}00182 = \{\}) \textcolor{keyword}{noexcept}(\textcolor{keyword}{noexcept}(detail\_algorithm::} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00183}00183 \mbox{\hyperlink{namespacekblib_1_1detail__algorithm_a7e9dcc6ba8db08f7ca672ea9f6f20f5a}{shift\_backward}}(d\_begin, d\_begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00184}00184 d\_end)) and \textcolor{keyword}{noexcept}(*d\_begin} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00185}00185 = *begin))} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00186}00186 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00187}00187 \textcolor{keyword}{const} \textcolor{keyword}{auto} dist = end -\/ begin;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00188}00188 \textcolor{comment}{// For trivial inputs, don't bother doing anything}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00189}00189 \textcolor{keywordflow}{if} (dist < 3) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00190}00190 \mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{insertion\_sort\_copy}}(begin, end, d\_begin, d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00191}00191 std::forward(compare));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00192}00192 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00193}00193 \textcolor{comment}{// A very rudimentary way of estimating the sortedness of the input, by}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00194}00194 \textcolor{comment}{// counting the relative number of ascending and descending adjacent pairs}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00195}00195 \textcolor{comment}{// within the first sqrt(n) elements.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00196}00196 \textcolor{keyword}{const} \textcolor{keyword}{auto} scan\_end} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00197}00197 = begin} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00198}00198 + \textcolor{keyword}{static\_cast<}std::ptrdiff\_t\textcolor{keyword}{>}(std::sqrt(\textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{float}\textcolor{keyword}{>}(dist)));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00199}00199 std::ptrdiff\_t dir\{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00200}00200 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} pos = begin; pos != scan\_end -\/ 1; ++pos) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00201}00201 \textcolor{keywordflow}{if} (compare(*pos, *(pos + 1))) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00202}00202 ++dir;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00203}00203 \} \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (compare(*(pos + 1), *pos)) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00204}00204 -\/-\/dir;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00205}00205 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00206}00206 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00207}00207 \textcolor{keywordflow}{if} (dir >= 0) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00208}00208 \mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{insertion\_sort\_copy}}(begin, end, d\_begin, d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00209}00209 std::forward(compare));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00210}00210 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00211}00211 \textcolor{comment}{// If the input is predominantly in reverse order, sort it in reverse}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00212}00212 \textcolor{comment}{// IMPORTANT: the reverse iterators go end, begin}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00213}00213 \mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{insertion\_sort\_copy}}(std::make\_reverse\_iterator(end),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00214}00214 std::make\_reverse\_iterator(begin), d\_begin, d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00215}00215 std::forward(compare));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00216}00216 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00217}00217 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00218}00218 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00219}00219 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T, \textcolor{keyword}{typename} = \textcolor{keywordtype}{void}>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00220}\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{00220}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable}} : std::false\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00221}00221 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00222}00222 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00223}\mbox{\hyperlink{structkblib_1_1is__radix__sortable_3_01_t_00_01void__if__t_3_01std_1_1is__integral_3_01_t_01_4_1_1value_01_4_01_4}{00223}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable}}::value>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00224}00224 : std::true\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00225}00225 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00226}00226 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00227}\mbox{\hyperlink{structkblib_1_1is__radix__sortable_3_01_t_00_01void__if__t_3_01std_1_1is__enum_3_01_t_01_4_1_1value_01_4_01_4}{00227}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable}}::value>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00228}00228 : std::true\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00229}00229 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00230}00230 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00231}\mbox{\hyperlink{structkblib_1_1is__radix__sortable_3_01std_1_1bitset_3_01_b_01_4_00_01void_01_4}{00231}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable}}<\mbox{\hyperlink{namespacestd}{std}}::bitset, void> : std::true\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00232}00232 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00233}00233 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00234}\mbox{\hyperlink{structkblib_1_1is__radix__sortable_3_01_t_00_01void__if__t_3_01is__linear__container__v_3_01_t_0e0a5e14e1e0c00645c6c7783f7f45255}{00234}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00235}00235 T, \mbox{\hyperlink{namespacekblib_ab3cc24416f0b9a6504e1c6a437ed6230}{void\_if\_t}} and \mbox{\hyperlink{namespacestd}{std}}::is\_integral::value>>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00237}00237 : std::true\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00238}00238 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00239}00239 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00240}\mbox{\hyperlink{namespacekblib_ab58211612f119bcfedd22ca4ef9999de}{00240}} \textcolor{keyword}{constexpr} \textcolor{keywordtype}{bool} \mbox{\hyperlink{namespacekblib_ab58211612f119bcfedd22ca4ef9999de}{is\_radix\_sortable\_v}} = \mbox{\hyperlink{structkblib_1_1is__radix__sortable}{is\_radix\_sortable::value}};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00241}00241 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00242}00242 \textcolor{preprocessor}{\#if \_\_cpp\_lib\_byte}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00243}00243 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00244}00244 \textcolor{keyword}{constexpr} \textcolor{keywordtype}{bool} \mbox{\hyperlink{namespacekblib_ad80f4ade2acc180c9caf217300f2ffa5}{is\_byte\_v}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00245}00245 = std::is\_same::type, std::byte>::value;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00246}00246 \textcolor{preprocessor}{\#else}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00247}00247 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00248}\mbox{\hyperlink{namespacekblib_ad80f4ade2acc180c9caf217300f2ffa5}{00248}} \textcolor{keyword}{constexpr} \textcolor{keywordtype}{bool} \mbox{\hyperlink{namespacekblib_ad80f4ade2acc180c9caf217300f2ffa5}{is\_byte\_v}} = \textcolor{keyword}{false};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00249}00249 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00250}00250 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00251}00251 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00252}\mbox{\hyperlink{namespacekblib_a407763ccb393b23e4d9616cd76f03fe5}{00252}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(T) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00253}00253 -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t::value}}, std::size\_t> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00254}00254 \textcolor{keyword}{auto} res} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00255}00255 = \mbox{\hyperlink{namespacekblib_abe1c06264c5e7d5b720416ff9d399fa6}{kblib::div}}(kblib::bits\_of + std::is\_signed::value, CHAR\_BIT);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00256}00256 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_af9e250fffa2922e623baa08aa8994f54}{to\_unsigned}}(res.quot + (res.rem != 0));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00257}00257 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00258}00258 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00259}00259 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(T) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00260}00260 -\/> enable\_if\_t::value, std::size\_t> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00261}00261 \textcolor{keyword}{using }U = \textcolor{keyword}{typename} std::underlying\_type::type;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00262}00262 \textcolor{keyword}{auto} res} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00263}00263 = \mbox{\hyperlink{namespacekblib_abe1c06264c5e7d5b720416ff9d399fa6}{kblib::div}}(kblib::bits\_of + std::is\_signed::value, CHAR\_BIT);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00264}00264 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_af9e250fffa2922e623baa08aa8994f54}{to\_unsigned}}(res.quot + (res.rem != 0));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00265}00265 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00266}00266 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00267}\mbox{\hyperlink{namespacekblib_aafdfcc252a37b2ca60ce1807d188d658}{00267}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(T*) \textcolor{keyword}{noexcept} -\/> std::size\_t \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00268}00268 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(std::uintptr\_t\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00269}00269 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00270}00270 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00271}\mbox{\hyperlink{namespacekblib_afca31fdc704e55f5ffabeea66e533794}{00271}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(\textcolor{keyword}{const} std::unique\_ptr\&) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00272}00272 -\/> std::size\_t \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00273}00273 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(std::uintptr\_t\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00274}00274 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00275}00275 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00276}\mbox{\hyperlink{namespacekblib_a913269f668b6359d0ebc552f8fdb9bc6}{00276}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(\textcolor{keyword}{const} T\& x) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00277}00277 is\_linear\_container\_v<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00278}00278 T> and (std::is\_integral::value or is\_byte\_v)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00279}00279 and \textcolor{keyword}{sizeof}(\textcolor{keyword}{typename} T::value\_type) == 1,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00280}00280 std::size\_t> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00281}00281 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{fakestd::size}}(x);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00282}00282 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00283}00283 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00284}00284 \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(\textcolor{keyword}{const} T\& x) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00285}00285 is\_linear\_container\_v and std::is\_integral::value} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00286}00286 and (\textcolor{keyword}{sizeof}(\textcolor{keyword}{typename} T::value\_type) > 1),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00287}00287 std::size\_t> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00288}00288 \textcolor{keyword}{using }value\_type = \textcolor{keyword}{typename} T::value\_type;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00289}00289 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{fakestd::size}}(x) * \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(value\_type\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00290}00290 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00291}00291 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00292}00292 \textcolor{comment}{// Can be used to detect unsupported types with overload resolution.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00293}00293 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00294}00294 \textcolor{comment}{// cert-\/dcl50-\/cpp: An exception to the rule for defining as deleted is not}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00295}00295 \textcolor{comment}{// implemented by clang-\/tidy. This definition does not pose a security risk.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00296}\mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{00296}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(...) -\/> \textcolor{keywordtype}{void} = \textcolor{keyword}{delete};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00297}00297 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00298}00298 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00299}\mbox{\hyperlink{namespacekblib_ae8bc9b87eff6f20b23a0da335c9501b9}{00299}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(T x, std::size\_t idx) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00300}00300 -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t::value}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00301}00301 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(x >> (idx * CHAR\_BIT));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00302}00302 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00303}00303 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00304}\mbox{\hyperlink{namespacekblib_a9eb65dc24cfed091382a277d77ac00a0}{00304}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(\textcolor{keyword}{const} T\& x,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00305}00305 std::size\_t idx) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00306}00306 -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t::value}}, \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00307}00307 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(\mbox{\hyperlink{namespacekblib_adceb810a61acaa78f10a700d1618aad7}{etoi}}(x) >> (idx * CHAR\_BIT));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00308}00308 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00309}00309 \textcolor{comment}{// Note that the ordering created by casting to std::uintptr\_t may not agree}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00310}00310 \textcolor{comment}{// with the ordering imposed by std::less.}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00311}00311 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00312}\mbox{\hyperlink{namespacekblib_aa0ce497444d4994f7a2c9832e415f607}{00312}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(T* x, std::size\_t idx) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00313}00313 -\/> \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00314}00314 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(byte\_cast(x), idx);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00315}00315 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00316}00316 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00317}\mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{00317}} \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(\textcolor{keyword}{const} std::unique\_ptr\& x,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00318}00318 std::size\_t idx) \textcolor{keyword}{noexcept} -\/> \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00319}00319 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(byte\_cast(x.get()), idx);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00320}00320 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00321}00321 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00322}00322 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00323}00323 \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(\textcolor{keyword}{const} T\& x, std::size\_t idx) \textcolor{keyword}{noexcept} -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00324}00324 is\_linear\_container\_v<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00325}00325 T> and (std::is\_integral::value or is\_byte\_v)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00326}00326 and \textcolor{keyword}{sizeof}(\textcolor{keyword}{typename} T::value\_type) == 1,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00327}00327 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00328}00328 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(x[idx]);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00329}00329 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00330}00330 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00331}00331 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(\textcolor{keyword}{const} T\& x,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00332}00332 std::size\_t idx) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00333}00333 -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}} and std::is\_integral::value} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00335}00335 and (\textcolor{keyword}{sizeof}(\textcolor{keyword}{typename} T::value\_type) > 1),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00336}00336 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00337}00337 \textcolor{keyword}{using }value\_type = \textcolor{keyword}{typename} T::value\_type;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00338}00338 \textcolor{keyword}{auto} bytes\_per = \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(value\_type\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00339}00339 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(\mbox{\hyperlink{namespacekblib_af9e250fffa2922e623baa08aa8994f54}{to\_unsigned}}(x[idx / bytes\_per])} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00340}00340 >> (idx \% bytes\_per * CHAR\_BIT));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00341}00341 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00342}00342 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00343}00343 \mbox{\hyperlink{tdecl_8h_a7f62d0731631a0e7675f45924b7f5ea0}{KBLIB\_NODISCARD}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_adaffd058800d74e8a1573f1f15b8ec11}{get\_byte\_index}}(\textcolor{keyword}{const} T\& x,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00344}00344 std::size\_t idx) \textcolor{keyword}{noexcept}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00345}00345 -\/> \mbox{\hyperlink{namespacekblib_a366272ad8baad19be4ccf8128afb04a3}{enable\_if\_t}} and std::is\_enum::value,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00347}00347 \textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00348}00348 \textcolor{keyword}{using }U = \textcolor{keyword}{typename} std::underlying\_type::type;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00349}00349 \textcolor{keyword}{auto} bytes\_per = \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(U\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00350}00350 \textcolor{keywordflow}{return} \textcolor{keyword}{static\_cast<}\textcolor{keywordtype}{unsigned} \textcolor{keywordtype}{char}\textcolor{keyword}{>}(\mbox{\hyperlink{namespacekblib_af9e250fffa2922e623baa08aa8994f54}{to\_unsigned}}(\mbox{\hyperlink{namespacekblib_adceb810a61acaa78f10a700d1618aad7}{etoi}}(x[idx / bytes\_per]))} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00351}00351 >> (idx \% bytes\_per * CHAR\_BIT));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00352}00352 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00353}00353 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00354}00354 \textcolor{keyword}{template} <\textcolor{keyword}{typename} T>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00355}\mbox{\hyperlink{structkblib_1_1is__trivial__transformation}{00355}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__trivial__transformation}{is\_trivial\_transformation}}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00356}00356 : \mbox{\hyperlink{namespacekblib_aab6846d277428f1e4b61ced2ed64dd0b}{bool\_constant}}::value> \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00357}00357 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00358}00358 \textcolor{keyword}{template} <>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00359}\mbox{\hyperlink{structkblib_1_1is__trivial__transformation_3_01identity_01_4}{00359}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1is__trivial__transformation}{is\_trivial\_transformation}}<\mbox{\hyperlink{structkblib_1_1identity}{identity}}> : std::true\_type \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00360}00360 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00361}\mbox{\hyperlink{namespacekblib_1_1detail__sort}{00361}} \textcolor{keyword}{namespace }detail\_sort \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00362}00362 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00363}00363 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} Compare>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00364}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a3b873e1b1c2c3a4865638d2c904c4c1d}{00364}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a3b409f97a9a14760031484b8285f7534}{sort}}(RandomAccessIt, \textcolor{keyword}{const} RandomAccessIt, Compare) -\/> \textcolor{keywordtype}{void} \{\}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00365}00365 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} Compare>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00366}\mbox{\hyperlink{namespacekblib_1_1detail__sort_af5a02e7ee5bdc9865f19946e829dff5e}{00366}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_af5a02e7ee5bdc9865f19946e829dff5e}{stable\_sort}}(RandomAccessIt, \textcolor{keyword}{const} RandomAccessIt, Compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00367}00367 -\/> \textcolor{keywordtype}{void} \{\}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00368}00368 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00369}00369 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} Compare, std::\textcolor{keywordtype}{size\_t} small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00370}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a00851154e70e649ffb1972b0cb461199}{00370}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_a00851154e70e649ffb1972b0cb461199}{merge\_sort}}(RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00371}00371 Compare cmp) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00372}00372 \textcolor{keywordflow}{if} (end -\/ begin <= small\_size) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00373}00373 \mbox{\hyperlink{namespacekblib_a43cda388d529e7f9553850b366ef3380}{insertion\_sort}}(begin, end, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00374}00374 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00375}00375 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00376}00376 \textcolor{keyword}{auto} middle = begin + (end -\/ begin) / 2;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00377}00377 \mbox{\hyperlink{namespacekblib_1_1detail__sort_a00851154e70e649ffb1972b0cb461199}{merge\_sort}}(begin, middle, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00378}00378 \mbox{\hyperlink{namespacekblib_1_1detail__sort_a00851154e70e649ffb1972b0cb461199}{merge\_sort}}(middle, end, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00379}00379 std::inplace\_merge(begin, middle, end, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00380}00380 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00381}00381 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00382}00382 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00383}00383 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00384}00384 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} Compare, std::\textcolor{keywordtype}{size\_t} small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00385}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a280b17f79cf4bcc871b9eb23de612dba}{00385}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_a280b17f79cf4bcc871b9eb23de612dba}{heap\_sort}}(RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00386}00386 Compare cmp) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00387}00387 std::make\_heap(begin, end, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00388}00388 \textcolor{keywordflow}{while} (begin != end) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00389}00389 std::pop\_heap(begin, end-\/-\/, cmp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00390}00390 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00391}00391 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00392}00392 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00393}00393 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00394}\mbox{\hyperlink{namespacekblib_1_1detail__sort_ae4569ffb1f5bfbe2b7792cba89647a07}{00394}} \textcolor{keyword}{enum class} \mbox{\hyperlink{namespacekblib_1_1detail__sort_ae4569ffb1f5bfbe2b7792cba89647a07}{sort\_direction}} \{ \mbox{\hyperlink{namespacekblib_1_1detail__sort_ae4569ffb1f5bfbe2b7792cba89647a07a9c9ab624360885fcf93b7643c93b6748}{ascending}}, \mbox{\hyperlink{namespacekblib_1_1detail__sort_ae4569ffb1f5bfbe2b7792cba89647a07ab19e9805fd7727c52ca04dfa3d24a2e5}{descending}} \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00395}00395 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00396}00396 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00397}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a0f3e1fc1f2ed59538aa52f01165b5c81}{00397}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_a0f3e1fc1f2ed59538aa52f01165b5c81}{radix\_sort\_i}}(RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00398}00398 Projection proj) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00399}00399 \textcolor{keyword}{using }E = \mbox{\hyperlink{namespacekblib_a9dcf2233bc360ff26fbbf82d98cdc64d}{decay\_t}}<\textcolor{keyword}{decltype}(proj(*begin))>;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00400}00400 \textcolor{keyword}{const} \textcolor{keyword}{auto} max\_bytes = \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(E\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00401}00401 \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto} \textcolor{keywordtype}{byte} : \mbox{\hyperlink{namespacekblib_a72690688922a2d4ae9a3e46ff0c1a9a9}{range}}(max\_bytes)) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00402}00402 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} it = begin; it != end; ++it) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00403}00403 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00404}00404 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00405}00405 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00406}00406 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00407}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a9c74bbb469dc7a2355b5d62913e9dfd9}{00407}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_a9c74bbb469dc7a2355b5d62913e9dfd9}{radix\_sort\_s}}(RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00408}00408 Projection proj) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00409}00409 \textcolor{keywordflow}{if} (begin != end) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00410}00410 \textcolor{keyword}{const} \textcolor{keyword}{auto} max\_bytes = \mbox{\hyperlink{namespacekblib_abedf2e5c556e6ab3ebb779227172a2ac}{kblib::accumulate}}(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00411}00411 begin, end, std::size\_t\{\}, [\&](\textcolor{keyword}{auto} m, \textcolor{keyword}{const} \textcolor{keyword}{auto}\& el) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00412}00412 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{max}}(m, \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(proj(*el)));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00413}00413 \});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00414}00414 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00415}00415 \textcolor{keyword}{const} \textcolor{keyword}{auto} max\_bytes = [\&] \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00416}00416 std::size\_t max\_bytes\{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00417}00417 \textcolor{keywordflow}{for} (\textcolor{keyword}{const} \textcolor{keyword}{auto} v : \mbox{\hyperlink{namespacekblib_a893a2961c20b0657dffbbd2fe8f362c4}{indirect}}(begin, end)) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00418}00418 max\_bytes = \mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{max}}(max\_bytes, \mbox{\hyperlink{namespacekblib_a84bbf075be5e924b9ff6efd6fb9ea0de}{byte\_count}}(v));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00419}00419 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00420}00420 \textcolor{keywordflow}{return} max\_bytes;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00421}00421 \}();} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00422}00422 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00423}00423 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00424}00424 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00425}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a2ff494c126d5f8be25c0602e00b5ff2d}{00425}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_ad77575019d9733392aebfdbb371d7323}{make\_array\_for}}(std::false\_type)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00426}00426 -\/> \mbox{\hyperlink{structkblib_1_1containing__ptr}{kblib::containing\_ptr}}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00427}00427 \textcolor{keywordflow}{return} \{\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00428}00428 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00429}00429 \textcolor{keyword}{template} } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00430}\mbox{\hyperlink{namespacekblib_1_1detail__sort_ad77575019d9733392aebfdbb371d7323}{00430}} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_ad77575019d9733392aebfdbb371d7323}{make\_array\_for}}(std::true\_type)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00431}00431 -\/> \mbox{\hyperlink{classkblib_1_1heap__value}{kblib::heap\_value}}> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00432}00432 \textcolor{keywordflow}{return} \{\mbox{\hyperlink{namespacekblib_af44abb883b069d84630176b4b8cd26f6}{in\_place\_agg}}\};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00433}00433 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00434}00434 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00435}00435 \textcolor{keyword}{template} <\mbox{\hyperlink{namespacekblib_1_1detail__sort_ae4569ffb1f5bfbe2b7792cba89647a07}{sort\_direction}} dir, \textcolor{keyword}{typename} RandomAccessIt1,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00436}00436 \textcolor{keyword}{typename} RandomAccessIt2, \textcolor{keyword}{typename} Projection>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00437}\mbox{\hyperlink{namespacekblib_1_1detail__sort_a0ae455fa600a4399c16b1159b04ec5c9}{00437}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1detail__sort_a0ae455fa600a4399c16b1159b04ec5c9}{counting\_sort}}(RandomAccessIt1 begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00438}00438 \textcolor{keyword}{const} RandomAccessIt1 end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00439}00439 RandomAccessIt2 d\_begin, Projection proj)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00440}00440 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00441}00441 \textcolor{keyword}{using }E = \mbox{\hyperlink{namespacekblib_a9dcf2233bc360ff26fbbf82d98cdc64d}{decay\_t}}<\textcolor{keyword}{decltype}(proj(*begin))>;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00442}00442 \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}} = std::numeric\_limits>\mbox{\hyperlink{namespacekblib_1_1nums_a64067ecc4167ce1cfe32860ef5c1dc47}{::max}}();} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00443}00443 \textcolor{keyword}{auto} count = make\_array\_for(\mbox{\hyperlink{namespacekblib_aab6846d277428f1e4b61ced2ed64dd0b}{bool\_constant}}<(\mbox{\hyperlink{namespacekblib_1_1fakestd_adb8781bc0e5d1ba4ca4624293c0c98ae}{size}} > 256)>\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00444}00444 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00445}00445 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} cur = begin; cur != end; ++cur) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00446}00446 ++count-\/>at(proj(*cur));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00447}00447 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00448}00448 \mbox{\hyperlink{namespacekblib_aa51ef49b30290e4d7d6f7201e58560c1}{kblib::transform\_exclusive\_scan}}(begin(*count), end(*count), begin(*count),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00449}00449 std::size\_t\{\}, std::plus<>\{\}, proj);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00450}00450 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00451}00451 \textcolor{keywordflow}{for} (\textcolor{keyword}{auto} cur = end; cur != begin; -\/-\/cur) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00452}00452 \textcolor{keyword}{auto} el = std::prev(cur);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00453}00453 d\_begin[-\/-\/count-\/>at(proj(*el))] = *el;} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00454}00454 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00455}00455 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00456}00456 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00457}00457 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00458}00458 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00464}00464 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00465}00465 \textcolor{keyword}{typename} BinaryPredicate, \textcolor{keyword}{typename} SortKey,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00466}00466 std::size\_t small\_size = 8,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00467}00467 \textcolor{keywordtype}{bool} = \mbox{\hyperlink{structkblib_1_1is__trivial__transformation}{is\_trivial\_transformation::value}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00468}00468 \textcolor{keywordtype}{bool} = std::is\_fundamental::value,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00469}00469 \textcolor{keywordtype}{bool} = is\_radix\_sortable\_v,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00470}00470 \textcolor{keywordtype}{bool} = std::is\_integral::value>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00471}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{00471}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00472}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a3d5db74e9bdec96c0550d7960a4f1529}{00472}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a3d5db74e9bdec96c0550d7960a4f1529}{inplace}}(RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00473}00473 \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00474}00474 UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00475}00475 BinaryPredicate\&\& compare) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00476}00476 \textcolor{keyword}{auto} comp} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00477}00477 = [\&compare, \&\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}](RandomAccessIt \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, RandomAccessIt b) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00478}00478 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(compare, \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00479}00479 \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *b));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00480}00480 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00481}00481 \textcolor{keywordflow}{if} (end -\/ begin < small\_size) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00482}00482 \mbox{\hyperlink{namespacekblib_a43cda388d529e7f9553850b366ef3380}{insertion\_sort}}(begin, end, comp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00483}00483 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00484}00484 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00486}00486 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00487}00487 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00488}00488 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00489}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a0a9c12e67f48dbf232c169b39250181d}{00489}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a0a9c12e67f48dbf232c169b39250181d}{scratch}}(RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00490}00490 \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00491}00491 UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00492}00492 BinaryPredicate\&\& compare) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00493}00493 \textcolor{keyword}{auto} comp} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00494}00494 = [\&compare, \&\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}](RandomAccessIt \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, RandomAccessIt b) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00495}00495 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(compare, \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00496}00496 \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *b));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00497}00497 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00498}00498 \textcolor{keywordflow}{if} (end -\/ begin < small\_size) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00499}00499 \mbox{\hyperlink{namespacekblib_a43cda388d529e7f9553850b366ef3380}{insertion\_sort}}(begin, end, comp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00500}00500 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00501}00501 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00503}00503 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00504}00504 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00505}00505 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00506}00506 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt2>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00507}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a451fa8cd05250bb8a288d7d5cfe89d61}{00507}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_a451fa8cd05250bb8a288d7d5cfe89d61}{copy}}(RandomAccessIt begin, \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00508}00508 RandomAccessIt2 d\_begin, RandomAccessIt2 d\_end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00509}00509 UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00510}00510 BinaryPredicate\&\& compare) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00511}00511 \textcolor{keyword}{auto} comp} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00512}00512 = [\&compare, \&\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}](RandomAccessIt \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, RandomAccessIt b) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00513}00513 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(compare, \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00514}00514 \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *b));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00515}00515 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00516}00516 \textcolor{keywordflow}{if} (end -\/ begin < small\_size) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00517}00517 \mbox{\hyperlink{namespacekblib_a654de993e7d26592cdc4e05443150296}{insertion\_sort\_copy}}(begin, end, d\_begin, d\_end, comp);} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00518}00518 \textcolor{keywordflow}{return};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00519}00519 \} \textcolor{keywordflow}{else} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00521}00521 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00522}00522 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00523}00523 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00524}00524 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00525}00525 \textcolor{preprocessor}{\#if 1}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00531}00531 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00532}00532 \textcolor{keyword}{typename} BinaryPredicate, \textcolor{keyword}{typename} SortKey, std::size\_t small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00533}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation935542bc395b86fd33cf9be63ad3de74}{00533}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00535}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation935542bc395b86fd33cf9be63ad3de74_a8c04627b9d1cf01790c456c25c5cabd0}{00535}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation935542bc395b86fd33cf9be63ad3de74_a8c04627b9d1cf01790c456c25c5cabd0}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00536}00536 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00537}00537 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00538}00538 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} BinaryPredicate\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00539}00539 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00540}00540 \textcolor{keyword}{auto} comp} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00541}00541 = [\&compare, \&\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}](RandomAccessIt \mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}, RandomAccessIt b) \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00542}00542 \textcolor{keywordflow}{return} \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(compare, \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *\mbox{\hyperlink{namespacekblib_a22831dce77d5f35c13930b5e30a59f07}{a}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00543}00543 \mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *b));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00544}00544 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00546}00546 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00547}00547 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00548}00548 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00549}00549 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00555}00555 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation, \textcolor{keyword}{typename} LessT,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00556}00556 \textcolor{keyword}{typename} SortKey, std::size\_t small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00557}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationf1e9e425aa5b0d07fb4c879cfd659585}{00557}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00558}00558 SortKey, small\_size, true, true, false, false> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00559}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationf1e9e425aa5b0d07fb4c879cfd659585_a52d6621513f3ce10d2c7f8fea09bd86d}{00559}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationf1e9e425aa5b0d07fb4c879cfd659585_a52d6621513f3ce10d2c7f8fea09bd86d}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00560}00560 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00561}00561 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00562}00562 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::less\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00563}00563 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00565}00565 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00566}00566 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00572}00572 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation, \textcolor{keyword}{typename} LessT,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00573}00573 \textcolor{keyword}{typename} SortKey, std::size\_t small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00574}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation3c2c850b5ad1e4acd66097d89e51c4f1}{00574}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}}, SortKey, small\_size, true,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00576}00576 true, false, false> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00577}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation3c2c850b5ad1e4acd66097d89e51c4f1_a546fe519d33a1084abd981807ae380d3}{00577}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation3c2c850b5ad1e4acd66097d89e51c4f1_a546fe519d33a1084abd981807ae380d3}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00578}00578 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00579}00579 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00580}00580 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::greater\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00581}00581 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00583}00583 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00584}00584 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00585}00585 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00590}00590 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation, \textcolor{keyword}{typename} LessT,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00591}00591 \textcolor{keyword}{typename} SortKey, std::size\_t small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00592}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation03a4b8b2612786c18e671d7b72685405}{00592}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00593}00593 SortKey, small\_size, true, true, true, true> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00594}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation03a4b8b2612786c18e671d7b72685405_a85d7d5abf5c0613f05f6570486c4acb4}{00594}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation03a4b8b2612786c18e671d7b72685405_a85d7d5abf5c0613f05f6570486c4acb4}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00595}00595 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00596}00596 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00597}00597 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::less\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00598}00598 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00600}00600 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00601}00601 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00606}00606 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation, \textcolor{keyword}{typename} LessT,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00607}00607 \textcolor{keyword}{typename} SortKey, std::size\_t small\_size>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00608}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationbcac2feda0fade87a36510b7d31d2576}{00608}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}}, SortKey, small\_size, true,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00610}00610 true, true, true> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00611}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationbcac2feda0fade87a36510b7d31d2576_ae725d38bfc0ee1609d7894d514a186cc}{00611}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationbcac2feda0fade87a36510b7d31d2576_ae725d38bfc0ee1609d7894d514a186cc}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00612}00612 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00613}00613 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00614}00614 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::greater\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00615}00615 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00617}00617 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00618}00618 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00619}00619 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00620}00620 \textcolor{preprocessor}{\#if 1 }\textcolor{comment}{// Do string radix sorting}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00625}00625 \textcolor{comment}{} template } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00627}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationfec06b35b16d095881d1da3ea9777678}{00627}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00628}00628 SortKey, small\_size, M, false, true, false> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00629}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationfec06b35b16d095881d1da3ea9777678_ab8f482fdc3ae48be3a28f218b96a8a59}{00629}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operationfec06b35b16d095881d1da3ea9777678_ab8f482fdc3ae48be3a28f218b96a8a59}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00630}00630 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00631}00631 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00632}00632 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::less\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00633}00633 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00635}00635 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00636}00636 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00641}00641 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation, \textcolor{keyword}{typename} LessT,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00642}00642 \textcolor{keyword}{typename} SortKey, std::size\_t small\_size, \textcolor{keywordtype}{bool} M>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00643}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation51fbb4ca17e940976b57d3794660a6d8}{00643}} \textcolor{keyword}{struct }\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{sort\_transform\_impl}}, SortKey, small\_size, M,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00645}00645 false, true, false> \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00646}\mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation51fbb4ca17e940976b57d3794660a6d8_a4d75c85d6cafef8632bb78d4f5a57d98}{00646}} \textcolor{keyword}{static} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl_3_01_random_access_it_00_01_unary_operation51fbb4ca17e940976b57d3794660a6d8_a4d75c85d6cafef8632bb78d4f5a57d98}{inplace}}(\mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} RandomAccessIt begin,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00647}00647 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} \textcolor{keyword}{const} RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00648}00648 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00649}00649 \mbox{\hyperlink{tdecl_8h_a607cffc585fe3bfcb06b63be2948de4a}{KBLIB\_UNUSED}} std::greater\&\& compare)} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00650}00650 -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00652}00652 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00653}00653 \};} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00654}00654 \textcolor{preprocessor}{\#endif}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00655}00655 \} \textcolor{comment}{// namespace detail\_sort}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00656}00656 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00672}00672 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00673}00673 \textcolor{keyword}{typename} BinaryPredicate>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00674}\mbox{\hyperlink{namespacekblib_a7b871050bf43912f54b38ba4ecf027fe}{00674}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a49c4ab0021b9025dcc1ab803f35130a7}{sort\_transform}}(RandomAccessIt begin, RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00675}00675 UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00676}00676 BinaryPredicate\&\& compare) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00677}00677 \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{detail\_sort::sort\_transform\_impl}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00678}00678 RandomAccessIt, UnaryOperation, BinaryPredicate,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00679}00679 \textcolor{keyword}{decltype}(\mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *begin))>::} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00680}00680 inplace(begin, end, std::forward(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00681}00681 std::forward(compare));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00682}00682 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00683}00683 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00690}00690 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} UnaryOperation>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00691}\mbox{\hyperlink{namespacekblib_a49c4ab0021b9025dcc1ab803f35130a7}{00691}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a49c4ab0021b9025dcc1ab803f35130a7}{sort\_transform}}(RandomAccessIt begin, RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00692}00692 UnaryOperation\&\& \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00693}00693 \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{detail\_sort::sort\_transform\_impl}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00694}00694 RandomAccessIt, UnaryOperation, std::less<>,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00695}00695 \textcolor{keyword}{decltype}(\mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00696}00696 *begin))>::inplace(begin, end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00697}00697 std::forward(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00698}00698 \mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}),} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00699}00699 std::less<>\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00700}00700 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00701}00701 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00714}00714 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt, \textcolor{keyword}{typename} BinaryPredicate>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00715}\mbox{\hyperlink{namespacekblib_ae0cd00a865682926e1053ece9dc8ccdb}{00715}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a3b409f97a9a14760031484b8285f7534}{sort}}(RandomAccessIt begin, RandomAccessIt end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00716}00716 BinaryPredicate\&\& compare) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00717}00717 \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{detail\_sort::sort\_transform\_impl}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00718}00718 RandomAccessIt, \mbox{\hyperlink{structkblib_1_1identity}{identity}}, BinaryPredicate,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00719}00719 \textcolor{keyword}{decltype}(\mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00720}00720 *begin))>::inplace(begin, end, \mbox{\hyperlink{structkblib_1_1identity}{identity}}\{\},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00721}00721 std::forward(} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00722}00722 compare));} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00723}00723 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00724}00724 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00730}00730 \textcolor{keyword}{template} <\textcolor{keyword}{typename} RandomAccessIt>} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00731}\mbox{\hyperlink{namespacekblib_a3b409f97a9a14760031484b8285f7534}{00731}} \textcolor{keyword}{constexpr} \textcolor{keyword}{auto} \mbox{\hyperlink{namespacekblib_a3b409f97a9a14760031484b8285f7534}{sort}}(RandomAccessIt begin, RandomAccessIt end) -\/> \textcolor{keywordtype}{void} \{} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00732}00732 \mbox{\hyperlink{structkblib_1_1detail__sort_1_1sort__transform__impl}{detail\_sort::sort\_transform\_impl}}<} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00733}00733 RandomAccessIt, \mbox{\hyperlink{structkblib_1_1identity}{identity}}, std::less<>,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00734}00734 \textcolor{keyword}{decltype}(\mbox{\hyperlink{namespacekblib_a9b10acd2ddaea118b990e1177f626722}{kblib::invoke}}(\mbox{\hyperlink{namespacekblib_aff53cc55f02129e6192d7a87c7cdf7f0}{transform}}, *begin))>::inplace(begin, end,} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00735}00735 \mbox{\hyperlink{structkblib_1_1identity}{identity}}\{\},} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00736}00736 std::less<>\{\});} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00737}00737 \}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00738}00738 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00739}00739 \} \textcolor{comment}{// namespace KBLIB\_NS}} \DoxyCodeLine{\Hypertarget{sort_8h_source_l00740}00740 } \DoxyCodeLine{\Hypertarget{sort_8h_source_l00741}00741 \textcolor{preprocessor}{\#endif }\textcolor{comment}{// SORT\_H}} \end{DoxyCode}