123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304 |
- <!--
- Copyright Louis Dionne 2013-2017
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- -->
- <!-- boost-no-inspect -->
- <!-- HTML header for doxygen 1.8.9.1-->
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
- <meta http-equiv="X-UA-Compatible" content="IE=9"/>
- <meta name="generator" content="Doxygen 1.8.15"/>
- <title>Boost.Hana: boost::hana::range< T, from, to > Struct Template Reference</title>
- <link href="tabs.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="jquery.js"></script>
- <script type="text/javascript" src="dynsections.js"></script>
- <link href="navtree.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="resize.js"></script>
- <script type="text/javascript" src="navtreedata.js"></script>
- <script type="text/javascript" src="navtree.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(initResizable);
- /* @license-end */</script>
- <link href="search/search.css" rel="stylesheet" type="text/css"/>
- <script type="text/javascript" src="search/searchdata.js"></script>
- <script type="text/javascript" src="search/search.js"></script>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function() { init_search(); });
- /* @license-end */
- </script>
- <script type="text/x-mathjax-config">
- MathJax.Hub.Config({
- extensions: ["tex2jax.js"],
- jax: ["input/TeX","output/HTML-CSS"],
- });
- // Copyright Louis Dionne 2013-2017
- // Distributed under the Boost Software License, Version 1.0.
- // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- MathJax.Hub.Config({
- "HTML-CSS": {
- linebreaks: {
- automatic: true,
- width: "75% container"
- }
- }
- });
- </script><script type="text/javascript" async="async" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
- <link href="doxygen.css" rel="stylesheet" type="text/css" />
- <!-- Additional javascript for drawing charts. -->
- <script type="text/javascript" src="highcharts.js"></script>
- <script type="text/javascript" src="highcharts-data.js"></script>
- <script type="text/javascript" src="highcharts-exporting.js"></script>
- <script type="text/javascript" src="chart.js"></script>
- <script type="text/javascript" src="hana.js"></script>
- </head>
- <body>
- <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
- <div id="titlearea">
- <table cellspacing="0" cellpadding="0">
- <tbody>
- <tr style="height: 56px;">
- <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
- <td style="padding-left: 0.5em;">
- <div id="projectname">Boost.Hana
-  <span id="projectnumber">1.6.0</span>
- </div>
- <div id="projectbrief">Your standard library for metaprogramming</div>
- </td>
- <td> <div id="MSearchBox" class="MSearchBoxInactive">
- <span class="left">
- <img id="MSearchSelect" src="search/mag_sel.png"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- alt=""/>
- <input type="text" id="MSearchField" value="Search" accesskey="S"
- onfocus="searchBox.OnSearchFieldFocus(true)"
- onblur="searchBox.OnSearchFieldFocus(false)"
- onkeyup="searchBox.OnSearchFieldChange(event)"/>
- </span><span class="right">
- <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
- </span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.15 -->
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- /* @license-end */
- </script>
- </div><!-- top -->
- <div id="side-nav" class="ui-resizable side-nav-resizable">
- <div id="nav-tree">
- <div id="nav-tree-contents">
- <div id="nav-sync" class="sync"></div>
- </div>
- </div>
- <div id="splitbar" style="-moz-user-select:none;"
- class="ui-resizable-handle">
- </div>
- </div>
- <script type="text/javascript">
- /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */
- $(document).ready(function(){initNavTree('structboost_1_1hana_1_1range.html','');});
- /* @license-end */
- </script>
- <div id="doc-content">
- <!-- window showing the filter options -->
- <div id="MSearchSelectWindow"
- onmouseover="return searchBox.OnSearchSelectShow()"
- onmouseout="return searchBox.OnSearchSelectHide()"
- onkeydown="return searchBox.OnSearchSelectKey(event)">
- </div>
- <!-- iframe showing the search results (closed by default) -->
- <div id="MSearchResultsWindow">
- <iframe src="javascript:void(0)" frameborder="0"
- name="MSearchResults" id="MSearchResults">
- </iframe>
- </div>
- <div class="header">
- <div class="summary">
- <a href="#related">Synopsis of associated functions</a> |
- <a href="#friends">Friends</a> |
- <a href="#pub-methods">Public Member Functions</a> |
- <a href="structboost_1_1hana_1_1range-members.html">List of all members</a> </div>
- <div class="headertitle">
- <div class="title">boost::hana::range< T, from, to > Struct Template Reference<div class="ingroups"><a class="el" href="group__group-datatypes.html">Data types</a></div></div> </div>
- </div><!--header-->
- <div class="contents">
- <a name="details" id="details"></a><h2 class="groupheader">Description</h2>
- <div class="textblock"><h3>template<typename T, T from, T to><br />
- struct boost::hana::range< T, from, to ></h3>
- <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>
- <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>
- <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 <= to</code>.</p>
- <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>
- <h2>Modeled concepts </h2>
- <ol type="1">
- <li><code>Comparable</code><br />
- 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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="not__equal_8hpp.html">boost/hana/not_equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></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<6>, hana::int_c<6>) == hana::make_range(hana::int_c<0>, hana::int_c<0>));</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<2>, hana::int_c<5>) == hana::make_range(hana::int_c<2>, hana::int_c<5>));</div><div class="line"><a class="code" href="group__group-assertions.html#ga2c5006540936d9f8880e3a39f4fcc035">BOOST_HANA_CONSTANT_CHECK</a>(hana::make_range(hana::int_c<0>, hana::int_c<3>) != hana::make_range(hana::int_c<-1>, hana::int_c<3>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
- <li><code>Foldable</code><br />
- 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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="fold__left_8hpp.html">boost/hana/fold_left.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="plus_8hpp.html">boost/hana/plus.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="unpack_8hpp.html">boost/hana/unpack.hpp</a>></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<0>, hana::int_c<4>), hana::int_c<0>, <a class="code" href="group__group-Monoid.html#gaeb5d4a1e967e319712f9e4791948896c">hana::plus</a>) == hana::int_c<6></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<-2>, hana::int_c<2>), hana::make_tuple) ==</div><div class="line"> hana::make_tuple(hana::int_c<-2>, hana::int_c<-1>, hana::int_c<0>, hana::int_c<1>)</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
- <li><code>Iterable</code><br />
- 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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="back_8hpp.html">boost/hana/back.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="drop__front_8hpp.html">boost/hana/drop_front.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="front_8hpp.html">boost/hana/front.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="is__empty_8hpp.html">boost/hana/is_empty.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="not_8hpp.html">boost/hana/not.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></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<0>, hana::int_c<1000>);</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<0>);</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<999>);</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<1>, hana::int_c<1000>));</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<3>, hana::int_c<3>)));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
- <li><code>Searchable</code><br />
- 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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></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<1>, hana::int_c<25>), hana::int_c<10>) == hana::just(hana::int_c<10>));</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<1>, hana::int_c<25>), hana::int_c<200>) == hana::nothing);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> </li>
- </ol>
- </div><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
- Synopsis of associated functions</h2></td></tr>
- <tr class="memitem:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memTemplParams" colspan="2">template<> </td></tr>
- <tr class="memitem:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#ad5ad9a1f847daa24ef62f5d81b8eef8e">make< range_tag ></a></td></tr>
- <tr class="memdesc:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="mdescLeft"> </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>
- <tr class="separator:ad5ad9a1f847daa24ef62f5d81b8eef8e"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:aba8dd69deb1d810ef65ec289127bf0ab"><td class="memItemLeft" align="right" valign="top">constexpr auto </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><<a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a>></td></tr>
- <tr class="memdesc:aba8dd69deb1d810ef65ec289127bf0ab"><td class="mdescLeft"> </td><td class="mdescRight">Alias to <code>make<<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>></code>; provided for convenience. <a href="#aba8dd69deb1d810ef65ec289127bf0ab">More...</a><br /></td></tr>
- <tr class="separator:aba8dd69deb1d810ef65ec289127bf0ab"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a899b7a0c065ff64cd747fe1671753d3f"><td class="memTemplParams" colspan="2">template<typename T , T from, T to> </td></tr>
- <tr class="memitem:a899b7a0c065ff64cd747fe1671753d3f"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </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<T, from>, integral_c<T, <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>>)</td></tr>
- <tr class="memdesc:a899b7a0c065ff64cd747fe1671753d3f"><td class="mdescLeft"> </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>
- <tr class="separator:a899b7a0c065ff64cd747fe1671753d3f"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
- Friends</h2></td></tr>
- <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplParams" colspan="2"><a id="a27607958295e6da8a0ba602a2db468f1"></a>
- template<typename X , typename Y > </td></tr>
- <tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a27607958295e6da8a0ba602a2db468f1">operator==</a> (X &&x, Y &&y)</td></tr>
- <tr class="memdesc:a27607958295e6da8a0ba602a2db468f1"><td class="mdescLeft"> </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>
- <tr class="separator:a27607958295e6da8a0ba602a2db468f1"><td class="memSeparator" colspan="2"> </td></tr>
- <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplParams" colspan="2"><a id="a0cae3af55edb3eb05bfa184bda633f7d"></a>
- template<typename X , typename Y > </td></tr>
- <tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a0cae3af55edb3eb05bfa184bda633f7d">operator!=</a> (X &&x, Y &&y)</td></tr>
- <tr class="memdesc:a0cae3af55edb3eb05bfa184bda633f7d"><td class="mdescLeft"> </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>
- <tr class="separator:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memSeparator" colspan="2"> </td></tr>
- </table><table class="memberdecls">
- <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
- Public Member Functions</h2></td></tr>
- <tr class="memitem:a5df034200fc77683173f7cecf99f491e"><td class="memTemplParams" colspan="2"><a id="a5df034200fc77683173f7cecf99f491e"></a>
- template<typename N > </td></tr>
- <tr class="memitem:a5df034200fc77683173f7cecf99f491e"><td class="memTemplItemLeft" align="right" valign="top">decltype(auto) constexpr </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1range.html#a5df034200fc77683173f7cecf99f491e">operator[]</a> (N &&n)</td></tr>
- <tr class="memdesc:a5df034200fc77683173f7cecf99f491e"><td class="mdescLeft"> </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>
- <tr class="separator:a5df034200fc77683173f7cecf99f491e"><td class="memSeparator" colspan="2"> </td></tr>
- </table>
- <h2 class="groupheader">Associated functions</h2>
- <a id="ad5ad9a1f847daa24ef62f5d81b8eef8e"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#ad5ad9a1f847daa24ef62f5d81b8eef8e">◆ </a></span>make< range_tag ></h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename T , T from, T to> </div>
- <div class="memtemplate">
- template<> </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>< <a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a> ></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">related</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span> <span class="keyword">const</span>& from, <span class="keyword">auto</span> <span class="keyword">const</span>& <a class="code" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>) {</div><div class="line"> <span class="keywordflow">return</span> range<implementation_defined>{implementation_defined};</div><div class="line"> }</div></div><!-- fragment -->
- <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>
- <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<<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>></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 <= 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>
- <h2>Example </h2>
- <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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="core_2make_8hpp.html">boost/hana/core/make.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></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<hana::range_tag>(hana::int_c<0>, hana::int_c<10>); <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<hana::range_tag>(hana::int_c<0>, hana::int_c<10>));</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> lrange = hana::make<hana::range_tag>(hana::int_c<0>, hana::long_c<10>); <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<hana::range_tag>(hana::long_c<0>, hana::long_c<10>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
- </div>
- </div>
- <a id="aba8dd69deb1d810ef65ec289127bf0ab"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#aba8dd69deb1d810ef65ec289127bf0ab">◆ </a></span>make_range</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename T , T from, T to> </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto make_range = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a><<a class="el" href="structboost_1_1hana_1_1range__tag.html">range_tag</a>></td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">related</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <p>Alias to <code>make<<a class="el" href="structboost_1_1hana_1_1range__tag.html" title="Tag representing a hana::range.">range_tag</a>></code>; provided for convenience. </p>
- </div>
- </div>
- <a id="a899b7a0c065ff64cd747fe1671753d3f"></a>
- <h2 class="memtitle"><span class="permalink"><a href="#a899b7a0c065ff64cd747fe1671753d3f">◆ </a></span>range_c</h2>
- <div class="memitem">
- <div class="memproto">
- <div class="memtemplate">
- template<typename T , T from, T to> </div>
- <div class="memtemplate">
- template<typename T , T from, T to> </div>
- <table class="mlabels">
- <tr>
- <td class="mlabels-left">
- <table class="memname">
- <tr>
- <td class="memname">constexpr auto range_c = <a class="el" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a>(integral_c<T, from>, integral_c<T, <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>>)</td>
- </tr>
- </table>
- </td>
- <td class="mlabels-right">
- <span class="mlabels"><span class="mlabel">related</span></span> </td>
- </tr>
- </table>
- </div><div class="memdoc">
- <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>
- <p>This shorthand is provided for convenience only and it is equivalent to <code>make_range</code>. Specifically, <code>range_c<T, from, to></code> is such that </p><div class="fragment"><div class="line">range_c<T, from, to> == <a class="code" href="structboost_1_1hana_1_1range.html#aba8dd69deb1d810ef65ec289127bf0ab">make_range</a>(integral_c<T, from>, integral_c<T, to>)</div></div><!-- fragment --><dl class="tparams"><dt>Template Parameters</dt><dd>
- <table class="tparams">
- <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>
- <tr><td class="paramname">from</td><td>The inclusive lower bound of the created range.</td></tr>
- <tr><td class="paramname">to</td><td>The exclusive upper bound of the created range.</td></tr>
- </table>
- </dd>
- </dl>
- <h2>Example </h2>
- <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 <<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="back_8hpp.html">boost/hana/back.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="drop__front_8hpp.html">boost/hana/drop_front.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="front_8hpp.html">boost/hana/front.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="range_8hpp.html">boost/hana/range.hpp</a>></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<int, 0, 5>) == hana::int_c<0>);</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<unsigned long, 0, 5>) == hana::ulong_c<4>);</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<int, 0, 5>) == hana::make_range(hana::int_c<1>, hana::int_c<5>));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment -->
- </div>
- </div>
- </div><!-- contents -->
- </div><!-- doc-content -->
- <!--
- Copyright Louis Dionne 2013-2017
- Distributed under the Boost Software License, Version 1.0.
- (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
- -->
- <!-- boost-no-inspect -->
- <!-- HTML footer for doxygen 1.8.9.1-->
- <!-- start footer part -->
- <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
- <ul>
- <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>
- </ul>
- </div>
- </body>
- </html>
|