group__group-Searchable.html 90 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528
  1. <!--
  2. Copyright Louis Dionne 2013-2017
  3. Distributed under the Boost Software License, Version 1.0.
  4. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  5. -->
  6. <!-- boost-no-inspect -->
  7. <!-- HTML header for doxygen 1.8.9.1-->
  8. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  9. <html xmlns="http://www.w3.org/1999/xhtml">
  10. <head>
  11. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  12. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  13. <meta name="generator" content="Doxygen 1.8.15"/>
  14. <title>Boost.Hana: Searchable</title>
  15. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  16. <script type="text/javascript" src="jquery.js"></script>
  17. <script type="text/javascript" src="dynsections.js"></script>
  18. <link href="navtree.css" rel="stylesheet" type="text/css"/>
  19. <script type="text/javascript" src="resize.js"></script>
  20. <script type="text/javascript" src="navtreedata.js"></script>
  21. <script type="text/javascript" src="navtree.js"></script>
  22. <script type="text/javascript">
  23. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  24. $(document).ready(initResizable);
  25. /* @license-end */</script>
  26. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  27. <script type="text/javascript" src="search/searchdata.js"></script>
  28. <script type="text/javascript" src="search/search.js"></script>
  29. <script type="text/javascript">
  30. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  31. $(document).ready(function() { init_search(); });
  32. /* @license-end */
  33. </script>
  34. <script type="text/x-mathjax-config">
  35. MathJax.Hub.Config({
  36. extensions: ["tex2jax.js"],
  37. jax: ["input/TeX","output/HTML-CSS"],
  38. });
  39. // Copyright Louis Dionne 2013-2017
  40. // Distributed under the Boost Software License, Version 1.0.
  41. // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  42. MathJax.Hub.Config({
  43. "HTML-CSS": {
  44. linebreaks: {
  45. automatic: true,
  46. width: "75% container"
  47. }
  48. }
  49. });
  50. </script><script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
  51. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  52. <!-- Additional javascript for drawing charts. -->
  53. <script type="text/javascript" src="highcharts.js"></script>
  54. <script type="text/javascript" src="highcharts-data.js"></script>
  55. <script type="text/javascript" src="highcharts-exporting.js"></script>
  56. <script type="text/javascript" src="chart.js"></script>
  57. <script type="text/javascript" src="hana.js"></script>
  58. </head>
  59. <body>
  60. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  61. <div id="titlearea">
  62. <table cellspacing="0" cellpadding="0">
  63. <tbody>
  64. <tr style="height: 56px;">
  65. <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
  66. <td style="padding-left: 0.5em;">
  67. <div id="projectname">Boost.Hana
  68. &#160;<span id="projectnumber">1.6.0</span>
  69. </div>
  70. <div id="projectbrief">Your standard library for metaprogramming</div>
  71. </td>
  72. <td> <div id="MSearchBox" class="MSearchBoxInactive">
  73. <span class="left">
  74. <img id="MSearchSelect" src="search/mag_sel.png"
  75. onmouseover="return searchBox.OnSearchSelectShow()"
  76. onmouseout="return searchBox.OnSearchSelectHide()"
  77. alt=""/>
  78. <input type="text" id="MSearchField" value="Search" accesskey="S"
  79. onfocus="searchBox.OnSearchFieldFocus(true)"
  80. onblur="searchBox.OnSearchFieldFocus(false)"
  81. onkeyup="searchBox.OnSearchFieldChange(event)"/>
  82. </span><span class="right">
  83. <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
  84. </span>
  85. </div>
  86. </td>
  87. </tr>
  88. </tbody>
  89. </table>
  90. </div>
  91. <!-- end header part -->
  92. <!-- Generated by Doxygen 1.8.15 -->
  93. <script type="text/javascript">
  94. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  95. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  96. /* @license-end */
  97. </script>
  98. </div><!-- top -->
  99. <div id="side-nav" class="ui-resizable side-nav-resizable">
  100. <div id="nav-tree">
  101. <div id="nav-tree-contents">
  102. <div id="nav-sync" class="sync"></div>
  103. </div>
  104. </div>
  105. <div id="splitbar" style="-moz-user-select:none;"
  106. class="ui-resizable-handle">
  107. </div>
  108. </div>
  109. <script type="text/javascript">
  110. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  111. $(document).ready(function(){initNavTree('group__group-Searchable.html','');});
  112. /* @license-end */
  113. </script>
  114. <div id="doc-content">
  115. <!-- window showing the filter options -->
  116. <div id="MSearchSelectWindow"
  117. onmouseover="return searchBox.OnSearchSelectShow()"
  118. onmouseout="return searchBox.OnSearchSelectHide()"
  119. onkeydown="return searchBox.OnSearchSelectKey(event)">
  120. </div>
  121. <!-- iframe showing the search results (closed by default) -->
  122. <div id="MSearchResultsWindow">
  123. <iframe src="javascript:void(0)" frameborder="0"
  124. name="MSearchResults" id="MSearchResults">
  125. </iframe>
  126. </div>
  127. <div class="header">
  128. <div class="summary">
  129. <a href="#var-members">Variables</a> </div>
  130. <div class="headertitle">
  131. <div class="title">Searchable<div class="ingroups"><a class="el" href="group__group-concepts.html">Concepts</a></div></div> </div>
  132. </div><!--header-->
  133. <div class="contents">
  134. <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
  135. <p>The <code>Searchable</code> concept represents structures that can be searched. </p>
  136. <p>Intuitively, a <code>Searchable</code> is any structure, finite or infinite, containing elements that can be searched using a predicate. Sometimes, <code>Searchable</code>s will associate keys to values; one can search for a key with a predicate, and the value associated to it is returned. This gives rise to map-like data structures. Other times, the elements of the structure that are searched (i.e. those to which the predicate is applied) are the same that are returned, which gives rise to set-like data structures. In general, we will refer to the <em>keys</em> of a <code>Searchable</code> structure as those elements that are used for searching, and to the <em>values</em> of a <code>Searchable</code> as those elements that are returned when a search is successful. As was explained, there is no requirement that both notions differ, and it is often useful to have keys and values coincide (think about <code>std::set</code>).</p>
  137. <p>Some methods like <code>any_of</code>, <code>all_of</code> and <code>none_of</code> allow simple queries to be performed on the keys of the structure, while other methods like <code>find</code> and <code>find_if</code> make it possible to find the value associated to a key. The most specific method should always be used if one cares about performance, because it is usually the case that heavy optimizations can be performed in more specific methods. For example, an associative data structure implemented as a hash table will be much faster to access using <code>find</code> than <code>find_if</code>, because in the second case it will have to do a linear search through all the entries. Similarly, using <code>contains</code> will likely be much faster than <code>any_of</code> with an equivalent predicate.</p>
  138. <blockquote class="doxtable">
  139. <p><b>Insight</b><br />
  140. In a lazy evaluation context, any <code>Foldable</code> can also become a model of <code>Searchable</code> because we can search lazily through the structure with <code>fold_right</code>. However, in the context of C++, some <code>Searchable</code>s can not be folded; think for example of an infinite set. </p>
  141. </blockquote>
  142. <h2>Minimal complete definition </h2>
  143. <p><code>find_if</code> and <code>any_of</code></p>
  144. <p>When <code>find_if</code> and <code>any_of</code> are provided, the other functions are implemented according to the laws explained below.</p>
  145. <dl class="section note"><dt>Note</dt><dd>We could implement <code>any_of(xs, pred)</code> by checking whether <code>find_if(xs, pred)</code> is an empty <code>optional</code> or not, and then reduce the minimal complete definition to <code>find_if</code>. However, this is not done because that implementation requires the predicate of <code>any_of</code> to return a compile-time <code>Logical</code>, which is more restrictive than what we have right now.</dd></dl>
  146. <h2>Laws </h2>
  147. <p>In order for the semantics of the methods to be consistent, some properties must be satisfied by any model of the <code>Searchable</code> concept. Rigorously, for any <code>Searchable</code>s <code>xs</code> and <code>ys</code> and any predicate <code>p</code>, the following laws should be satisfied: </p><div class="fragment"><div class="line"><a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">any_of</a>(xs, p) &lt;=&gt; !<a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">all_of</a>(xs, negated p)</div><div class="line"> &lt;=&gt; !<a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">none_of</a>(xs, p)</div><div class="line"></div><div class="line"><a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">contains</a>(xs, x) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">any_of</a>(xs, <a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">equal</a>.to(x))</div><div class="line"></div><div class="line"><a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">find</a>(xs, x) == <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">find_if</a>(xs, <a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">equal</a>.to(x))</div><div class="line"><a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">find_if</a>(xs, <a class="code" href="group__group-functional.html#ga835970cb25a0c8dc200f1e5f8943538b">always</a>(false_)) == nothing</div><div class="line"></div><div class="line"><a class="code" href="group__group-Searchable.html#gadccfc79f1acdd8043d2baa16df16ec9f">is_subset</a>(xs, ys) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">all_of</a>(xs, [](<span class="keyword">auto</span> x) { <span class="keywordflow">return</span> <a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">contains</a>(ys, x); })</div><div class="line"><a class="code" href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">is_disjoint</a>(xs, ys) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">none_of</a>(xs, [](<span class="keyword">auto</span> x) { <span class="keywordflow">return</span> <a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">contains</a>(ys, x); })</div></div><!-- fragment --><p>Additionally, if all the keys of the <code>Searchable</code> are <code>Logical</code>s, the following laws should be satisfied: </p><div class="fragment"><div class="line"><a class="code" href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">any</a>(xs) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">any_of</a>(xs, <span class="keywordtype">id</span>)</div><div class="line"><a class="code" href="group__group-Searchable.html#ga81ae9764dd7818ad36270c6419fb1082">all</a>(xs) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">all_of</a>(xs, <span class="keywordtype">id</span>)</div><div class="line"><a class="code" href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">none</a>(xs) &lt;=&gt; <a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">none_of</a>(xs, <span class="keywordtype">id</span>)</div></div><!-- fragment --><h2>Concrete models </h2>
  148. <p><code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys.">hana::map</a></code>, <code><a class="el" href="structboost_1_1hana_1_1optional.html" title="Optional value whose optional-ness is known at compile-time.">hana::optional</a></code>, <code><a class="el" href="structboost_1_1hana_1_1range.html" title="Compile-time half-open interval of hana::integral_constants.">hana::range</a></code>, <code><a class="el" href="structboost_1_1hana_1_1set.html" title="Basic unordered container requiring unique, Comparable and Hashable keys.">hana::set</a></code>, <code><a class="el" href="structboost_1_1hana_1_1string.html" title="Compile-time string.">hana::string</a></code>, <code><a class="el" href="structboost_1_1hana_1_1tuple.html" title="General purpose index-based heterogeneous sequence with a fixed length.">hana::tuple</a></code></p>
  149. <h2>Free model for builtin arrays </h2>
  150. <p>Builtin arrays whose size is known can be searched as-if they were homogeneous tuples. However, since arrays can only hold objects of a single type and the predicate to <code>find_if</code> must return a compile-time <code>Logical</code>, the <code>find_if</code> method is fairly useless. For similar reasons, the <code>find</code> method is also fairly useless. This model is provided mainly because of the <code>any_of</code> method &amp; friends, which are both useful and compile-time efficient.</p>
  151. <h2>Structure preserving functions </h2>
  152. <p>Given two <code>Searchables</code> <code>S1</code> and <code>S2</code>, a function \( f : S_1(X) \to S_2(X) \) is said to preserve the <code>Searchable</code> structure if for all <code>xs</code> of data type <code>S1(X)</code> and predicates \( \mathtt{pred} : X \to Bool \) (for a <code>Logical</code> <code>Bool</code>), </p><div class="fragment"><div class="line"><a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">any_of</a>(xs, pred) <span class="keywordflow">if</span> and only <span class="keywordflow">if</span> <a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">any_of</a>(f(xs), pred)</div><div class="line"><a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">find_if</a>(xs, pred) == <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">find_if</a>(f(xs), pred)</div></div><!-- fragment --><p>This is really just a generalization of the following, more intuitive requirements. For all <code>xs</code> of data type <code>S1(X)</code> and <code>x</code> of data type <code>X</code>, </p><div class="fragment"><div class="line">x ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ xs <span class="keywordflow">if</span> and only <span class="keywordflow">if</span> x ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ f(xs)</div><div class="line"><a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">find</a>(xs, x) == <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">find</a>(f(xs), x)</div></div><!-- fragment --><p>These requirements can be understood as saying that <code>f</code> does not change the content of <code>xs</code>, although it may reorder elements. As usual, such a structure-preserving transformation is said to be an embedding if it is also injective, i.e. if it is a lossless transformation. </p>
  153. <table class="memberdecls">
  154. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="var-members"></a>
  155. Variables</h2></td></tr>
  156. <tr class="memitem:ga81ae9764dd7818ad36270c6419fb1082"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga81ae9764dd7818ad36270c6419fb1082">boost::hana::all</a></td></tr>
  157. <tr class="memdesc:ga81ae9764dd7818ad36270c6419fb1082"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether all the keys of the structure are true-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a false-valued key must appear at a finite "index" in order for this method to finish. <a href="group__group-Searchable.html#ga81ae9764dd7818ad36270c6419fb1082">More...</a><br /></td></tr>
  158. <tr class="separator:ga81ae9764dd7818ad36270c6419fb1082"><td class="memSeparator" colspan="2">&#160;</td></tr>
  159. <tr class="memitem:ga3a168950082f38afd9edf256f336c8ba"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">boost::hana::all_of</a></td></tr>
  160. <tr class="memdesc:ga3a168950082f38afd9edf256f336c8ba"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether all the keys of the structure satisfy the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to return a false- valued <code>Logical</code> after looking at a finite number of keys for this method to finish. <a href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">More...</a><br /></td></tr>
  161. <tr class="separator:ga3a168950082f38afd9edf256f336c8ba"><td class="memSeparator" colspan="2">&#160;</td></tr>
  162. <tr class="memitem:gab7d632b9319b10b1eb7e98f9e1cf8a28"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">boost::hana::any</a></td></tr>
  163. <tr class="memdesc:gab7d632b9319b10b1eb7e98f9e1cf8a28"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether any key of the structure is true-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a true-valued key must appear at a finite "index" in order for this method to finish. <a href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">More...</a><br /></td></tr>
  164. <tr class="separator:gab7d632b9319b10b1eb7e98f9e1cf8a28"><td class="memSeparator" colspan="2">&#160;</td></tr>
  165. <tr class="memitem:ga5f7ff0125c448983e1b96c3ffb84f646"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">boost::hana::any_of</a></td></tr>
  166. <tr class="memdesc:ga5f7ff0125c448983e1b96c3ffb84f646"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether any key of the structure satisfies the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to be satisfied after looking at a finite number of keys for this method to finish. <a href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">More...</a><br /></td></tr>
  167. <tr class="separator:ga5f7ff0125c448983e1b96c3ffb84f646"><td class="memSeparator" colspan="2">&#160;</td></tr>
  168. <tr class="memitem:ga3c1826aee6c6eb577810bb99c5c3e53d"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga3c1826aee6c6eb577810bb99c5c3e53d">boost::hana::at_key</a></td></tr>
  169. <tr class="memdesc:ga3c1826aee6c6eb577810bb99c5c3e53d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the value associated to the given key in a structure, or fail.Given a <code>key</code> and a <code>Searchable</code> structure, <code>at_key</code> returns the first value whose key is equal to the given <code>key</code>, and fails at compile-time if no such key exists. This requires the <code>key</code> to be compile-time <code>Comparable</code>, exactly like for <code>find</code>. <code>at_key</code> satisfies the following: <a href="group__group-Searchable.html#ga3c1826aee6c6eb577810bb99c5c3e53d">More...</a><br /></td></tr>
  170. <tr class="separator:ga3c1826aee6c6eb577810bb99c5c3e53d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  171. <tr class="memitem:ga38e7748956cbc9f3d9bb035ac8577906"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">boost::hana::contains</a></td></tr>
  172. <tr class="memdesc:ga38e7748956cbc9f3d9bb035ac8577906"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the key occurs in the structure.Given a <code>Searchable</code> structure <code>xs</code> and a <code>key</code>, <code>contains</code> returns whether any of the keys of the structure is equal to the given <code>key</code>. If the structure is not finite, an equal key has to appear at a finite position in the structure for this method to finish. For convenience, <code>contains</code> can also be applied in infix notation. <a href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">More...</a><br /></td></tr>
  173. <tr class="separator:ga38e7748956cbc9f3d9bb035ac8577906"><td class="memSeparator" colspan="2">&#160;</td></tr>
  174. <tr class="memitem:ga0d9456ceda38b6ca664998e79d7c45b7"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">boost::hana::in</a> = <a class="el" href="group__group-functional.html#ga7bdafba6dc801f1d2d83731ad9714557">hana::infix</a>(<a class="el" href="group__group-functional.html#ga004f884cdbb85c2efe3383c1db450094">hana::flip</a>(<a class="el" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>))</td></tr>
  175. <tr class="memdesc:ga0d9456ceda38b6ca664998e79d7c45b7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return whether the key occurs in the structure.Specifically, this is equivalent to <code>contains</code>, except <code>in</code> takes its arguments in reverse order. Like <code>contains</code>, <code>in</code> can also be applied in infix notation for increased expressiveness. This function is not a method that can be overriden; it is just a convenience function provided with the concept. <a href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">More...</a><br /></td></tr>
  176. <tr class="separator:ga0d9456ceda38b6ca664998e79d7c45b7"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:ga6b6cdd69942b0fe3bf5254247f9c861e"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">boost::hana::find</a></td></tr>
  178. <tr class="memdesc:ga6b6cdd69942b0fe3bf5254247f9c861e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the value associated to the given key in a structure.Given a <code>key</code> and a <code>Searchable</code> structure, <code>find</code> returns the <code>just</code> the first value whose key is equal to the given <code>key</code>, or <code>nothing</code> if there is no such key. Comparison is done with <code>equal</code>. <code>find</code> satisfies the following: <a href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">More...</a><br /></td></tr>
  179. <tr class="separator:ga6b6cdd69942b0fe3bf5254247f9c861e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  180. <tr class="memitem:ga7f99b80672aa80a7eb8b223955ce546f"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">boost::hana::find_if</a></td></tr>
  181. <tr class="memdesc:ga7f99b80672aa80a7eb8b223955ce546f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Finds the value associated to the first key satisfying a predicate.Given a <code>Searchable</code> structure <code>xs</code> and a predicate <code>pred</code>, <code>find_if(xs, pred)</code> returns <code>just</code> the first element whose key satisfies the predicate, or <code>nothing</code> if there is no such element. <a href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">More...</a><br /></td></tr>
  182. <tr class="separator:ga7f99b80672aa80a7eb8b223955ce546f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  183. <tr class="memitem:ga3b8269d4f5cdd6dd549fae32280795a0"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">boost::hana::is_disjoint</a></td></tr>
  184. <tr class="memdesc:ga3b8269d4f5cdd6dd549fae32280795a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether two <code>Searchable</code>s are disjoint.Given two <code>Searchable</code>s <code>xs</code> and <code>ys</code>, <code>is_disjoint</code> returns a <code>Logical</code> representing whether the keys in <code>xs</code> are disjoint from the keys in <code>ys</code>, i.e. whether both structures have no keys in common. <a href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">More...</a><br /></td></tr>
  185. <tr class="separator:ga3b8269d4f5cdd6dd549fae32280795a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
  186. <tr class="memitem:gadccfc79f1acdd8043d2baa16df16ec9f"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#gadccfc79f1acdd8043d2baa16df16ec9f">boost::hana::is_subset</a></td></tr>
  187. <tr class="memdesc:gadccfc79f1acdd8043d2baa16df16ec9f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether a structure contains a subset of the keys of another structure.Given two <code>Searchable</code>s <code>xs</code> and <code>ys</code>, <code>is_subset</code> returns a <code>Logical</code> representing whether <code>xs</code> is a subset of <code>ys</code>. In other words, it returns whether all the keys of <code>xs</code> are also present in <code>ys</code>. This method does not return whether <code>xs</code> is a <em>strict</em> subset of <code>ys</code>; if <code>xs</code> and <code>ys</code> are equal, all the keys of <code>xs</code> are also present in <code>ys</code>, and <code>is_subset</code> returns true. <a href="group__group-Searchable.html#gadccfc79f1acdd8043d2baa16df16ec9f">More...</a><br /></td></tr>
  188. <tr class="separator:gadccfc79f1acdd8043d2baa16df16ec9f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  189. <tr class="memitem:ga614ff1e575806f59246b17006e19d479"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">boost::hana::none</a></td></tr>
  190. <tr class="memdesc:ga614ff1e575806f59246b17006e19d479"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether all of the keys of the structure are false-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a true-valued key must appear at a finite "index" in order for this method to finish. <a href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">More...</a><br /></td></tr>
  191. <tr class="separator:ga614ff1e575806f59246b17006e19d479"><td class="memSeparator" colspan="2">&#160;</td></tr>
  192. <tr class="memitem:ga43954c791b5b1351fb009e2a643d00f5"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">boost::hana::none_of</a></td></tr>
  193. <tr class="memdesc:ga43954c791b5b1351fb009e2a643d00f5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether none of the keys of the structure satisfy the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to return a true- valued <code>Logical</code> after looking at a finite number of keys for this method to finish. <a href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">More...</a><br /></td></tr>
  194. <tr class="separator:ga43954c791b5b1351fb009e2a643d00f5"><td class="memSeparator" colspan="2">&#160;</td></tr>
  195. </table>
  196. <h2 class="groupheader">Variable Documentation</h2>
  197. <a id="ga81ae9764dd7818ad36270c6419fb1082"></a>
  198. <h2 class="memtitle"><span class="permalink"><a href="#ga81ae9764dd7818ad36270c6419fb1082">&#9670;&nbsp;</a></span>all</h2>
  199. <div class="memitem">
  200. <div class="memproto">
  201. <table class="memname">
  202. <tr>
  203. <td class="memname">constexpr auto boost::hana::all</td>
  204. </tr>
  205. </table>
  206. </div><div class="memdoc">
  207. <p><code>#include &lt;<a class="el" href="fwd_2all_8hpp.html">boost/hana/fwd/all.hpp</a>&gt;</code></p>
  208. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  209. <p>Returns whether all the keys of the structure are true-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a false-valued key must appear at a finite "index" in order for this method to finish. </p>
  210. <h2>Example </h2>
  211. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="all_8hpp.html">boost/hana/all.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="bool_8hpp.html">boost/hana/bool.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#ga81ae9764dd7818ad36270c6419fb1082">hana::all</a>(hana::make_tuple(hana::true_c, <span class="keyword">true</span>, hana::true_c)), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga81ae9764dd7818ad36270c6419fb1082">hana::all</a>(hana::make_tuple(<span class="keyword">true</span>, hana::false_c, hana::true_c)));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  212. </div>
  213. </div>
  214. <a id="ga3a168950082f38afd9edf256f336c8ba"></a>
  215. <h2 class="memtitle"><span class="permalink"><a href="#ga3a168950082f38afd9edf256f336c8ba">&#9670;&nbsp;</a></span>all_of</h2>
  216. <div class="memitem">
  217. <div class="memproto">
  218. <table class="memname">
  219. <tr>
  220. <td class="memname">constexpr auto boost::hana::all_of</td>
  221. </tr>
  222. </table>
  223. </div><div class="memdoc">
  224. <p><code>#include &lt;<a class="el" href="fwd_2all__of_8hpp.html">boost/hana/fwd/all_of.hpp</a>&gt;</code></p>
  225. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; predicate) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  226. <p>Returns whether all the keys of the structure satisfy the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to return a false- valued <code>Logical</code> after looking at a finite number of keys for this method to finish. </p>
  227. <dl class="params"><dt>Parameters</dt><dd>
  228. <table class="params">
  229. <tr><td class="paramname">xs</td><td>The structure to search.</td></tr>
  230. <tr><td class="paramname">predicate</td><td>A function called as <code>predicate(k)</code>, where <code>k</code> is a key of the structure, and returning a <code>Logical</code>.</td></tr>
  231. </table>
  232. </dd>
  233. </dl>
  234. <h2>Example </h2>
  235. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="all__of_8hpp.html">boost/hana/all_of.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mod_8hpp.html">boost/hana/mod.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="traits_8hpp.html">boost/hana/traits.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">BOOST_HANA_CONSTEXPR_LAMBDA <span class="keyword">auto</span> is_odd = [](<span class="keyword">auto</span> x) {</div><div class="line"> <span class="keywordflow">return</span> x % 2_c != 0_c;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#gac7aafc41e4dcc7d1f1929fb00f010d2a">BOOST_HANA_CONSTEXPR_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">hana::all_of</a>(hana::make_tuple(1, 3), is_odd));</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">hana::all_of</a>(hana::make_tuple(3_c, 4_c), is_odd));</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> !<a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">hana::all_of</a>(hana::make_tuple(hana::type&lt;void&gt;{}, hana::type&lt;char&amp;&gt;{}),</div><div class="line"> hana::traits::is_void)</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga3a168950082f38afd9edf256f336c8ba">hana::all_of</a>(hana::make_tuple(hana::type_c&lt;int&gt;, hana::type_c&lt;char&gt;),</div><div class="line"> hana::traits::is_integral)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment -->
  236. </div>
  237. </div>
  238. <a id="gab7d632b9319b10b1eb7e98f9e1cf8a28"></a>
  239. <h2 class="memtitle"><span class="permalink"><a href="#gab7d632b9319b10b1eb7e98f9e1cf8a28">&#9670;&nbsp;</a></span>any</h2>
  240. <div class="memitem">
  241. <div class="memproto">
  242. <table class="memname">
  243. <tr>
  244. <td class="memname">constexpr auto boost::hana::any</td>
  245. </tr>
  246. </table>
  247. </div><div class="memdoc">
  248. <p><code>#include &lt;<a class="el" href="fwd_2any_8hpp.html">boost/hana/fwd/any.hpp</a>&gt;</code></p>
  249. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  250. <p>Returns whether any key of the structure is true-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a true-valued key must appear at a finite "index" in order for this method to finish. </p>
  251. <h2>Example </h2>
  252. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="any_8hpp.html">boost/hana/any.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="bool_8hpp.html">boost/hana/bool.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">hana::any</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, hana::true_c)));</div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">hana::any</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, <span class="keyword">true</span>)), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line">static_assert(!<a class="code" href="group__group-Searchable.html#gab7d632b9319b10b1eb7e98f9e1cf8a28">hana::any</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, hana::false_c)), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  253. </div>
  254. </div>
  255. <a id="ga5f7ff0125c448983e1b96c3ffb84f646"></a>
  256. <h2 class="memtitle"><span class="permalink"><a href="#ga5f7ff0125c448983e1b96c3ffb84f646">&#9670;&nbsp;</a></span>any_of</h2>
  257. <div class="memitem">
  258. <div class="memproto">
  259. <table class="memname">
  260. <tr>
  261. <td class="memname">constexpr auto boost::hana::any_of</td>
  262. </tr>
  263. </table>
  264. </div><div class="memdoc">
  265. <p><code>#include &lt;<a class="el" href="fwd_2any__of_8hpp.html">boost/hana/fwd/any_of.hpp</a>&gt;</code></p>
  266. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; predicate) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  267. <p>Returns whether any key of the structure satisfies the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to be satisfied after looking at a finite number of keys for this method to finish. </p>
  268. <dl class="params"><dt>Parameters</dt><dd>
  269. <table class="params">
  270. <tr><td class="paramname">xs</td><td>The structure to search.</td></tr>
  271. <tr><td class="paramname">predicate</td><td>A function called as <code>predicate(k)</code>, where <code>k</code> is a key of the structure, and returning a <code>Logical</code>.</td></tr>
  272. </table>
  273. </dd>
  274. </dl>
  275. <h2>Example </h2>
  276. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="any__of_8hpp.html">boost/hana/any_of.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mod_8hpp.html">boost/hana/mod.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="traits_8hpp.html">boost/hana/traits.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">BOOST_HANA_CONSTEXPR_LAMBDA <span class="keyword">auto</span> is_odd = [](<span class="keyword">auto</span> x) {</div><div class="line"> <span class="keywordflow">return</span> x % 2_c != 0_c;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#gac7aafc41e4dcc7d1f1929fb00f010d2a">BOOST_HANA_CONSTEXPR_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">hana::any_of</a>(hana::make_tuple(1, 2), is_odd));</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">hana::any_of</a>(hana::make_tuple(2_c, 4_c), is_odd));</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">hana::any_of</a>(hana::make_tuple(hana::type&lt;void&gt;{}, hana::type&lt;char&amp;&gt;{}),</div><div class="line"> hana::traits::is_void)</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> !<a class="code" href="group__group-Searchable.html#ga5f7ff0125c448983e1b96c3ffb84f646">hana::any_of</a>(hana::make_tuple(hana::type&lt;void&gt;{}, hana::type&lt;char&amp;&gt;{}),</div><div class="line"> hana::traits::is_integral)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment -->
  277. </div>
  278. </div>
  279. <a id="ga3c1826aee6c6eb577810bb99c5c3e53d"></a>
  280. <h2 class="memtitle"><span class="permalink"><a href="#ga3c1826aee6c6eb577810bb99c5c3e53d">&#9670;&nbsp;</a></span>at_key</h2>
  281. <div class="memitem">
  282. <div class="memproto">
  283. <table class="memname">
  284. <tr>
  285. <td class="memname">constexpr auto boost::hana::at_key</td>
  286. </tr>
  287. </table>
  288. </div><div class="memdoc">
  289. <p><code>#include &lt;<a class="el" href="fwd_2at__key_8hpp.html">boost/hana/fwd/at_key.hpp</a>&gt;</code></p>
  290. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span> <span class="keyword">const</span>&amp; key) -&gt; decltype(<span class="keyword">auto</span>) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  291. <p>Returns the value associated to the given key in a structure, or fail.Given a <code>key</code> and a <code>Searchable</code> structure, <code>at_key</code> returns the first value whose key is equal to the given <code>key</code>, and fails at compile-time if no such key exists. This requires the <code>key</code> to be compile-time <code>Comparable</code>, exactly like for <code>find</code>. <code>at_key</code> satisfies the following: </p>
  292. <div class="fragment"><div class="line"><a class="code" href="group__group-Searchable.html#ga3c1826aee6c6eb577810bb99c5c3e53d">at_key</a>(xs, key) == <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">find</a>(xs, key).value()</div></div><!-- fragment --><p>If the <code>Searchable</code> actually stores the elements it contains, <code>at_key</code> is required to return a lvalue reference, a lvalue reference to const or a rvalue reference to the found value, where the type of reference must match that of the structure passed to <code>at_key</code>. If the <code>Searchable</code> does not store the elements it contains (i.e. it generates them on demand), this requirement is dropped.</p>
  293. <dl class="params"><dt>Parameters</dt><dd>
  294. <table class="params">
  295. <tr><td class="paramname">xs</td><td>The structure to be searched.</td></tr>
  296. <tr><td class="paramname">key</td><td>A key to be searched for in the structure. The key has to be <code>Comparable</code> with the other keys of the structure. In the current version of the library, the comparison of <code>key</code> with any other key of the structure must return a compile-time <code>Logical</code>.</td></tr>
  297. </table>
  298. </dd>
  299. </dl>
  300. <h2>Example </h2>
  301. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="at__key_8hpp.html">boost/hana/at_key.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <span class="keyword">auto</span> m = hana::make_map(</div><div class="line"> hana::make_pair(hana::type&lt;int&gt;{}, std::string{<span class="stringliteral">&quot;int&quot;</span>}),</div><div class="line"> hana::make_pair(hana::int_&lt;3&gt;{}, std::string{<span class="stringliteral">&quot;3&quot;</span>})</div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga3c1826aee6c6eb577810bb99c5c3e53d">hana::at_key</a>(m, hana::type&lt;int&gt;{}) == <span class="stringliteral">&quot;int&quot;</span>);</div><div class="line"></div><div class="line"> <span class="comment">// usage as operator[]</span></div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(m[hana::type&lt;int&gt;{}] == <span class="stringliteral">&quot;int&quot;</span>);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(m[hana::int_&lt;3&gt;{}] == <span class="stringliteral">&quot;3&quot;</span>);</div><div class="line">}</div></div><!-- fragment -->
  302. </div>
  303. </div>
  304. <a id="ga38e7748956cbc9f3d9bb035ac8577906"></a>
  305. <h2 class="memtitle"><span class="permalink"><a href="#ga38e7748956cbc9f3d9bb035ac8577906">&#9670;&nbsp;</a></span>contains</h2>
  306. <div class="memitem">
  307. <div class="memproto">
  308. <table class="memname">
  309. <tr>
  310. <td class="memname">constexpr auto boost::hana::contains</td>
  311. </tr>
  312. </table>
  313. </div><div class="memdoc">
  314. <p><code>#include &lt;<a class="el" href="fwd_2contains_8hpp.html">boost/hana/fwd/contains.hpp</a>&gt;</code></p>
  315. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; key) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  316. <p>Returns whether the key occurs in the structure.Given a <code>Searchable</code> structure <code>xs</code> and a <code>key</code>, <code>contains</code> returns whether any of the keys of the structure is equal to the given <code>key</code>. If the structure is not finite, an equal key has to appear at a finite position in the structure for this method to finish. For convenience, <code>contains</code> can also be applied in infix notation. </p>
  317. <dl class="params"><dt>Parameters</dt><dd>
  318. <table class="params">
  319. <tr><td class="paramname">xs</td><td>The structure to search.</td></tr>
  320. <tr><td class="paramname">key</td><td>A key to be searched for in the structure. The key has to be <code>Comparable</code> with the other keys of the structure.</td></tr>
  321. </table>
  322. </dd>
  323. </dl>
  324. <h2>Example </h2>
  325. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="set_8hpp.html">boost/hana/set.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>(hana::make_tuple(2, hana::int_c&lt;2&gt;, hana::int_c&lt;3&gt;, <span class="charliteral">&#39;x&#39;</span>), hana::int_c&lt;3&gt;));</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>(hana::make_set(hana::int_c&lt;3&gt;, hana::type_c&lt;void&gt;), hana::type_c&lt;void&gt;));</div><div class="line"></div><div class="line"><span class="comment">// contains can be applied in infix notation</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> hana::make_tuple(2, hana::int_c&lt;2&gt;, hana::int_c&lt;3&gt;, <span class="charliteral">&#39;x&#39;</span>) ^<a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>^ hana::int_c&lt;2&gt;</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  326. </div>
  327. </div>
  328. <a id="ga0d9456ceda38b6ca664998e79d7c45b7"></a>
  329. <h2 class="memtitle"><span class="permalink"><a href="#ga0d9456ceda38b6ca664998e79d7c45b7">&#9670;&nbsp;</a></span>in</h2>
  330. <div class="memitem">
  331. <div class="memproto">
  332. <table class="memname">
  333. <tr>
  334. <td class="memname">constexpr auto boost::hana::in = <a class="el" href="group__group-functional.html#ga7bdafba6dc801f1d2d83731ad9714557">hana::infix</a>(<a class="el" href="group__group-functional.html#ga004f884cdbb85c2efe3383c1db450094">hana::flip</a>(<a class="el" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>))</td>
  335. </tr>
  336. </table>
  337. </div><div class="memdoc">
  338. <p><code>#include &lt;<a class="el" href="fwd_2contains_8hpp.html">boost/hana/fwd/contains.hpp</a>&gt;</code></p>
  339. <p>Return whether the key occurs in the structure.Specifically, this is equivalent to <code>contains</code>, except <code>in</code> takes its arguments in reverse order. Like <code>contains</code>, <code>in</code> can also be applied in infix notation for increased expressiveness. This function is not a method that can be overriden; it is just a convenience function provided with the concept. </p>
  340. <h2>Example </h2>
  341. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::int_c&lt;2&gt; ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ hana::make_tuple(2, hana::int_c&lt;2&gt;, hana::int_c&lt;3&gt;, <span class="charliteral">&#39;x&#39;</span>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  342. </div>
  343. </div>
  344. <a id="ga6b6cdd69942b0fe3bf5254247f9c861e"></a>
  345. <h2 class="memtitle"><span class="permalink"><a href="#ga6b6cdd69942b0fe3bf5254247f9c861e">&#9670;&nbsp;</a></span>find</h2>
  346. <div class="memitem">
  347. <div class="memproto">
  348. <table class="memname">
  349. <tr>
  350. <td class="memname">constexpr auto boost::hana::find</td>
  351. </tr>
  352. </table>
  353. </div><div class="memdoc">
  354. <p><code>#include &lt;<a class="el" href="fwd_2find_8hpp.html">boost/hana/fwd/find.hpp</a>&gt;</code></p>
  355. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span> <span class="keyword">const</span>&amp; key) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  356. <p>Finds the value associated to the given key in a structure.Given a <code>key</code> and a <code>Searchable</code> structure, <code>find</code> returns the <code>just</code> the first value whose key is equal to the given <code>key</code>, or <code>nothing</code> if there is no such key. Comparison is done with <code>equal</code>. <code>find</code> satisfies the following: </p>
  357. <div class="fragment"><div class="line"><a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">find</a>(xs, key) == <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">find_if</a>(xs, <a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">equal</a>.to(key))</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  358. <table class="params">
  359. <tr><td class="paramname">xs</td><td>The structure to be searched.</td></tr>
  360. <tr><td class="paramname">key</td><td>A key to be searched for in the structure. The key has to be <code>Comparable</code> with the other keys of the structure. In the current version of the library, the comparison of <code>key</code> with any other key of the structure must return a compile-time <code>Logical</code>.</td></tr>
  361. </table>
  362. </dd>
  363. </dl>
  364. <h2>Example </h2>
  365. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(hana::make_tuple(hana::int_c&lt;1&gt;, hana::type_c&lt;int&gt;, <span class="charliteral">&#39;3&#39;</span>), hana::type_c&lt;int&gt;) == hana::just(hana::type_c&lt;int&gt;)</div><div class="line">);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(hana::make_tuple(hana::int_c&lt;1&gt;, hana::type_c&lt;int&gt;, <span class="charliteral">&#39;3&#39;</span>), hana::type_c&lt;void&gt;) == hana::nothing</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m = hana::make_map(</div><div class="line"> hana::make_pair(hana::int_c&lt;2&gt;, 2),</div><div class="line"> hana::make_pair(hana::type_c&lt;float&gt;, 3.3),</div><div class="line"> hana::make_pair(hana::type_c&lt;char&gt;, hana::type_c&lt;int&gt;)</div><div class="line">);</div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(m, hana::type_c&lt;float&gt;) == hana::just(3.3), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  366. </div>
  367. </div>
  368. <a id="ga7f99b80672aa80a7eb8b223955ce546f"></a>
  369. <h2 class="memtitle"><span class="permalink"><a href="#ga7f99b80672aa80a7eb8b223955ce546f">&#9670;&nbsp;</a></span>find_if</h2>
  370. <div class="memitem">
  371. <div class="memproto">
  372. <table class="memname">
  373. <tr>
  374. <td class="memname">constexpr auto boost::hana::find_if</td>
  375. </tr>
  376. </table>
  377. </div><div class="memdoc">
  378. <p><code>#include &lt;<a class="el" href="fwd_2find__if_8hpp.html">boost/hana/fwd/find_if.hpp</a>&gt;</code></p>
  379. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; predicate) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  380. <p>Finds the value associated to the first key satisfying a predicate.Given a <code>Searchable</code> structure <code>xs</code> and a predicate <code>pred</code>, <code>find_if(xs, pred)</code> returns <code>just</code> the first element whose key satisfies the predicate, or <code>nothing</code> if there is no such element. </p>
  381. <dl class="params"><dt>Parameters</dt><dd>
  382. <table class="params">
  383. <tr><td class="paramname">xs</td><td>The structure to be searched.</td></tr>
  384. <tr><td class="paramname">predicate</td><td>A function called as <code>predicate(k)</code>, where <code>k</code> is a key of the structure, and returning whether <code>k</code> is the key of the element being searched for. In the current version of the library, the predicate has to return an <code><a class="el" href="structboost_1_1hana_1_1IntegralConstant.html" title="The IntegralConstant concept represents compile-time integral values.">IntegralConstant</a></code> holding a value that can be converted to <code>bool</code>.</td></tr>
  385. </table>
  386. </dd>
  387. </dl>
  388. <h2>Example </h2>
  389. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find__if_8hpp.html">boost/hana/find_if.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="compose_8hpp.html">boost/hana/functional/compose.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="comment">// First get the type of the object, and then call the trait on it.</span></div><div class="line">constexpr <span class="keyword">auto</span> is_integral = <a class="code" href="group__group-functional.html#ga3b16146e53efcdf9ecbb9a7b21f8cd0b">hana::compose</a>(hana::trait&lt;std::is_integral&gt;, hana::typeid_);</div><div class="line">constexpr <span class="keyword">auto</span> is_class = <a class="code" href="group__group-functional.html#ga3b16146e53efcdf9ecbb9a7b21f8cd0b">hana::compose</a>(hana::trait&lt;std::is_class&gt;, hana::typeid_);</div><div class="line"></div><div class="line">static_assert(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">hana::find_if</a>(hana::make_tuple(1.0, 2, <span class="charliteral">&#39;3&#39;</span>), is_integral) == hana::just(2)</div><div class="line">, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">hana::find_if</a>(hana::make_tuple(1.0, 2, <span class="charliteral">&#39;3&#39;</span>), is_class) == hana::nothing</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> types = hana::tuple_t&lt;char, int, unsigned, long, unsigned long&gt;;</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">hana::find_if</a>(types, <a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>.<a class="code" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>(hana::type_c&lt;unsigned&gt;)) == hana::just(hana::type_c&lt;unsigned&gt;)</div><div class="line">);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga7f99b80672aa80a7eb8b223955ce546f">hana::find_if</a>(types, <a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>.<a class="code" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>(hana::type_c&lt;void&gt;)) == hana::nothing</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  390. </div>
  391. </div>
  392. <a id="ga3b8269d4f5cdd6dd549fae32280795a0"></a>
  393. <h2 class="memtitle"><span class="permalink"><a href="#ga3b8269d4f5cdd6dd549fae32280795a0">&#9670;&nbsp;</a></span>is_disjoint</h2>
  394. <div class="memitem">
  395. <div class="memproto">
  396. <table class="memname">
  397. <tr>
  398. <td class="memname">constexpr auto boost::hana::is_disjoint</td>
  399. </tr>
  400. </table>
  401. </div><div class="memdoc">
  402. <p><code>#include &lt;<a class="el" href="fwd_2is__disjoint_8hpp.html">boost/hana/fwd/is_disjoint.hpp</a>&gt;</code></p>
  403. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span> <span class="keyword">const</span>&amp; xs, <span class="keyword">auto</span> <span class="keyword">const</span>&amp; ys) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  404. <p>Returns whether two <code>Searchable</code>s are disjoint.Given two <code>Searchable</code>s <code>xs</code> and <code>ys</code>, <code>is_disjoint</code> returns a <code>Logical</code> representing whether the keys in <code>xs</code> are disjoint from the keys in <code>ys</code>, i.e. whether both structures have no keys in common. </p>
  405. <dl class="params"><dt>Parameters</dt><dd>
  406. <table class="params">
  407. <tr><td class="paramname">xs,ys</td><td>Two <code>Searchable</code>s to test for disjointness.</td></tr>
  408. </table>
  409. </dd>
  410. </dl>
  411. <h2>Example </h2>
  412. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="is__disjoint_8hpp.html">boost/hana/is_disjoint.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="set_8hpp.html">boost/hana/set.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <span class="comment">// Tuples</span></div><div class="line"> <span class="keyword">auto</span> xs = hana::make_tuple(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;alfa&quot;</span>s, hana::type_c&lt;int&gt;);</div><div class="line"> <span class="keyword">auto</span> ys = hana::make_tuple(hana::type_c&lt;void&gt;, hana::int_c&lt;3&gt;, <span class="stringliteral">&quot;bravo&quot;</span>s);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga4796ae107d58b67e0bbccd5ae6f70101">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">hana::is_disjoint</a>(xs, ys));</div><div class="line"></div><div class="line"> <span class="comment">// Sets</span></div><div class="line"> <span class="keyword">auto</span> s1 = hana::make_set(hana::int_c&lt;1&gt;, hana::type_c&lt;void&gt;, hana::int_c&lt;2&gt;);</div><div class="line"> <span class="keyword">auto</span> s2 = hana::make_set(hana::type_c&lt;char&gt;, hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;);</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">hana::is_disjoint</a>(s1, s2));</div><div class="line"></div><div class="line"> <span class="comment">// Maps</span></div><div class="line"> <span class="keyword">auto</span> vowels = hana::make_map(</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;a&#39;&gt;, <span class="stringliteral">&quot;alfa&quot;</span>s),</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;e&#39;&gt;, <span class="stringliteral">&quot;echo&quot;</span>s),</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;i&#39;&gt;, <span class="stringliteral">&quot;india&quot;</span>s)</div><div class="line"> <span class="comment">// ...</span></div><div class="line"> );</div><div class="line"></div><div class="line"> <span class="keyword">auto</span> consonants = hana::make_map(</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;b&#39;&gt;, <span class="stringliteral">&quot;bravo&quot;</span>s),</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;c&#39;&gt;, <span class="stringliteral">&quot;charlie&quot;</span>s),</div><div class="line"> hana::make_pair(hana::char_c&lt;&#39;f&#39;&gt;, <span class="stringliteral">&quot;foxtrot&quot;</span>s)</div><div class="line"> <span class="comment">// ...</span></div><div class="line"> );</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga3b8269d4f5cdd6dd549fae32280795a0">hana::is_disjoint</a>(vowels, consonants));</div><div class="line">}</div></div><!-- fragment -->
  413. </div>
  414. </div>
  415. <a id="gadccfc79f1acdd8043d2baa16df16ec9f"></a>
  416. <h2 class="memtitle"><span class="permalink"><a href="#gadccfc79f1acdd8043d2baa16df16ec9f">&#9670;&nbsp;</a></span>is_subset</h2>
  417. <div class="memitem">
  418. <div class="memproto">
  419. <table class="memname">
  420. <tr>
  421. <td class="memname">constexpr auto boost::hana::is_subset</td>
  422. </tr>
  423. </table>
  424. </div><div class="memdoc">
  425. <p><code>#include &lt;<a class="el" href="fwd_2is__subset_8hpp.html">boost/hana/fwd/is_subset.hpp</a>&gt;</code></p>
  426. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; ys) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  427. <p>Returns whether a structure contains a subset of the keys of another structure.Given two <code>Searchable</code>s <code>xs</code> and <code>ys</code>, <code>is_subset</code> returns a <code>Logical</code> representing whether <code>xs</code> is a subset of <code>ys</code>. In other words, it returns whether all the keys of <code>xs</code> are also present in <code>ys</code>. This method does not return whether <code>xs</code> is a <em>strict</em> subset of <code>ys</code>; if <code>xs</code> and <code>ys</code> are equal, all the keys of <code>xs</code> are also present in <code>ys</code>, and <code>is_subset</code> returns true. </p>
  428. <dl class="section note"><dt>Note</dt><dd>For convenience, <code>is_subset</code> can also be applied in infix notation.</dd></dl>
  429. <h2>Cross-type version of the method </h2>
  430. <p>This method is tag-dispatched using the tags of both arguments. It can be called with any two <code>Searchable</code>s sharing a common <code>Searchable</code> embedding, as defined in the main documentation of the <code>Searchable</code> concept. When <code>Searchable</code>s with two different tags but sharing a common embedding are sent to <code>is_subset</code>, they are first converted to this common <code>Searchable</code> and the <code>is_subset</code> method of the common embedding is then used. Of course, the method can be overriden for custom <code>Searchable</code>s for efficieny.</p>
  431. <dl class="section note"><dt>Note</dt><dd>While cross-type dispatching for <code>is_subset</code> is supported, it is not currently used by the library because there are no models of <code>Searchable</code> with a common embedding.</dd></dl>
  432. <dl class="params"><dt>Parameters</dt><dd>
  433. <table class="params">
  434. <tr><td class="paramname">xs</td><td>The structure to check whether it is a subset of <code>ys</code>.</td></tr>
  435. <tr><td class="paramname">ys</td><td>The structure to check whether it is a superset of <code>xs</code>.</td></tr>
  436. </table>
  437. </dd>
  438. </dl>
  439. <h2>Example </h2>
  440. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="is__subset_8hpp.html">boost/hana/is_subset.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">static_assert(</div><div class="line"> <a class="code" href="group__group-Searchable.html#gadccfc79f1acdd8043d2baa16df16ec9f">hana::is_subset</a>(hana::make_tuple(1, <span class="charliteral">&#39;2&#39;</span>, 3.3), hana::make_tuple(3.3, 1, <span class="charliteral">&#39;2&#39;</span>, <span class="keyword">nullptr</span>))</div><div class="line">, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="comment">// is_subset can be applied in infix notation</span></div><div class="line">static_assert(</div><div class="line"> hana::make_tuple(1, <span class="charliteral">&#39;2&#39;</span>, 3.3) ^<a class="code" href="group__group-Searchable.html#gadccfc79f1acdd8043d2baa16df16ec9f">hana::is_subset</a>^ hana::make_tuple(3.3, 1, <span class="charliteral">&#39;2&#39;</span>, <span class="keyword">nullptr</span>)</div><div class="line">, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  441. </div>
  442. </div>
  443. <a id="ga614ff1e575806f59246b17006e19d479"></a>
  444. <h2 class="memtitle"><span class="permalink"><a href="#ga614ff1e575806f59246b17006e19d479">&#9670;&nbsp;</a></span>none</h2>
  445. <div class="memitem">
  446. <div class="memproto">
  447. <table class="memname">
  448. <tr>
  449. <td class="memname">constexpr auto boost::hana::none</td>
  450. </tr>
  451. </table>
  452. </div><div class="memdoc">
  453. <p><code>#include &lt;<a class="el" href="fwd_2none_8hpp.html">boost/hana/fwd/none.hpp</a>&gt;</code></p>
  454. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs) -&gt; decltype(<span class="keyword">auto</span>) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  455. <p>Returns whether all of the keys of the structure are false-valued.The keys of the structure must be <code>Logical</code>s. If the structure is not finite, a true-valued key must appear at a finite "index" in order for this method to finish. </p>
  456. <h2>Example </h2>
  457. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="bool_8hpp.html">boost/hana/bool.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="none_8hpp.html">boost/hana/none.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">hana::none</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, hana::false_c)), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line">static_assert(!<a class="code" href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">hana::none</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, <span class="keyword">true</span>)), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga614ff1e575806f59246b17006e19d479">hana::none</a>(hana::make_tuple(<span class="keyword">false</span>, hana::false_c, hana::true_c)));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  458. </div>
  459. </div>
  460. <a id="ga43954c791b5b1351fb009e2a643d00f5"></a>
  461. <h2 class="memtitle"><span class="permalink"><a href="#ga43954c791b5b1351fb009e2a643d00f5">&#9670;&nbsp;</a></span>none_of</h2>
  462. <div class="memitem">
  463. <div class="memproto">
  464. <table class="memname">
  465. <tr>
  466. <td class="memname">constexpr auto boost::hana::none_of</td>
  467. </tr>
  468. </table>
  469. </div><div class="memdoc">
  470. <p><code>#include &lt;<a class="el" href="fwd_2none__of_8hpp.html">boost/hana/fwd/none_of.hpp</a>&gt;</code></p>
  471. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; predicate) {</div><div class="line"> <span class="keywordflow">return</span> tag-dispatched;</div><div class="line"> }</div></div><!-- fragment -->
  472. <p>Returns whether none of the keys of the structure satisfy the <code>predicate</code>.If the structure is not finite, <code>predicate</code> has to return a true- valued <code>Logical</code> after looking at a finite number of keys for this method to finish. </p>
  473. <dl class="params"><dt>Parameters</dt><dd>
  474. <table class="params">
  475. <tr><td class="paramname">xs</td><td>The structure to search.</td></tr>
  476. <tr><td class="paramname">predicate</td><td>A function called as <code>predicate(k)</code>, where <code>k</code> is a key of the structure, and returning a <code>Logical</code>.</td></tr>
  477. </table>
  478. </dd>
  479. </dl>
  480. <h2>Example </h2>
  481. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="config_8hpp.html">boost/hana/config.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="mod_8hpp.html">boost/hana/mod.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="none__of_8hpp.html">boost/hana/none_of.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">BOOST_HANA_CONSTEXPR_LAMBDA <span class="keyword">auto</span> is_odd = [](<span class="keyword">auto</span> x) {</div><div class="line"> <span class="keywordflow">return</span> x % 2_c != 0_c;</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">hana::none_of</a>(hana::make_tuple(2_c, 4_c), is_odd));</div><div class="line"> <a class="code" href="group__group-assertions.html#gac7aafc41e4dcc7d1f1929fb00f010d2a">BOOST_HANA_CONSTEXPR_CHECK</a>(!<a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">hana::none_of</a>(hana::make_tuple(1, 2), is_odd));</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> !<a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">hana::none_of</a>(hana::make_tuple(hana::type_c&lt;void&gt;, hana::type_c&lt;char&amp;&gt;), hana::trait&lt;std::is_void&gt;)</div><div class="line"> );</div><div class="line"> <a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga43954c791b5b1351fb009e2a643d00f5">hana::none_of</a>(hana::make_tuple(hana::type_c&lt;void&gt;, hana::type_c&lt;char&amp;&gt;), hana::trait&lt;std::is_integral&gt;)</div><div class="line"> );</div><div class="line">}</div></div><!-- fragment -->
  482. </div>
  483. </div>
  484. </div><!-- contents -->
  485. </div><!-- doc-content -->
  486. <!--
  487. Copyright Louis Dionne 2013-2017
  488. Distributed under the Boost Software License, Version 1.0.
  489. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  490. -->
  491. <!-- boost-no-inspect -->
  492. <!-- HTML footer for doxygen 1.8.9.1-->
  493. <!-- start footer part -->
  494. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  495. <ul>
  496. </ul>
  497. </div>
  498. </body>
  499. </html>