161 lines
18 KiB
HTML
161 lines
18 KiB
HTML
<!--
|
|
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.11"/>
|
|
<title>Boost.Hana: std::integer_sequence< T, v > 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">
|
|
$(document).ready(initResizable);
|
|
$(window).load(resizeHeight);
|
|
</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">
|
|
$(document).ready(function() { init_search(); });
|
|
</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" 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.3.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.11 -->
|
|
<script type="text/javascript">
|
|
var searchBox = new SearchBox("searchBox", "search",false,'Search');
|
|
</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">
|
|
$(document).ready(function(){initNavTree('structstd_1_1integer__sequence.html','');});
|
|
</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="headertitle">
|
|
<div class="title">std::integer_sequence< T, v > Struct Template Reference<div class="ingroups"><a class="el" href="group__group-ext.html">External adapters</a> » <a class="el" href="group__group-ext-std.html">Standard library adapters</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... v><br />
|
|
struct std::integer_sequence< T, v ></h3>
|
|
|
|
<p>Adaptation of <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">std::integer_sequence</a></code> for Hana. </p>
|
|
<h2>Modeled concepts </h2>
|
|
<ol type="1">
|
|
<li><code>Comparable</code><br />
|
|
Two <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">std::integer_sequence</a></code>s are equal if and only if they have the same number of elements, and if corresponding elements compare equal. The types of the elements held in both <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">integer_sequence</a></code>s may be different, as long as they can be compared. <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="integer__sequence_8hpp.html">boost/hana/ext/std/integer_sequence.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"></div><div class="line"><span class="preprocessor">#include <utility></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 <a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<int, 1, 2, 3, 4></a> xs{};</div><div class="line">constexpr <a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<long, 1, 2, 3, 4></a> ys{};</div><div class="line">constexpr <a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<long, 1, 2, 3, 4, 5></a> zs{};</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(xs, ys));</div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">hana::not_equal</a>(xs, zs));</div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd">hana::not_equal</a>(ys, zs));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
|
|
<li><code>Foldable</code><br />
|
|
Folding an <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">integer_sequence</a></code> is equivalent to folding a sequence of <code><a class="el" href="structstd_1_1integral__constant.html" title="Adapter for std::integral_constants. ">std::integral_constant</a></code>s with the corresponding types. <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="integer__sequence_8hpp.html">boost/hana/ext/std/integer_sequence.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"></div><div class="line"><span class="preprocessor">#include <tuple></span></div><div class="line"><span class="preprocessor">#include <utility></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="keyword">auto</span> add = [](<span class="keyword">auto</span> a, <span class="keyword">auto</span> b, <span class="keyword">auto</span> c) { <span class="keywordflow">return</span> a + b + c; };</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line"> <a class="code" href="structstd_1_1tuple.html">std::tuple<int, long, double></a> tuple{1, 2l, 3.3};</div><div class="line"></div><div class="line"> <span class="keyword">auto</span> <a class="code" href="group__group-Foldable.html#ga650def4b2e98f4273d8b9b7aa5a2fc28">sum</a> = <a class="code" href="group__group-Foldable.html#ga7b0c23944364ce61136e10b978ae2170">hana::unpack</a>(<a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<int, 0, 1, 2></a>{}, [&](<span class="keyword">auto</span> ...i) {</div><div class="line"> <span class="comment">// the `i`s are `std::integral_constant<int, ...>`s</span></div><div class="line"> <span class="keywordflow">return</span> add(std::get<decltype(i)::<a class="code" href="group__group-Constant.html#ga1687520692a6b0c49e3a69de2980f388">value</a>>(tuple)...);</div><div class="line"> });</div><div class="line"></div><div class="line"> <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Foldable.html#ga650def4b2e98f4273d8b9b7aa5a2fc28">sum</a> == 6.3);</div><div class="line">}</div></div><!-- fragment --></li>
|
|
<li><code>Iterable</code><br />
|
|
Iterating over an <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">integer_sequence</a></code> is equivalent to iterating over a sequence of the corresponding <code><a class="el" href="structstd_1_1integral__constant.html" title="Adapter for std::integral_constants. ">std::integral_constant</a></code>s. <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="at_8hpp.html">boost/hana/at.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="integer__sequence_8hpp.html">boost/hana/ext/std/integer_sequence.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.hpp</a>></span></div><div class="line"></div><div class="line"><span class="preprocessor">#include <type_traits></span></div><div class="line"><span class="preprocessor">#include <utility></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 <a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<int, 0, 1, 2, 3, 4></a> indices{};</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(</div><div class="line"> hana::at_c<2>(indices),</div><div class="line"> <a class="code" href="structstd_1_1integral__constant.html">std::integral_constant<int, 2></a>{}</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
|
|
<li><code>Searchable</code><br />
|
|
Searching through an <code><a class="el" href="structstd_1_1integer__sequence.html" title="Adaptation of std::integer_sequence for Hana. ">integer_sequence</a></code> is equivalent to searching through the corresponding sequence of <code><a class="el" href="structstd_1_1integral__constant.html" title="Adapter for std::integral_constants. ">std::integral_constant</a></code>s. <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="integer__sequence_8hpp.html">boost/hana/ext/std/integer_sequence.hpp</a>></span></div><div class="line"><span class="preprocessor">#include <<a class="code" href="ext_2std_2integral__constant_8hpp.html">boost/hana/ext/std/integral_constant.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"></div><div class="line"><span class="preprocessor">#include <type_traits></span></div><div class="line"><span class="preprocessor">#include <utility></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 <a class="code" href="structstd_1_1integer__sequence.html">std::integer_sequence<int, 1, 2, 3, 4></a> xs{};</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547">hana::equal</a>(</div><div class="line"> <a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(xs, hana::int_c<3>),</div><div class="line"> hana::just(<a class="code" href="structstd_1_1integral__constant.html">std::integral_constant<int, 3></a>{})</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> </li>
|
|
</ol>
|
|
</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>std</b></li><li class="navelem"><a class="el" href="structstd_1_1integer__sequence.html">integer_sequence</a></li>
|
|
</ul>
|
|
</div>
|
|
</body>
|
|
</html>
|