structboost_1_1hana_1_1range.html 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304
  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: boost::hana::range&lt; T, from, to &gt; Struct Template Reference</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('structboost_1_1hana_1_1range.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="#related">Synopsis of associated functions</a> &#124;
  130. <a href="#friends">Friends</a> &#124;
  131. <a href="#pub-methods">Public Member Functions</a> &#124;
  132. <a href="structboost_1_1hana_1_1range-members.html">List of all members</a> </div>
  133. <div class="headertitle">
  134. <div class="title">boost::hana::range&lt; T, from, to &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__group-datatypes.html">Data types</a></div></div> </div>
  135. </div><!--header-->
  136. <div class="contents">
  137. <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
  138. <div class="textblock"><h3>template&lt;typename T, T from, T to&gt;<br />
  139. struct boost::hana::range&lt; T, from, to &gt;</h3>
  140. <p>Compile-time half-open interval of <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">hana::integral_constant</a></code>s. </p>
  141. <p>A <code>range</code> represents a half-open interval of the form <code>[from, to)</code> containing <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">hana::integral_constant</a></code>s of a given type. The <code>[from, to)</code> notation represents the values starting at <code>from</code> (inclusively) up to but excluding <code>from</code>. In other words, it is a bit like the list <code>from, from+1, ..., to-1</code>.</p>
  142. <p>In particular, note that the bounds of the range can be any <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">hana::integral_constant</a></code>s (negative numbers are allowed) and the range does not have to start at zero. The only requirement is that <code>from &lt;= to</code>.</p>
  143. <dl class="section note"><dt>Note</dt><dd>The representation of <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> is implementation defined. In particular, one should not take for granted the number and types of template parameters. The proper way to create a <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> is to use <code>hana::range_c</code> or <code>hana::make_range</code>. More details <a class="el" href="index.html#tutorial-containers-types">in the tutorial</a>.</dd></dl>
  144. <h2>Modeled concepts </h2>
  145. <ol type="1">
  146. <li><code>Comparable</code><br />
  147. Two ranges are equal if and only if they are both empty or they both span the same interval. <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="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="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="range_8hpp.html">boost/hana/range.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"><span class="comment">// empty ranges are equal</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::make_range(hana::int_c&lt;6&gt;, hana::int_c&lt;6&gt;) == hana::make_range(hana::int_c&lt;0&gt;, hana::int_c&lt;0&gt;));</div><div class="line"></div><div class="line"><span class="comment">// otherwise, ranges are equal if and only if they span the same interval</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::make_range(hana::int_c&lt;2&gt;, hana::int_c&lt;5&gt;) == hana::make_range(hana::int_c&lt;2&gt;, hana::int_c&lt;5&gt;));</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::make_range(hana::int_c&lt;0&gt;, hana::int_c&lt;3&gt;) != hana::make_range(hana::int_c&lt;-1&gt;, hana::int_c&lt;3&gt;));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
  148. <li><code>Foldable</code><br />
  149. Folding a <code>range</code> is equivalent to folding a list of the <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s in the interval it spans. <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="fold__left_8hpp.html">boost/hana/fold_left.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="plus_8hpp.html">boost/hana/plus.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="range_8hpp.html">boost/hana/range.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="unpack_8hpp.html">boost/hana/unpack.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-Foldable.html#ga38c6b3f6b1cbadb9b8432a05ff16b7d2">hana::fold_left</a>(hana::make_range(hana::int_c&lt;0&gt;, hana::int_c&lt;4&gt;), hana::int_c&lt;0&gt;, <a class="code" href="group__group-Monoid.html#gaeb5d4a1e967e319712f9e4791948896c">hana::plus</a>) == hana::int_c&lt;6&gt;</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-Foldable.html#ga7b0c23944364ce61136e10b978ae2170">hana::unpack</a>(hana::make_range(hana::int_c&lt;-2&gt;, hana::int_c&lt;2&gt;), hana::make_tuple) ==</div><div class="line"> hana::make_tuple(hana::int_c&lt;-2&gt;, hana::int_c&lt;-1&gt;, hana::int_c&lt;0&gt;, hana::int_c&lt;1&gt;)</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
  150. <li><code>Iterable</code><br />
  151. Iterating over a <code>range</code> is equivalent to iterating over a list of the values it spans. In other words, iterating over the range <code>[from, to)</code> is equivalent to iterating over a list containing <code>from, from+1, from+2, ..., to-1</code>. Also note that <code>operator[]</code> can be used in place of the <code>at</code> function. <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="back_8hpp.html">boost/hana/back.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="drop__front_8hpp.html">boost/hana/drop_front.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="front_8hpp.html">boost/hana/front.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="is__empty_8hpp.html">boost/hana/is_empty.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="range_8hpp.html">boost/hana/range.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">constexpr <span class="keyword">auto</span> r = hana::make_range(hana::int_c&lt;0&gt;, hana::int_c&lt;1000&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-Iterable.html#ga8a67ea10e8082dbe6705e573fa978444">hana::front</a>(r) == hana::int_c&lt;0&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-Iterable.html#gab3f4d0035345a453284e46303862d463">hana::back</a>(r) == hana::int_c&lt;999&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-Iterable.html#gad23ce0a4906e2bb0a52f38837b134757">hana::drop_front</a>(r) == hana::make_range(hana::int_c&lt;1&gt;, hana::int_c&lt;1000&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-Iterable.html#ga2a05f564f8a7e4afa04fcbc07ad8f394">hana::is_empty</a>(r));</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Iterable.html#ga2a05f564f8a7e4afa04fcbc07ad8f394">hana::is_empty</a>(hana::make_range(hana::int_c&lt;3&gt;, hana::int_c&lt;3&gt;)));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
  152. <li><code>Searchable</code><br />
  153. Searching a <code>range</code> is equivalent to searching a list of the values in the range <code>[from, to)</code>, but it is much more compile-time efficient. <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="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="range_8hpp.html">boost/hana/range.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#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(hana::make_range(hana::int_c&lt;1&gt;, hana::int_c&lt;25&gt;), hana::int_c&lt;10&gt;) == hana::just(hana::int_c&lt;10&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#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(hana::make_range(hana::int_c&lt;1&gt;, hana::int_c&lt;25&gt;), hana::int_c&lt;200&gt;) == hana::nothing);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> </li>
  154. </ol>
  155. </div><table class="memberdecls">
  156. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
  157. Synopsis of associated functions</h2></td></tr>
  158. <tr class="memitem:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memTemplParams" colspan="2">template&lt;&gt; </td></tr>
  159. <tr class="memitem:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#ad5ad9a1f847daa24ef62f5d81b8eef8e">make&lt; range_tag &gt;</a></td></tr>
  160. <tr class="memdesc:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create a <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> representing a half-open interval of <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s. <a href="#ad5ad9a1f847daa24ef62f5d81b8eef8e">More...</a><br /></td></tr>
  161. <tr class="separator:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  162. <tr class="memitem:aba8dd69deb1d810ef65ec289127bf0ab"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a> = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a>&gt;</td></tr>
  163. <tr class="memdesc:aba8dd69deb1d810ef65ec289127bf0ab"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>&gt;</code>; provided for convenience. <a href="#aba8dd69deb1d810ef65ec289127bf0ab">More...</a><br /></td></tr>
  164. <tr class="separator:aba8dd69deb1d810ef65ec289127bf0ab"><td class="memSeparator" colspan="2">&#160;</td></tr>
  165. <tr class="memitem:a899b7a0c065ff64cd747fe1671753d3f"><td class="memTemplParams" colspan="2">template&lt;typename T , T from, T to&gt; </td></tr>
  166. <tr class="memitem:a899b7a0c065ff64cd747fe1671753d3f"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a899b7a0c065ff64cd747fe1671753d3f">range_c</a> = <a class="el" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a>(integral_c&lt;T, from&gt;, integral_c&lt;T, <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&gt;)</td></tr>
  167. <tr class="memdesc:a899b7a0c065ff64cd747fe1671753d3f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Shorthand to create a <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> with the given bounds. <a href="#a899b7a0c065ff64cd747fe1671753d3f">More...</a><br /></td></tr>
  168. <tr class="separator:a899b7a0c065ff64cd747fe1671753d3f"><td class="memSeparator" colspan="2">&#160;</td></tr>
  169. </table><table class="memberdecls">
  170. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
  171. Friends</h2></td></tr>
  172. <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplParams" colspan="2"><a id="a27607958295e6da8a0ba602a2db468f1"></a>
  173. template&lt;typename X , typename Y &gt; </td></tr>
  174. <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a27607958295e6da8a0ba602a2db468f1">operator==</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  175. <tr class="memdesc:a27607958295e6da8a0ba602a2db468f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547" title="Returns a Logical representing whether x is equal to y.The equal function can be called in two differ...">hana::equal</a></code> <br /></td></tr>
  176. <tr class="separator:a27607958295e6da8a0ba602a2db468f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
  177. <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplParams" colspan="2"><a id="a0cae3af55edb3eb05bfa184bda633f7d"></a>
  178. template&lt;typename X , typename Y &gt; </td></tr>
  179. <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a0cae3af55edb3eb05bfa184bda633f7d">operator!=</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
  180. <tr class="memdesc:a0cae3af55edb3eb05bfa184bda633f7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd" title="Returns a Logical representing whether x is not equal to y.The not_equal function can be called in tw...">hana::not_equal</a></code> <br /></td></tr>
  181. <tr class="separator:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
  182. </table><table class="memberdecls">
  183. <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
  184. Public Member Functions</h2></td></tr>
  185. <tr class="memitem:a5df034200fc77683173f7cecf99f491e"><td class="memTemplParams" colspan="2"><a id="a5df034200fc77683173f7cecf99f491e"></a>
  186. template&lt;typename N &gt; </td></tr>
  187. <tr class="memitem:a5df034200fc77683173f7cecf99f491e"><td class="memTemplItemLeft" align="right" valign="top">decltype(auto) constexpr&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a5df034200fc77683173f7cecf99f491e">operator[]</a> (N &amp;&amp;n)</td></tr>
  188. <tr class="memdesc:a5df034200fc77683173f7cecf99f491e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Iterable.html#ga8a484304380eae38f3d9663d98860129" title="Returns the nth element of an iterable.Given an Iterable and an IntegralConstant index,...">hana::at</a></code> <br /></td></tr>
  189. <tr class="separator:a5df034200fc77683173f7cecf99f491e"><td class="memSeparator" colspan="2">&#160;</td></tr>
  190. </table>
  191. <h2 class="groupheader">Associated functions</h2>
  192. <a id="ad5ad9a1f847daa24ef62f5d81b8eef8e"></a>
  193. <h2 class="memtitle"><span class="permalink"><a href="#ad5ad9a1f847daa24ef62f5d81b8eef8e">&#9670;&nbsp;</a></span>make&lt; range_tag &gt;</h2>
  194. <div class="memitem">
  195. <div class="memproto">
  196. <div class="memtemplate">
  197. template&lt;typename T , T from, T to&gt; </div>
  198. <div class="memtemplate">
  199. template&lt;&gt; </div>
  200. <table class="mlabels">
  201. <tr>
  202. <td class="mlabels-left">
  203. <table class="memname">
  204. <tr>
  205. <td class="memname">constexpr auto <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt; <a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a> &gt;</td>
  206. </tr>
  207. </table>
  208. </td>
  209. <td class="mlabels-right">
  210. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  211. </tr>
  212. </table>
  213. </div><div class="memdoc">
  214. <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span> <span class="keyword">const</span>&amp; from, <span class="keyword">auto</span> <span class="keyword">const</span>&amp; <a class="code" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>) {</div><div class="line"> <span class="keywordflow">return</span> range&lt;implementation_defined&gt;{implementation_defined};</div><div class="line"> }</div></div><!-- fragment -->
  215. <p>Create a <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> representing a half-open interval of <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s. </p>
  216. <p>Given two <code><a class="el" href="structboost_1_1hana_1_1IntegralConstant.html" title="The IntegralConstant concept represents compile-time integral values.">IntegralConstant</a></code>s <code>from</code> and <code>to</code>, <code>make&lt;<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>&gt;</code> returns a <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> representing the half-open interval of <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s <code>[from, to)</code>. <code>from</code> and <code>to</code> must form a valid interval, which means that <code>from &lt;= to</code> must be true. Otherwise, a compilation error is triggered. Also note that if <code>from</code> and <code>to</code> are <code><a class="el" href="structboost_1_1hana_1_1IntegralConstant.html" title="The IntegralConstant concept represents compile-time integral values.">IntegralConstant</a></code>s with different underlying integral types, the created range contains <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s whose underlying type is their common type.</p>
  217. <h2>Example </h2>
  218. <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="core_2make_8hpp.html">boost/hana/core/make.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="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="range_8hpp.html">boost/hana/range.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">constexpr <span class="keyword">auto</span> irange = hana::make&lt;hana::range_tag&gt;(hana::int_c&lt;0&gt;, hana::int_c&lt;10&gt;); <span class="comment">// [0, 10) int</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(irange == hana::make&lt;hana::range_tag&gt;(hana::int_c&lt;0&gt;, hana::int_c&lt;10&gt;));</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> lrange = hana::make&lt;hana::range_tag&gt;(hana::int_c&lt;0&gt;, hana::long_c&lt;10&gt;); <span class="comment">// [0, 10) long</span></div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(lrange == hana::make&lt;hana::range_tag&gt;(hana::long_c&lt;0&gt;, hana::long_c&lt;10&gt;));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  219. </div>
  220. </div>
  221. <a id="aba8dd69deb1d810ef65ec289127bf0ab"></a>
  222. <h2 class="memtitle"><span class="permalink"><a href="#aba8dd69deb1d810ef65ec289127bf0ab">&#9670;&nbsp;</a></span>make_range</h2>
  223. <div class="memitem">
  224. <div class="memproto">
  225. <div class="memtemplate">
  226. template&lt;typename T , T from, T to&gt; </div>
  227. <table class="mlabels">
  228. <tr>
  229. <td class="mlabels-left">
  230. <table class="memname">
  231. <tr>
  232. <td class="memname">constexpr auto make_range = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a>&gt;</td>
  233. </tr>
  234. </table>
  235. </td>
  236. <td class="mlabels-right">
  237. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  238. </tr>
  239. </table>
  240. </div><div class="memdoc">
  241. <p>Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>&gt;</code>; provided for convenience. </p>
  242. </div>
  243. </div>
  244. <a id="a899b7a0c065ff64cd747fe1671753d3f"></a>
  245. <h2 class="memtitle"><span class="permalink"><a href="#a899b7a0c065ff64cd747fe1671753d3f">&#9670;&nbsp;</a></span>range_c</h2>
  246. <div class="memitem">
  247. <div class="memproto">
  248. <div class="memtemplate">
  249. template&lt;typename T , T from, T to&gt; </div>
  250. <div class="memtemplate">
  251. template&lt;typename T , T from, T to&gt; </div>
  252. <table class="mlabels">
  253. <tr>
  254. <td class="mlabels-left">
  255. <table class="memname">
  256. <tr>
  257. <td class="memname">constexpr auto range_c = <a class="el" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a>(integral_c&lt;T, from&gt;, integral_c&lt;T, <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&gt;)</td>
  258. </tr>
  259. </table>
  260. </td>
  261. <td class="mlabels-right">
  262. <span class="mlabels"><span class="mlabel">related</span></span> </td>
  263. </tr>
  264. </table>
  265. </div><div class="memdoc">
  266. <p>Shorthand to create a <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> with the given bounds. </p>
  267. <p>This shorthand is provided for convenience only and it is equivalent to <code>make_range</code>. Specifically, <code>range_c&lt;T, from, to&gt;</code> is such that </p><div class="fragment"><div class="line">range_c&lt;T, from, to&gt; == <a class="code" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a>(integral_c&lt;T, from&gt;, integral_c&lt;T, to&gt;)</div></div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
  268. <table class="tparams">
  269. <tr><td class="paramname">T</td><td>The underlying integral type of the <code><a class="el" href="structboost_1_1hana_1_1integral__constant.html" title="Compile-time value of an integral type.">integral_constant</a></code>s in the created range.</td></tr>
  270. <tr><td class="paramname">from</td><td>The inclusive lower bound of the created range.</td></tr>
  271. <tr><td class="paramname">to</td><td>The exclusive upper bound of the created range.</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="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="back_8hpp.html">boost/hana/back.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="drop__front_8hpp.html">boost/hana/drop_front.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="front_8hpp.html">boost/hana/front.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="range_8hpp.html">boost/hana/range.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-Iterable.html#ga8a67ea10e8082dbe6705e573fa978444">hana::front</a>(hana::range_c&lt;int, 0, 5&gt;) == hana::int_c&lt;0&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-Iterable.html#gab3f4d0035345a453284e46303862d463">hana::back</a>(hana::range_c&lt;unsigned long, 0, 5&gt;) == hana::ulong_c&lt;4&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-Iterable.html#gad23ce0a4906e2bb0a52f38837b134757">hana::drop_front</a>(hana::range_c&lt;int, 0, 5&gt;) == hana::make_range(hana::int_c&lt;1&gt;, hana::int_c&lt;5&gt;));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
  277. </div>
  278. </div>
  279. </div><!-- contents -->
  280. </div><!-- doc-content -->
  281. <!--
  282. Copyright Louis Dionne 2013-2017
  283. Distributed under the Boost Software License, Version 1.0.
  284. (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
  285. -->
  286. <!-- boost-no-inspect -->
  287. <!-- HTML footer for doxygen 1.8.9.1-->
  288. <!-- start footer part -->
  289. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  290. <ul>
  291. <li class="navelem"><b>boost</b></li><li class="navelem"><a class="el" href="namespaceboost_1_1hana.html">hana</a></li><li class="navelem"><a class="el" href="structboost_1_1hana_1_1range.html">range</a></li>
  292. </ul>
  293. </div>
  294. </body>
  295. </html>