API reference v3.15.0
This commit is contained in:
@@ -3,13 +3,15 @@
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
|
||||
<meta name="generator" content="Doxygen 1.10.0"/>
|
||||
<meta name="generator" content="Doxygen 1.13.2"/>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||
<title>EnTT: src/entt/core/algorithm.hpp Source File</title>
|
||||
<link href="tabs.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="jquery.js"></script>
|
||||
<script type="text/javascript" src="dynsections.js"></script>
|
||||
<script type="text/javascript" src="clipboard.js"></script>
|
||||
<link href="navtree.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="resize.js"></script>
|
||||
<script type="text/javascript" src="cookie.js"></script>
|
||||
<link href="search/search.css" rel="stylesheet" type="text/css"/>
|
||||
<script type="text/javascript" src="search/searchdata.js"></script>
|
||||
@@ -23,7 +25,7 @@
|
||||
<tbody>
|
||||
<tr id="projectrow">
|
||||
<td id="projectalign">
|
||||
<div id="projectname">EnTT<span id="projectnumber"> 3.14.0</span>
|
||||
<div id="projectname">EnTT<span id="projectnumber"> 3.15.0</span>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -31,18 +33,23 @@
|
||||
</table>
|
||||
</div>
|
||||
<!-- end header part -->
|
||||
<!-- Generated by Doxygen 1.10.0 -->
|
||||
<!-- Generated by Doxygen 1.13.2 -->
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
var searchBox = new SearchBox("searchBox", "search/",'.html');
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<script type="text/javascript" src="menudata.js"></script>
|
||||
<script type="text/javascript" src="menu.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() {
|
||||
initMenu('',true,false,'search.php','Search');
|
||||
initMenu('',true,false,'search.php','Search',false);
|
||||
$(function() { init_search(); });
|
||||
});
|
||||
/* @license-end */
|
||||
@@ -50,7 +57,7 @@ $(function() {
|
||||
<div id="main-nav"></div>
|
||||
<script type="text/javascript">
|
||||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */
|
||||
$(function() { codefold.init(0); });
|
||||
$(function(){ initResizable(false); });
|
||||
/* @license-end */
|
||||
</script>
|
||||
<!-- window showing the filter options -->
|
||||
@@ -79,6 +86,7 @@ $(function() { codefold.init(0); });
|
||||
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_66e9674e8206a335795995fa32a03c91.html">entt</a></li><li class="navelem"><a class="el" href="dir_de8f4e6ba3f54a2a21309f742e93a373.html">core</a></li> </ul>
|
||||
</div>
|
||||
</div><!-- top -->
|
||||
<div id="doc-content">
|
||||
<div class="header">
|
||||
<div class="headertitle"><div class="title">algorithm.hpp</div></div>
|
||||
</div><!--header-->
|
||||
@@ -94,99 +102,100 @@ $(function() { codefold.init(0); });
|
||||
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno"> 9</span><span class="preprocessor">#include "utility.hpp"</span></div>
|
||||
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno"> 10</span> </div>
|
||||
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno"> 11</span><span class="keyword">namespace </span><a class="code hl_namespace" href="namespaceentt.html">entt</a> {</div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span> </div>
|
||||
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span></div>
|
||||
<div class="foldopen" id="foldopen00021" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"><a class="line" href="structentt_1_1std__sort.html"> 21</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structentt_1_1std__sort.html">std_sort</a> {</div>
|
||||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <span class="keyword">template</span><<span class="keyword">typename</span> It, <span class="keyword">typename</span> Compare = std::less<>, <span class="keyword">typename</span>... Args></div>
|
||||
<div class="foldopen" id="foldopen00036" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="structentt_1_1std__sort.html#a8895e4acd1677a60e07d7e28748fe667"> 36</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1std__sort.html#a8895e4acd1677a60e07d7e28748fe667">operator()</a>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> first, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> last, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Compare</a> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">compare</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Compare</a>{}, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Args</a> &&...args) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::sort(std::forward<Args>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">args</a>)..., std::move(first), std::move(last), std::move(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">compare</a>));</div>
|
||||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"><a class="line" href="structentt_1_1std__sort.html#a8895e4acd1677a60e07d7e28748fe667"> 36</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1std__sort.html#a8895e4acd1677a60e07d7e28748fe667">operator()</a>(It first, It last, Compare compare = Compare{}, Args &&...args) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> std::sort(std::forward<Args>(args)..., std::move(first), std::move(last), std::move(compare));</div>
|
||||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> </div>
|
||||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span></div>
|
||||
<div class="foldopen" id="foldopen00042" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="structentt_1_1insertion__sort.html"> 42</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structentt_1_1insertion__sort.html">insertion_sort</a> {</div>
|
||||
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> <span class="keyword">template</span><<span class="keyword">typename</span> It, <span class="keyword">typename</span> Compare = std::less<>></div>
|
||||
<div class="foldopen" id="foldopen00055" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="structentt_1_1insertion__sort.html#a73a5644fe5b683f9b9376c89ac47f2b8"> 55</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1insertion__sort.html#a73a5644fe5b683f9b9376c89ac47f2b8">operator()</a>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> first, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> last, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Compare</a> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">compare</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Compare</a>{}) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00055" name="l00055"></a><span class="lineno"><a class="line" href="structentt_1_1insertion__sort.html#a73a5644fe5b683f9b9376c89ac47f2b8"> 55</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1insertion__sort.html#a73a5644fe5b683f9b9376c89ac47f2b8">operator()</a>(It first, It last, Compare compare = Compare{}) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00056" name="l00056"></a><span class="lineno"> 56</span> <span class="keywordflow">if</span>(first < last) {</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> = first + 1; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> < last; ++<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>) {</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">auto</span> value = std::move(*<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>);</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>;</div>
|
||||
<div class="line"><a id="l00057" name="l00057"></a><span class="lineno"> 57</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> it = first + 1; it < last; ++it) {</div>
|
||||
<div class="line"><a id="l00058" name="l00058"></a><span class="lineno"> 58</span> <span class="keyword">auto</span> value = std::move(*it);</div>
|
||||
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"> 59</span> <span class="keyword">auto</span> pre = it;</div>
|
||||
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"> 60</span> </div>
|
||||
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> <span class="comment">// NOLINTBEGIN(cppcoreguidelines-pro-bounds-pointer-arithmetic)</span></div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">for</span>(; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> > first && <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">compare</a>(value, *(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> - 1)); --<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a>) {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> *<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> = std::move(*(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> - 1));</div>
|
||||
<div class="line"><a id="l00062" name="l00062"></a><span class="lineno"> 62</span> <span class="keywordflow">for</span>(; pre > first && compare(value, *(pre - 1)); --pre) {</div>
|
||||
<div class="line"><a id="l00063" name="l00063"></a><span class="lineno"> 63</span> *pre = std::move(*(pre - 1));</div>
|
||||
<div class="line"><a id="l00064" name="l00064"></a><span class="lineno"> 64</span> }</div>
|
||||
<div class="line"><a id="l00065" name="l00065"></a><span class="lineno"> 65</span> <span class="comment">// NOLINTEND(cppcoreguidelines-pro-bounds-pointer-arithmetic)</span></div>
|
||||
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"> 66</span> </div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> *<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pre</a> = std::move(value);</div>
|
||||
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"> 67</span> *pre = std::move(value);</div>
|
||||
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> }</div>
|
||||
<div class="line"><a id="l00069" name="l00069"></a><span class="lineno"> 69</span> }</div>
|
||||
<div class="line"><a id="l00070" name="l00070"></a><span class="lineno"> 70</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00071" name="l00071"></a><span class="lineno"> 71</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span> </div>
|
||||
<div class="line"><a id="l00072" name="l00072"></a><span class="lineno"> 72</span></div>
|
||||
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno"> 78</span><span class="keyword">template</span><std::<span class="keywordtype">size_t</span> Bit, std::<span class="keywordtype">size_t</span> N></div>
|
||||
<div class="foldopen" id="foldopen00079" data-start="{" data-end="};">
|
||||
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="structentt_1_1radix__sort.html"> 79</a></span><span class="keyword">struct </span><a class="code hl_struct" href="structentt_1_1radix__sort.html">radix_sort</a> {</div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keyword">static_assert</span>((<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">N</a> % <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>) == 0, <span class="stringliteral">"The maximum number of bits to sort must be a multiple of the number of bits processed per pass"</span>);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span> </div>
|
||||
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span> <span class="keyword">static_assert</span>((N % Bit) == 0, <span class="stringliteral">"The maximum number of bits to sort must be a multiple of the number of bits processed per pass"</span>);</div>
|
||||
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"> 81</span></div>
|
||||
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"> 97</span> <span class="keyword">template</span><<span class="keyword">typename</span> It, <span class="keyword">typename</span> Getter = <span class="keywordtype">id</span>entity></div>
|
||||
<div class="foldopen" id="foldopen00098" data-start="{" data-end="}">
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="structentt_1_1radix__sort.html#a1989f6fbe18d3d82fdea9745d6b9ee96"> 98</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1radix__sort.html#a1989f6fbe18d3d82fdea9745d6b9ee96">operator()</a>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> first, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">It</a> last, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Getter</a> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">getter</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Getter</a>{}) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="structentt_1_1radix__sort.html#a1989f6fbe18d3d82fdea9745d6b9ee96"> 98</a></span> <span class="keywordtype">void</span> <a class="code hl_function" href="structentt_1_1radix__sort.html#a1989f6fbe18d3d82fdea9745d6b9ee96">operator()</a>(It first, It last, Getter getter = Getter{}) <span class="keyword">const</span> {</div>
|
||||
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"> 99</span> <span class="keywordflow">if</span>(first < last) {</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">passes</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">N</a> / <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>;</div>
|
||||
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"> 100</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> passes = N / Bit;</div>
|
||||
<div class="line"><a id="l00101" name="l00101"></a><span class="lineno"> 101</span> </div>
|
||||
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"> 102</span> <span class="keyword">using </span>value_type = <span class="keyword">typename</span> std::iterator_traits<It>::value_type;</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> std::vector<value_type> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>(std::distance(first, last));</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> </div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">part</a> = [<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">getter</a> = std::move(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">getter</a>)](<span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">from</a>, <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">to</a>, <span class="keyword">auto</span> out, <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">start</a>) {</div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">mask</a> = (1 << <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>) - 1;</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">buckets</a> = 1 << <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> </div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays)</span></div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> std::size_t count[<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">buckets</a>]{};</div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> </div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">from</a>; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> != <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">to</a>; ++<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>) {</div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> ++count[(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">getter</a>(*<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>) >> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">start</a>) & <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">mask</a>];</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> }</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> </div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays)</span></div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> std::size_t index[<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">buckets</a>]{};</div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> </div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> <span class="keywordflow">for</span>(std::size_t <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a>{}, end = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">buckets</a> - 1u; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a> < end; ++<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a>) {</div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> index[<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a> + 1u] = index[<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a>] + count[<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pos</a>];</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> }</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> </div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> = <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">from</a>; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a> != <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">to</a>; ++<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>) {</div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> out[index[(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">getter</a>(*<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>) >> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">start</a>) & <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">mask</a>]++] = std::move(*<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">it</a>);</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> }</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> };</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> </div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> <span class="keywordflow">for</span>(std::size_t <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pass</a> = 0; <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pass</a> < (<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">passes</a> & ~1); <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pass</a> += 2) {</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">part</a>(first, last, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.begin(), <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pass</a> * <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>);</div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">part</a>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.begin(), <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.end(), first, (<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">pass</a> + 1) * <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>);</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> }</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> </div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span>(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">passes</a> & 1) {</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">part</a>(first, last, <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.begin(), (<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">passes</a> - 1) * <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">Bit</a>);</div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> std::move(<a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.begin(), <a class="code hl_function" href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">aux</a>.end(), first);</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> }</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> }</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
|
||||
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"> 103</span> <span class="keyword">using </span>difference_type = <span class="keyword">typename</span> std::iterator_traits<It>::difference_type;</div>
|
||||
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"> 104</span> std::vector<value_type> aux(<span class="keyword">static_cast<</span>std::size_t<span class="keyword">></span>(std::distance(first, last)));</div>
|
||||
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"> 105</span> </div>
|
||||
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"> 106</span> <span class="keyword">auto</span> part = [getter = std::move(getter)](<span class="keyword">auto</span> from, <span class="keyword">auto</span> to, <span class="keyword">auto</span> out, <span class="keyword">auto</span> start) {</div>
|
||||
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"> 107</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> mask = (1 << Bit) - 1;</div>
|
||||
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno"> 108</span> <span class="keyword">constexpr</span> <span class="keyword">auto</span> buckets = 1 << Bit;</div>
|
||||
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"> 109</span> </div>
|
||||
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"> 110</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays, misc-const-correctness)</span></div>
|
||||
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"> 111</span> std::size_t count[buckets]{};</div>
|
||||
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"> 112</span> </div>
|
||||
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"> 113</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> it = from; it != to; ++it) {</div>
|
||||
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"> 114</span> ++count[(getter(*it) >> start) & mask];</div>
|
||||
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"> 115</span> }</div>
|
||||
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"> 116</span> </div>
|
||||
<div class="line"><a id="l00117" name="l00117"></a><span class="lineno"> 117</span> <span class="comment">// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays)</span></div>
|
||||
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"> 118</span> std::size_t index[buckets]{};</div>
|
||||
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"> 119</span> </div>
|
||||
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"> 120</span> <span class="keywordflow">for</span>(std::size_t pos{}, end = buckets - 1u; pos < end; ++pos) {</div>
|
||||
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> index[pos + 1u] = index[pos] + count[pos];</div>
|
||||
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"> 122</span> }</div>
|
||||
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno"> 123</span> </div>
|
||||
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span> <span class="keywordflow">for</span>(<span class="keyword">auto</span> it = from; it != to; ++it) {</div>
|
||||
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> <span class="keyword">const</span> <span class="keyword">auto</span> pos = index[(getter(*it) >> start) & mask]++;</div>
|
||||
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> out[<span class="keyword">static_cast<</span>difference_type<span class="keyword">></span>(pos)] = std::move(*it);</div>
|
||||
<div class="line"><a id="l00127" name="l00127"></a><span class="lineno"> 127</span> }</div>
|
||||
<div class="line"><a id="l00128" name="l00128"></a><span class="lineno"> 128</span> };</div>
|
||||
<div class="line"><a id="l00129" name="l00129"></a><span class="lineno"> 129</span> </div>
|
||||
<div class="line"><a id="l00130" name="l00130"></a><span class="lineno"> 130</span> <span class="keywordflow">for</span>(std::size_t pass = 0; pass < (passes & ~1u); pass += 2) {</div>
|
||||
<div class="line"><a id="l00131" name="l00131"></a><span class="lineno"> 131</span> part(first, last, aux.begin(), pass * Bit);</div>
|
||||
<div class="line"><a id="l00132" name="l00132"></a><span class="lineno"> 132</span> part(aux.begin(), aux.end(), first, (pass + 1) * Bit);</div>
|
||||
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno"> 133</span> }</div>
|
||||
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno"> 134</span> </div>
|
||||
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"> 135</span> <span class="keywordflow">if</span> <span class="keyword">constexpr</span>(passes & 1) {</div>
|
||||
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno"> 136</span> part(first, last, aux.begin(), (passes - 1) * Bit);</div>
|
||||
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno"> 137</span> std::move(aux.begin(), aux.end(), first);</div>
|
||||
<div class="line"><a id="l00138" name="l00138"></a><span class="lineno"> 138</span> }</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span> }</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> }</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"> 139</span>};</div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span>};</div>
|
||||
</div>
|
||||
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
|
||||
<div class="line"><a id="l00141" name="l00141"></a><span class="lineno"> 141</span>} <span class="comment">// namespace entt</span></div>
|
||||
<div class="line"><a id="l00142" name="l00142"></a><span class="lineno"> 142</span> </div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="line"><a id="l00143" name="l00143"></a><span class="lineno"> 143</span>} <span class="comment">// namespace entt</span></div>
|
||||
<div class="line"><a id="l00144" name="l00144"></a><span class="lineno"> 144</span> </div>
|
||||
<div class="line"><a id="l00145" name="l00145"></a><span class="lineno"> 145</span><span class="preprocessor">#endif</span></div>
|
||||
<div class="ttc" id="anamespaceentt_html"><div class="ttname"><a href="namespaceentt.html">entt</a></div><div class="ttdoc">EnTT default namespace.</div><div class="ttdef"><b>Definition</b> <a href="dense__map_8hpp_source.html#l00022">dense_map.hpp:22</a></div></div>
|
||||
<div class="ttc" id="anamespaceentt_html_a12e4d0c58f9c4cc6f5513c39c530b9b7"><div class="ttname"><a href="namespaceentt.html#a12e4d0c58f9c4cc6f5513c39c530b9b7">entt::make_obj_using_allocator</a></div><div class="ttdeci">constexpr Type make_obj_using_allocator(const Allocator &allocator, Args &&...args)</div><div class="ttdoc">Uses-allocator construction utility (waiting for C++20).</div><div class="ttdef"><b>Definition</b> <a href="memory_8hpp_source.html#l00219">memory.hpp:219</a></div></div>
|
||||
<div class="ttc" id="astructentt_1_1insertion__sort_html"><div class="ttname"><a href="structentt_1_1insertion__sort.html">entt::insertion_sort</a></div><div class="ttdoc">Function object for performing insertion sort.</div><div class="ttdef"><b>Definition</b> <a href="#l00042">algorithm.hpp:42</a></div></div>
|
||||
<div class="ttc" id="astructentt_1_1insertion__sort_html_a73a5644fe5b683f9b9376c89ac47f2b8"><div class="ttname"><a href="structentt_1_1insertion__sort.html#a73a5644fe5b683f9b9376c89ac47f2b8">entt::insertion_sort::operator()</a></div><div class="ttdeci">void operator()(It first, It last, Compare compare=Compare{}) const</div><div class="ttdoc">Sorts the elements in a range.</div><div class="ttdef"><b>Definition</b> <a href="#l00055">algorithm.hpp:55</a></div></div>
|
||||
<div class="ttc" id="astructentt_1_1radix__sort_html"><div class="ttname"><a href="structentt_1_1radix__sort.html">entt::radix_sort</a></div><div class="ttdoc">Function object for performing LSD radix sort.</div><div class="ttdef"><b>Definition</b> <a href="#l00079">algorithm.hpp:79</a></div></div>
|
||||
@@ -196,7 +205,8 @@ $(function() { codefold.init(0); });
|
||||
</div><!-- fragment --></div><!-- contents -->
|
||||
<!-- start footer part -->
|
||||
<hr class="footer"/><address class="footer"><small>
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.10.0
|
||||
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.13.2
|
||||
</small></address>
|
||||
</div><!-- doc-content -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
Reference in New Issue
Block a user