Micro template library A library for building device drivers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

122 lines
18 KiB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>uTL: include/utl/meta/selection.h Source File</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  18. $(document).ready(initResizable);
  19. /* @license-end */</script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/searchdata.js"></script>
  22. <script type="text/javascript" src="search/search.js"></script>
  23. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  24. </head>
  25. <body>
  26. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  27. <div id="titlearea">
  28. <table cellspacing="0" cellpadding="0">
  29. <tbody>
  30. <tr style="height: 56px;">
  31. <td id="projectalign" style="padding-left: 0.5em;">
  32. <div id="projectname">uTL
  33. </div>
  34. <div id="projectbrief">micro Template library</div>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. <!-- end header part -->
  41. <!-- Generated by Doxygen 1.8.14 -->
  42. <script type="text/javascript">
  43. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  44. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  45. /* @license-end */
  46. </script>
  47. <script type="text/javascript" src="menudata.js"></script>
  48. <script type="text/javascript" src="menu.js"></script>
  49. <script type="text/javascript">
  50. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  51. $(function() {
  52. initMenu('',true,false,'search.php','Search');
  53. $(document).ready(function() { init_search(); });
  54. });
  55. /* @license-end */</script>
  56. <div id="main-nav"></div>
  57. </div><!-- top -->
  58. <div id="side-nav" class="ui-resizable side-nav-resizable">
  59. <div id="nav-tree">
  60. <div id="nav-tree-contents">
  61. <div id="nav-sync" class="sync"></div>
  62. </div>
  63. </div>
  64. <div id="splitbar" style="-moz-user-select:none;"
  65. class="ui-resizable-handle">
  66. </div>
  67. </div>
  68. <script type="text/javascript">
  69. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  70. $(document).ready(function(){initNavTree('selection_8h_source.html','');});
  71. /* @license-end */
  72. </script>
  73. <div id="doc-content">
  74. <!-- window showing the filter options -->
  75. <div id="MSearchSelectWindow"
  76. onmouseover="return searchBox.OnSearchSelectShow()"
  77. onmouseout="return searchBox.OnSearchSelectHide()"
  78. onkeydown="return searchBox.OnSearchSelectKey(event)">
  79. </div>
  80. <!-- iframe showing the search results (closed by default) -->
  81. <div id="MSearchResultsWindow">
  82. <iframe src="javascript:void(0)" frameborder="0"
  83. name="MSearchResults" id="MSearchResults">
  84. </iframe>
  85. </div>
  86. <div class="header">
  87. <div class="headertitle">
  88. <div class="title">selection.h</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <a href="selection_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span>&#160;</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#ifndef __utl_meta_selection_h__</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#define __utl_meta_selection_h__</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="impl_8h.html">utl/core/impl.h</a>&gt;</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="integral_8h.html">utl/meta/integral.h</a>&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceutl.html">utl</a> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;<span class="keyword">namespace </span>meta{</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keyword">namespace </span>detail {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> If, <span class="keyword">typename</span>...&gt;</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="structutl_1_1meta_1_1detail_1_1if__c__.html"> 44</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1meta_1_1detail_1_1if__c__.html">if_c_</a> {</div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="group__type.html#gaefeff9de7bff8811e49692343ce6187e"> 45</a></span>&#160; <span class="keyword">using</span> <a class="code" href="structutl_1_1meta_1_1nil__.html">type</a> = <a class="code" href="structutl_1_1meta_1_1nil__.html">nil_</a>; </div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; };</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Then&gt;</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_01_4.html"> 48</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_01_4.html">if_c_&lt;true, Then&gt;</a> {</div><div class="line"><a name="l00049"></a><span class="lineno"><a class="line" href="group__type.html#gaa7f24607990e92d8263246fc5f7003b7"> 49</a></span>&#160; <span class="keyword">using</span> <a class="code" href="group__type.html#gaa7f24607990e92d8263246fc5f7003b7">type</a> = Then;</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; };</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Then, <span class="keyword">typename</span> Else&gt;</div><div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_00_01_else_01_4.html"> 52</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_00_01_else_01_4.html">if_c_&lt;true, Then, Else&gt;</a> {</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="group__type.html#ga15100ac40785819517c5defacb19915c"> 53</a></span>&#160; <span class="keyword">using</span> <a class="code" href="group__type.html#ga15100ac40785819517c5defacb19915c">type</a> = Then;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; };</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keyword">template</span>&lt;<span class="keyword">typename</span> Then, <span class="keyword">typename</span> Else&gt;</div><div class="line"><a name="l00056"></a><span class="lineno"><a class="line" href="structutl_1_1meta_1_1detail_1_1if__c___3_01false_00_01_then_00_01_else_01_4.html"> 56</a></span>&#160; <span class="keyword">struct </span><a class="code" href="structutl_1_1meta_1_1detail_1_1if__c___3_01false_00_01_then_00_01_else_01_4.html">if_c_&lt;false, Then, Else&gt;</a> {</div><div class="line"><a name="l00057"></a><span class="lineno"><a class="line" href="group__type.html#ga2fbed149992c081ac85eefaf63a388ca"> 57</a></span>&#160; <span class="keyword">using</span> <a class="code" href="group__type.html#ga2fbed149992c081ac85eefaf63a388ca">type</a> = Else;</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; };</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keyword">template</span> &lt;<span class="keywordtype">bool</span> B, <span class="keyword">typename</span>... Args&gt;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="group__type.html#gaa3812817ce749832da73fdf5d2a85380"> 62</a></span>&#160; <span class="keyword">using</span> <a class="code" href="group__type.html#gaa3812817ce749832da73fdf5d2a85380">if_c</a> = <a class="code" href="namespaceutl_1_1meta.html#aa5a37adba244ff4286f994111c4c02ea">eval</a>&lt;<a class="code" href="structutl_1_1meta_1_1detail_1_1if__c__.html">detail::if_c_</a>&lt;B, Args...&gt;&gt;;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> If, <span class="keyword">typename</span>... Args&gt;</div><div class="line"><a name="l00066"></a><span class="lineno"><a class="line" href="group__type.html#ga39cc4e727a8faa5ea176f543e62c05c0"> 66</a></span>&#160; <span class="keyword">using</span> <a class="code" href="group__type.html#ga39cc4e727a8faa5ea176f543e62c05c0">if_</a> = <a class="code" href="group__type.html#gaa3812817ce749832da73fdf5d2a85380">if_c</a>&lt;If::type::value, Args...&gt;;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160;</div><div class="line"><a name="l00076"></a><span class="lineno"><a class="line" href="group__type.html#gaf7089523d21cd405c76985643f31092a"> 76</a></span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> ...&gt; <span class="keyword">using</span> <a class="code" href="group__type.html#gaf7089523d21cd405c76985643f31092a">first_of</a> = T1;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160;</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="group__type.html#ga422dd1b0895f0074ad9932d68d9edbc5"> 79</a></span>&#160; <span class="keyword">template</span> &lt;<span class="keyword">typename</span> T1, <span class="keyword">typename</span> T2, <span class="keyword">typename</span> ...&gt; <span class="keyword">using</span> <a class="code" href="group__type.html#ga422dd1b0895f0074ad9932d68d9edbc5">second_of</a> = T2;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;}}</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160;</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __utl_meta_selection_h__ */</span><span class="preprocessor"></span></div><div class="ttc" id="group__type_html_gaf7089523d21cd405c76985643f31092a"><div class="ttname"><a href="group__type.html#gaf7089523d21cd405c76985643f31092a">utl::meta::first_of</a></div><div class="ttdeci">T1 first_of</div><div class="ttdoc">Select the first type of a type sequence. </div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00076">selection.h:76</a></div></div>
  92. <div class="ttc" id="group__type_html_gaa7f24607990e92d8263246fc5f7003b7"><div class="ttname"><a href="group__type.html#gaa7f24607990e92d8263246fc5f7003b7">utl::meta::detail::if_c_&lt; true, Then &gt;::type</a></div><div class="ttdeci">Then type</div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00049">selection.h:49</a></div></div>
  93. <div class="ttc" id="group__type_html_ga39cc4e727a8faa5ea176f543e62c05c0"><div class="ttname"><a href="group__type.html#ga39cc4e727a8faa5ea176f543e62c05c0">utl::meta::if_</a></div><div class="ttdeci">if_c&lt; If::type::value, Args... &gt; if_</div><div class="ttdoc">Select one type or another depending on a compile-time Boolean type. </div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00066">selection.h:66</a></div></div>
  94. <div class="ttc" id="group__type_html_gaa3812817ce749832da73fdf5d2a85380"><div class="ttname"><a href="group__type.html#gaa3812817ce749832da73fdf5d2a85380">utl::meta::if_c</a></div><div class="ttdeci">eval&lt; detail::if_c_&lt; B, Args... &gt; &gt; if_c</div><div class="ttdoc">Select one type or another depending on a compile-time Boolean. </div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00062">selection.h:62</a></div></div>
  95. <div class="ttc" id="group__type_html_ga422dd1b0895f0074ad9932d68d9edbc5"><div class="ttname"><a href="group__type.html#ga422dd1b0895f0074ad9932d68d9edbc5">utl::meta::second_of</a></div><div class="ttdeci">T2 second_of</div><div class="ttdoc">Select the second type of a type sequence. </div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00079">selection.h:79</a></div></div>
  96. <div class="ttc" id="group__type_html_ga15100ac40785819517c5defacb19915c"><div class="ttname"><a href="group__type.html#ga15100ac40785819517c5defacb19915c">utl::meta::detail::if_c_&lt; true, Then, Else &gt;::type</a></div><div class="ttdeci">Then type</div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00053">selection.h:53</a></div></div>
  97. <div class="ttc" id="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_00_01_else_01_4_html"><div class="ttname"><a href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_00_01_else_01_4.html">utl::meta::detail::if_c_&lt; true, Then, Else &gt;</a></div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00052">selection.h:52</a></div></div>
  98. <div class="ttc" id="structutl_1_1meta_1_1nil___html"><div class="ttname"><a href="structutl_1_1meta_1_1nil__.html">utl::meta::nil_</a></div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00043">integral.h:43</a></div></div>
  99. <div class="ttc" id="group__type_html_ga2fbed149992c081ac85eefaf63a388ca"><div class="ttname"><a href="group__type.html#ga2fbed149992c081ac85eefaf63a388ca">utl::meta::detail::if_c_&lt; false, Then, Else &gt;::type</a></div><div class="ttdeci">Else type</div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00057">selection.h:57</a></div></div>
  100. <div class="ttc" id="namespaceutl_1_1meta_html_aa5a37adba244ff4286f994111c4c02ea"><div class="ttname"><a href="namespaceutl_1_1meta.html#aa5a37adba244ff4286f994111c4c02ea">utl::meta::eval</a></div><div class="ttdeci">typename Tp::type eval</div><div class="ttdoc">Type alias for Tp::type. Used to evaluate/extract return type of metafunctions. </div><div class="ttdef"><b>Definition:</b> <a href="integral_8h_source.html#l00049">integral.h:49</a></div></div>
  101. <div class="ttc" id="namespaceutl_html"><div class="ttname"><a href="namespaceutl.html">utl</a></div><div class="ttdoc">STL&amp;#39;s core language concepts. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire_8h_source.html#l00030">_1wire.h:30</a></div></div>
  102. <div class="ttc" id="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_01_4_html"><div class="ttname"><a href="structutl_1_1meta_1_1detail_1_1if__c___3_01true_00_01_then_01_4.html">utl::meta::detail::if_c_&lt; true, Then &gt;</a></div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00048">selection.h:48</a></div></div>
  103. <div class="ttc" id="integral_8h_html"><div class="ttname"><a href="integral_8h.html">integral.h</a></div></div>
  104. <div class="ttc" id="structutl_1_1meta_1_1detail_1_1if__c___3_01false_00_01_then_00_01_else_01_4_html"><div class="ttname"><a href="structutl_1_1meta_1_1detail_1_1if__c___3_01false_00_01_then_00_01_else_01_4.html">utl::meta::detail::if_c_&lt; false, Then, Else &gt;</a></div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00056">selection.h:56</a></div></div>
  105. <div class="ttc" id="structutl_1_1meta_1_1detail_1_1if__c___html"><div class="ttname"><a href="structutl_1_1meta_1_1detail_1_1if__c__.html">utl::meta::detail::if_c_</a></div><div class="ttdef"><b>Definition:</b> <a href="selection_8h_source.html#l00044">selection.h:44</a></div></div>
  106. <div class="ttc" id="impl_8h_html"><div class="ttname"><a href="impl_8h.html">impl.h</a></div><div class="ttdoc">Implementation detail main forward header. </div></div>
  107. </div><!-- fragment --></div><!-- contents -->
  108. </div><!-- doc-content -->
  109. <!-- start footer part -->
  110. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  111. <ul>
  112. <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_82754f54d9380477ef02477185c1f103.html">utl</a></li><li class="navelem"><a class="el" href="dir_c6a55aeb35dd92d90cdd3b5869981960.html">meta</a></li><li class="navelem"><a class="el" href="selection_8h.html">selection.h</a></li>
  113. <li class="footer">Generated by
  114. <a href="http://www.doxygen.org/index.html">
  115. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  116. </ul>
  117. </div>
  118. </body>
  119. </html>