1
0
forked from boostorg/mp11
Files
boost_mp11/doc/html/mp11.html
2017-05-10 23:23:56 +03:00

1864 lines
289 KiB
HTML

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
<title>Chapter&#160;1.&#160;Boost.Mp11</title>
<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.78.1">
<link rel="home" href="mp11.html" title="Chapter&#160;1.&#160;Boost.Mp11">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td>
<td align="center"><a href="../../../../index.html">Home</a></td>
<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td>
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
<td align="center"><a href="../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav"></div>
<div class="chapter">
<div class="titlepage"><div>
<div><h2 class="title">
<a name="mp11"></a>Chapter&#160;1.&#160;Boost.Mp11</h2></div>
<div><p class="copyright">Copyright &#169; 2015-2017 Peter Dimov</p></div>
<div><div class="legalnotice">
<a name="mp11.legal"></a><p>
Distributed under the <a href="http://boost.org/LICENSE_1_0.txt" target="_top">Boost
Software License, Version 1.0</a>.
</p>
</div></div>
</div></div>
<div class="toc">
<p><b>Table of Contents</b></p>
<dl class="toc">
<dt><span class="section"><a href="mp11.html#mp11.overview">Overview</a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.definitions">Definitions</a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.examples">Examples</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.examples.generating_test_cases">Generating Test
Cases</a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.examples.computing_return_types">Computing Return
Types</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference">Reference</a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral">Integral Constants, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">integral</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_bool_b"><code class="computeroutput"><span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_true"><code class="computeroutput"><span class="identifier">mp_true</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_false"><code class="computeroutput"><span class="identifier">mp_false</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_to_bool_t"><code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_not_t"><code class="computeroutput"><span class="identifier">mp_not</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_int_i"><code class="computeroutput"><span class="identifier">mp_int</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integral.mp_size_t_n"><code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.list">List Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">list</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_list_t"><code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_size_l"><code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_empty_l"><code class="computeroutput"><span class="identifier">mp_empty</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_front_l"><code class="computeroutput"><span class="identifier">mp_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_pop_front_l"><code class="computeroutput"><span class="identifier">mp_pop_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_first_l"><code class="computeroutput"><span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_rest_l"><code class="computeroutput"><span class="identifier">mp_rest</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_second_l"><code class="computeroutput"><span class="identifier">mp_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_third_l"><code class="computeroutput"><span class="identifier">mp_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_push_front_l_t"><code class="computeroutput"><span class="identifier">mp_push_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_push_back_l_t"><code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_rename_l_y"><code class="computeroutput"><span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span>
<span class="identifier">Y</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_apply_f_l"><code class="computeroutput"><span class="identifier">mp_apply</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span>
<span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_append_l"><code class="computeroutput"><span class="identifier">mp_append</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_replace_front_l_t"><code class="computeroutput"><span class="identifier">mp_replace_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_replace_first_l_t"><code class="computeroutput"><span class="identifier">mp_replace_first</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_replace_second_l_t"><code class="computeroutput"><span class="identifier">mp_replace_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.list.mp_replace_third_l_t"><code class="computeroutput"><span class="identifier">mp_replace_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility">Utility Components, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_identity_t"><code class="computeroutput"><span class="identifier">mp_identity</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_identity_t_t"><code class="computeroutput"><span class="identifier">mp_identity_t</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_inherit_t"><code class="computeroutput"><span class="identifier">mp_inherit</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_if_c_b_t_e"><code class="computeroutput"><span class="identifier">mp_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_if_c_t_e"><code class="computeroutput"><span class="identifier">mp_if</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_eval_if_c_b_t_f_u"><code class="computeroutput"><span class="identifier">mp_eval_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_eval_if_c_t_f_u"><code class="computeroutput"><span class="identifier">mp_eval_if</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_valid_f_t"><code class="computeroutput"><span class="identifier">mp_valid</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_defer_f_t"><code class="computeroutput"><span class="identifier">mp_defer</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_quote_f_t"><code class="computeroutput"><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.utility.mp_invoke_q_t"><code class="computeroutput"><span class="identifier">mp_invoke</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm">Algorithms, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_assign_l1_l2"><code class="computeroutput"><span class="identifier">mp_assign</span><span class="special">&lt;</span><span class="identifier">L1</span><span class="special">,</span> <span class="identifier">L2</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_clear_l"><code class="computeroutput"><span class="identifier">mp_clear</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_transform_f_l"><code class="computeroutput"><span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_transform_q_q_l"><code class="computeroutput"><span class="identifier">mp_transform_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_transform_if_p_f_l"><code class="computeroutput"><span class="identifier">mp_transform_if</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_fill_l_v"><code class="computeroutput"><span class="identifier">mp_fill</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_count_l_v"><code class="computeroutput"><span class="identifier">mp_count</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_count_if_l_p"><code class="computeroutput"><span class="identifier">mp_count_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_contains_l_v"><code class="computeroutput"><span class="identifier">mp_contains</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_repeat_c_l_n"><code class="computeroutput"><span class="identifier">mp_repeat_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_repeat_l_n"><code class="computeroutput"><span class="identifier">mp_repeat</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_product_f_l"><code class="computeroutput"><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_drop_c_l_n"><code class="computeroutput"><span class="identifier">mp_drop_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_drop_l_n"><code class="computeroutput"><span class="identifier">mp_drop</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_iota_c_n"><code class="computeroutput"><span class="identifier">mp_iota_c</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_iota_n"><code class="computeroutput"><span class="identifier">mp_iota</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_at_c_l_i"><code class="computeroutput"><span class="identifier">mp_at_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_at_l_i"><code class="computeroutput"><span class="identifier">mp_at</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span>
<span class="identifier">I</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_take_c_l_n"><code class="computeroutput"><span class="identifier">mp_take_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_take_l_n"><code class="computeroutput"><span class="identifier">mp_take</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_replace_l_v_w"><code class="computeroutput"><span class="identifier">mp_replace</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_replace_if_l_p_w"><code class="computeroutput"><span class="identifier">mp_replace_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_replace_at_c_l_i_w"><code class="computeroutput"><span class="identifier">mp_replace_at_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_replace_at_l_i_w"><code class="computeroutput"><span class="identifier">mp_replace_at</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_copy_if_l_p"><code class="computeroutput"><span class="identifier">mp_copy_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_remove_l_v"><code class="computeroutput"><span class="identifier">mp_remove</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_remove_if_l_p"><code class="computeroutput"><span class="identifier">mp_remove_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_partition_l_p"><code class="computeroutput"><span class="identifier">mp_partition</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_sort_l_p"><code class="computeroutput"><span class="identifier">mp_sort</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_find_l_v"><code class="computeroutput"><span class="identifier">mp_find</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_find_if_l_p"><code class="computeroutput"><span class="identifier">mp_find_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_reverse_l"><code class="computeroutput"><span class="identifier">mp_reverse</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_fold_l_v_f"><code class="computeroutput"><span class="identifier">mp_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_reverse_fold_l_v_f"><code class="computeroutput"><span class="identifier">mp_reverse_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_unique_l"><code class="computeroutput"><span class="identifier">mp_unique</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_all_of_l_p"><code class="computeroutput"><span class="identifier">mp_all_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_none_of_l_p"><code class="computeroutput"><span class="identifier">mp_none_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.algorithm.mp_any_of_l_p"><code class="computeroutput"><span class="identifier">mp_any_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.set">Set Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">set</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.set.mp_set_contains_s_v"><code class="computeroutput"><span class="identifier">mp_set_contains</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.set.mp_set_push_back_s_t"><code class="computeroutput"><span class="identifier">mp_set_push_back</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.set.mp_set_push_front_s_t"><code class="computeroutput"><span class="identifier">mp_set_push_front</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.map">Map Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">map</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_find_m_k"><code class="computeroutput"><span class="identifier">mp_map_find</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span>
<span class="identifier">K</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_contains_m_k"><code class="computeroutput"><span class="identifier">mp_map_contains</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_insert_m_t"><code class="computeroutput"><span class="identifier">mp_map_insert</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_replace_m_t"><code class="computeroutput"><span class="identifier">mp_map_replace</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_update_m_t_f"><code class="computeroutput"><span class="identifier">mp_map_update</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.map.mp_map_erase_m_k"><code class="computeroutput"><span class="identifier">mp_map_erase</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.function">Helper Metafunctions, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.function.mp_and_t"><code class="computeroutput"><span class="identifier">mp_and</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.function.mp_all_t"><code class="computeroutput"><span class="identifier">mp_all</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.function.mp_or_t"><code class="computeroutput"><span class="identifier">mp_or</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.function.mp_any_t"><code class="computeroutput"><span class="identifier">mp_any</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind">Bind, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">bind</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_arg_i"><code class="computeroutput"><span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.1_9"><code class="computeroutput"><span class="identifier">_1</span></code>,
..., <code class="computeroutput"><span class="identifier">_9</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_f_t"><code class="computeroutput"><span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_q_q_t"><code class="computeroutput"><span class="identifier">mp_bind_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_front_f_t"><code class="computeroutput"><span class="identifier">mp_bind_front</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_front_q_q_t"><code class="computeroutput"><span class="identifier">mp_bind_front_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_back_f_t"><code class="computeroutput"><span class="identifier">mp_bind_back</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.bind.mp_bind_back_q_q_t"><code class="computeroutput"><span class="identifier">mp_bind_back_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence">Integer Sequences,
<code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence.integer_sequence_t_i"><code class="computeroutput"><span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">I</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence.make_integer_sequence_t_n"><code class="computeroutput"><span class="identifier">make_integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence.index_sequence_i"><code class="computeroutput"><span class="identifier">index_sequence</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">...&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence.make_index_sequence_n"><code class="computeroutput"><span class="identifier">make_index_sequence</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a></span></dt>
<dt><span class="section"><a href="mp11.html#mp11.reference.integer_sequence.index_sequence_for_t"><code class="computeroutput"><span class="identifier">index_sequence_for</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a></span></dt>
</dl></dd>
<dt><span class="section"><a href="mp11.html#mp11.reference.tuple_for_each">A "for each"
algorithm for tuple-like types, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple_for_each</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a></span></dt>
<dd><dl><dt><span class="section"><a href="mp11.html#mp11.reference.tuple_for_each.tuple_for_each"><code class="computeroutput"><span class="identifier">tuple_for_each</span></code></a></span></dt></dl></dd>
</dl></dd>
</dl>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="mp11.overview"></a><a class="link" href="mp11.html#mp11.overview" title="Overview">Overview</a>
</h2></div></div></div>
<p>
Mp11 is a C++11 metaprogramming library based on template aliases and variadic
templates. It implements the approach outlined in the article <a href="http://pdimov.com/cpp2/simple_cxx11_metaprogramming.html" target="_top">Simple
C++11 metaprogramming</a> and <a href="http://pdimov.com/cpp2/simple_cxx11_metaprogramming_2.html" target="_top">its
sequel</a>. Reading these articles before proceeding with this documentation
is highly recommended.
</p>
<p>
The general principles upon which Mp11 is built are that algorithms and metafunctions
are template aliases of the form <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
and data structures are lists of the form <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>,
with the library placing no requirements on <code class="computeroutput"><span class="identifier">L</span></code>.
<code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is the built-in list type, but <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">&gt;</span></code> and <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
are also perfectly legitimate list types, although of course <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span>
<span class="identifier">T2</span><span class="special">&gt;</span></code>,
due to having exactly two elements, is not resizeable and will consequently
not work with algorithms that need to add or remove elements.
</p>
<p>
Another distinguishing feature of this approach is that lists (<code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>) have the same form as metafunctions
(<code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>)
and can therefore be used as such. For example, applying <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">add_pointer_t</span></code>
to the list <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;</span></code> by way of <code class="computeroutput"><span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">add_pointer_t</span><span class="special">,</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;&gt;</span></code> gives us <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">*,</span> <span class="keyword">float</span><span class="special">*&gt;</span></code>, but we can also apply <code class="computeroutput"><span class="identifier">mp_list</span></code>
to the same tuple:
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">mp_list</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;&gt;;</span>
</pre>
<p>
and get <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">&gt;,</span> <span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="mp11.definitions"></a><a class="link" href="mp11.html#mp11.definitions" title="Definitions">Definitions</a>
</h2></div></div></div>
<p>
A <span class="emphasis"><em>list</em></span> is a &#8212; usually but not necessarily variadic &#8212; template
class whose parameters are all types, for example <code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">[],</span>
<span class="keyword">void</span><span class="special">&gt;</span></code>,
<code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;&gt;</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;</span></code>, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">&gt;</span></code>.
</p>
<p>
A <span class="emphasis"><em>metafunction</em></span> is a class template or a template alias
whose parameters are all types, for example <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">add_pointer_t</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">is_const</span></code>, <code class="computeroutput"><span class="identifier">mp_second</span></code>,
<code class="computeroutput"><span class="identifier">mp_push_front</span></code>, <code class="computeroutput"><span class="identifier">mp_list</span></code>, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">shared_ptr</span></code>,
or
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">using</span> <span class="identifier">F1</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">F2</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">*;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">F3</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="keyword">sizeof</span><span class="special">...(</span><span class="identifier">T</span><span class="special">)&gt;;</span>
</pre>
<p>
A <span class="emphasis"><em>quoted metafunction</em></span> is a class with a public metafunction
member called <code class="computeroutput"><span class="identifier">fn</span></code>, for example
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">Q1</span> <span class="special">{</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="keyword">void</span><span class="special">;</span> <span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">Q2</span> <span class="special">{</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">*;</span> <span class="special">};</span>
<span class="keyword">struct</span> <span class="identifier">Q3</span> <span class="special">{</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="keyword">sizeof</span><span class="special">...(</span><span class="identifier">T</span><span class="special">)&gt;;</span> <span class="special">};</span>
</pre>
<p>
An <span class="emphasis"><em>integral constant type</em></span> is a class with a public member
<code class="computeroutput"><span class="identifier">value</span></code> that is an integral constant
in the C++ sense. For example, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span>
<span class="number">7</span><span class="special">&gt;</span></code>,
or
</p>
<pre class="programlisting"><span class="keyword">struct</span> <span class="identifier">N</span> <span class="special">{</span> <span class="keyword">static</span> <span class="keyword">int</span> <span class="keyword">constexpr</span> <span class="identifier">value</span> <span class="special">=</span> <span class="number">2</span><span class="special">;</span> <span class="special">};</span>
</pre>
<p>
A <span class="emphasis"><em>set</em></span> is a list whose elements are unique.
</p>
<p>
A <span class="emphasis"><em>map</em></span> is a list of lists, the inner lists having at least
one element (the key.) The keys of the map must be unique. For example,
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">M1</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">*&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">,</span> <span class="keyword">float</span><span class="special">*&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="keyword">void</span><span class="special">,</span> <span class="keyword">void</span><span class="special">*&gt;&gt;;</span>
<span class="keyword">using</span> <span class="identifier">M2</span> <span class="special">=</span> <span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">int</span><span class="special">*&gt;,</span> <span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;,</span> <span class="identifier">mp_list</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">char</span><span class="special">[</span><span class="number">1</span><span class="special">],</span> <span class="keyword">char</span><span class="special">[</span><span class="number">2</span><span class="special">]&gt;&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="mp11.examples"></a><a class="link" href="mp11.html#mp11.examples" title="Examples">Examples</a>
</h2></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.examples.generating_test_cases"></a><a class="link" href="mp11.html#mp11.examples.generating_test_cases" title="Generating Test Cases">Generating Test
Cases</a>
</h3></div></div></div>
<p>
Let's suppose that we have written a metafunction <code class="computeroutput"><span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">&gt;</span></code>:
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">promote</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">common_type_t</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">common_type_t</span><span class="special">&lt;</span><span class="identifier">promote</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">promote</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;&gt;;</span>
</pre>
<p>
that ought to represent the result of an arithmetic operation on the integer
types <code class="computeroutput"><span class="identifier">T</span></code> and <code class="computeroutput"><span class="identifier">U</span></code>, for example <code class="computeroutput"><span class="identifier">t</span>
<span class="special">+</span> <span class="identifier">u</span></code>.
We want to test whether <code class="computeroutput"><span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">&gt;</span></code>
gives correct results for various combinations of <code class="computeroutput"><span class="identifier">T</span></code>
and <code class="computeroutput"><span class="identifier">U</span></code>, so we write the function
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">test_result</span><span class="special">()</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">T3</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span> <span class="identifier">T1</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">T2</span><span class="special">()</span> <span class="special">);</span>
<span class="keyword">using</span> <span class="identifier">T4</span> <span class="special">=</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">&gt;;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span><span class="identifier">T3</span><span class="special">,</span> <span class="identifier">T4</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">?</span> <span class="string">"[PASS]"</span><span class="special">:</span> <span class="string">"[FAIL]"</span> <span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
</pre>
<p>
and then need to call it a substantial number of times:
</p>
<pre class="programlisting"><span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="identifier">test_result</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">char</span><span class="special">&gt;();</span>
<span class="identifier">test_result</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">short</span><span class="special">&gt;();</span>
<span class="identifier">test_result</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;();</span>
<span class="identifier">test_result</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">&gt;();</span>
<span class="comment">// ...</span>
<span class="special">}</span>
</pre>
<p>
Writing all those type combinations by hand is unwieldy, error prone, and
worst of all, boring. This is how we can leverage Mp11 to automate the task:
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple_for_each</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">demangle</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">type_traits</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">typeinfo</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mp11</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">()</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">core</span><span class="special">::</span><span class="identifier">demangle</span><span class="special">(</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">).</span><span class="identifier">name</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">promote</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">common_type_t</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="keyword">int</span><span class="special">&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">result</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">common_type_t</span><span class="special">&lt;</span><span class="identifier">promote</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;,</span> <span class="identifier">promote</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;&gt;;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T2</span><span class="special">&gt;</span> <span class="keyword">void</span> <span class="identifier">test_result</span><span class="special">(</span> <span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">&gt;</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">T3</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span> <span class="identifier">T1</span><span class="special">()</span> <span class="special">+</span> <span class="identifier">T2</span><span class="special">()</span> <span class="special">);</span>
<span class="keyword">using</span> <span class="identifier">T4</span> <span class="special">=</span> <span class="identifier">result</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">&gt;;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span><span class="identifier">T3</span><span class="special">,</span> <span class="identifier">T4</span><span class="special">&gt;::</span><span class="identifier">value</span><span class="special">?</span> <span class="string">"[PASS] "</span><span class="special">:</span> <span class="string">"[FAIL] "</span> <span class="special">)</span>
<span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">" + "</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">" -&gt; "</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="identifier">T3</span><span class="special">&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">", result: "</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="identifier">T4</span><span class="special">&gt;()</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
<span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">L</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span><span class="special">&lt;</span><span class="keyword">char</span><span class="special">,</span> <span class="keyword">short</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">,</span> <span class="keyword">long</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">long</span><span class="special">&gt;;</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple_for_each</span><span class="special">(</span> <span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">mp_list</span><span class="special">,</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">L</span><span class="special">&gt;(),</span> <span class="special">[](</span><span class="keyword">auto</span><span class="special">&amp;&amp;</span> <span class="identifier">x</span><span class="special">){</span> <span class="identifier">test_result</span><span class="special">(</span><span class="identifier">x</span><span class="special">);</span> <span class="special">}</span> <span class="special">);</span>
<span class="special">}</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.examples.computing_return_types"></a><a class="link" href="mp11.html#mp11.examples.computing_return_types" title="Computing Return Types">Computing Return
Types</a>
</h3></div></div></div>
<p>
C++17 has a standard variant type, called <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span></code>.
It also defines a function template <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span></code>
that can be used to apply a function to the contained value of one or more
<code class="computeroutput"><span class="identifier">variant</span></code>s. So for instance,
if the <code class="computeroutput"><span class="identifier">variant</span></code> <code class="computeroutput"><span class="identifier">v1</span></code> contains <code class="computeroutput"><span class="number">1</span></code>,
and the <code class="computeroutput"><span class="identifier">variant</span></code> <code class="computeroutput"><span class="identifier">v2</span></code> contains <code class="computeroutput"><span class="number">2.0f</span></code>,
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span><span class="identifier">f</span><span class="special">,</span> <span class="identifier">v1</span><span class="special">,</span> <span class="identifier">v2</span><span class="special">)</span></code>
will call <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="number">1</span><span class="special">,</span> <span class="number">2.0f</span><span class="special">)</span></code>.
</p>
<p>
However, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span></code> has one limitation: it cannot return
a result unless all possible applications of the function have the same return
type. If, for instance, <code class="computeroutput"><span class="identifier">v1</span></code>
and <code class="computeroutput"><span class="identifier">v2</span></code> are both of type
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="keyword">short</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;</span></code>,
</p>
<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[](</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">y</span> <span class="special">){</span> <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span> <span class="special">},</span> <span class="identifier">v1</span><span class="special">,</span> <span class="identifier">v2</span> <span class="special">);</span>
</pre>
<p>
will fail to compile because the result of <code class="computeroutput"><span class="identifier">x</span>
<span class="special">+</span> <span class="identifier">y</span></code>
can be either <code class="computeroutput"><span class="keyword">int</span></code> or <code class="computeroutput"><span class="keyword">float</span></code> depending on what <code class="computeroutput"><span class="identifier">v1</span></code>
and <code class="computeroutput"><span class="identifier">v2</span></code> hold.
</p>
<p>
A type that can hold either <code class="computeroutput"><span class="keyword">int</span></code>
or <code class="computeroutput"><span class="keyword">float</span></code> already exists, called,
surprisingly enough, <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span>
<span class="keyword">float</span><span class="special">&gt;</span></code>.
Let's write our own function template <code class="computeroutput"><span class="identifier">rvisit</span></code>
that is the same as <code class="computeroutput"><span class="identifier">visit</span></code>
but returns a <code class="computeroutput"><span class="identifier">variant</span></code>:
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">auto</span> <span class="identifier">rvisit</span><span class="special">(</span> <span class="identifier">F</span><span class="special">&amp;&amp;</span> <span class="identifier">f</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&amp;&amp;...</span> <span class="identifier">v</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">R</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
<span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[&amp;](</span> <span class="keyword">auto</span><span class="special">&amp;&amp;...</span> <span class="identifier">x</span> <span class="special">){</span> <span class="keyword">return</span> <span class="identifier">R</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;(</span><span class="identifier">f</span><span class="special">)(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&gt;(</span><span class="identifier">x</span><span class="special">)...</span> <span class="special">)</span> <span class="special">);</span> <span class="special">},</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;(</span> <span class="identifier">v</span> <span class="special">)...</span> <span class="special">);</span>
<span class="special">}</span>
</pre>
<p>
What this does is basically calls <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span></code>
to do the work, but instead of passing it <code class="computeroutput"><span class="identifier">f</span></code>,
we pass a lambda that does the same as <code class="computeroutput"><span class="identifier">f</span></code>
except it converts the result to a common type <code class="computeroutput"><span class="identifier">R</span></code>.
<code class="computeroutput"><span class="identifier">R</span></code> is supposed to be <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;...&gt;</span></code> where the ellipsis denotes the
return types of calling <code class="computeroutput"><span class="identifier">f</span></code>
with all possible combinations of variant values.
</p>
<p>
We'll first define a helper quoted metafunction <code class="computeroutput"><span class="identifier">Qret</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;</span></code>
that returns the result of the application of <code class="computeroutput"><span class="identifier">F</span></code>
to arguments of type <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>:
</p>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">Qret</span>
<span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">declval</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;()(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">declval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;()...</span> <span class="special">)</span> <span class="special">);</span>
<span class="special">};</span>
</pre>
<p>
(Unfortunately, we can't just define this metafunction inside <code class="computeroutput"><span class="identifier">rvisit</span></code>; the language prohibits defining
template aliases inside functions.)
</p>
<p>
With <code class="computeroutput"><span class="identifier">Qret</span></code> in hand, a <code class="computeroutput"><span class="identifier">variant</span></code> of the possible return types is
just a matter of applying it over the possible combinations of the variant
values:
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">Qret</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">remove_reference_t</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;...&gt;;</span>
</pre>
<p>
Why does this work? <code class="computeroutput"><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span>
<span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...&gt;,</span> <span class="identifier">L2</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;,</span> <span class="special">...,</span> <span class="identifier">Ln</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">...&gt;&gt;</span></code> returns <code class="computeroutput"><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Un</span><span class="special">&gt;,</span> <span class="special">...&gt;</span></code>,
where <code class="computeroutput"><span class="identifier">Ui</span></code> traverse all possible
combinations of list values. Since in our case all <code class="computeroutput"><span class="identifier">Li</span></code>
are <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span></code>, the result will also be <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span></code>.
</p>
<p>
One more step remains. Suppose that, as above, we're passing two variants
of type <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="keyword">short</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">&gt;</span></code>
and <code class="computeroutput"><span class="identifier">F</span></code> is <code class="computeroutput"><span class="special">[](</span>
<span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">y</span> <span class="special">){</span> <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span> <span class="special">}</span></code>. This
will generate <code class="computeroutput"><span class="identifier">R</span></code> of length
9, one per each combination, but many of those elements will be the same,
either <code class="computeroutput"><span class="keyword">int</span></code> or <code class="computeroutput"><span class="keyword">float</span></code>, and we need to filter out the duplicates.
So,
</p>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">mp_unique</span><span class="special">&lt;</span><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">Qret</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">remove_reference_t</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;...&gt;&gt;;</span>
</pre>
<p>
and we're done:
</p>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">core</span><span class="special">/</span><span class="identifier">demangle</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">variant</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">type_traits</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">typeinfo</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">mp11</span><span class="special">;</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">Qret</span>
<span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="keyword">decltype</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">declval</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;()(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">declval</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;()...</span> <span class="special">)</span> <span class="special">);</span>
<span class="special">};</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">auto</span> <span class="identifier">rvisit</span><span class="special">(</span> <span class="identifier">F</span><span class="special">&amp;&amp;</span> <span class="identifier">f</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&amp;&amp;...</span> <span class="identifier">v</span> <span class="special">)</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">R</span> <span class="special">=</span> <span class="identifier">mp_unique</span><span class="special">&lt;</span><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">Qret</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">remove_reference_t</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;...&gt;&gt;;</span>
<span class="keyword">return</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[&amp;](</span> <span class="keyword">auto</span><span class="special">&amp;&amp;...</span> <span class="identifier">x</span> <span class="special">){</span> <span class="keyword">return</span> <span class="identifier">R</span><span class="special">(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;(</span><span class="identifier">f</span><span class="special">)(</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&gt;(</span><span class="identifier">x</span><span class="special">)...</span> <span class="special">)</span> <span class="special">);</span> <span class="special">},</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">&gt;(</span> <span class="identifier">v</span> <span class="special">)...</span> <span class="special">);</span>
<span class="special">}</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <span class="identifier">name</span><span class="special">()</span>
<span class="special">{</span>
<span class="keyword">return</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">core</span><span class="special">::</span><span class="identifier">demangle</span><span class="special">(</span> <span class="keyword">typeid</span><span class="special">(</span><span class="identifier">T</span><span class="special">).</span><span class="identifier">name</span><span class="special">()</span> <span class="special">);</span>
<span class="special">}</span>
<span class="keyword">int</span> <span class="identifier">main</span><span class="special">()</span>
<span class="special">{</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="keyword">signed</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">char</span><span class="special">,</span> <span class="keyword">signed</span> <span class="keyword">short</span><span class="special">,</span> <span class="keyword">unsigned</span> <span class="keyword">short</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">&gt;</span> <span class="identifier">v1</span><span class="special">(</span> <span class="number">1</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">v1</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")v1: "</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[](</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span> <span class="special">){</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")"</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="special">},</span> <span class="identifier">v1</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">float</span><span class="special">,</span> <span class="keyword">double</span><span class="special">&gt;</span> <span class="identifier">v2</span><span class="special">(</span> <span class="number">2.0f</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">v2</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")v2: "</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[](</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span> <span class="special">){</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")"</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="special">},</span> <span class="identifier">v2</span> <span class="special">);</span>
<span class="keyword">auto</span> <span class="identifier">v3</span> <span class="special">=</span> <span class="identifier">rvisit</span><span class="special">(</span> <span class="special">[](</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span><span class="special">,</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">y</span> <span class="special">){</span> <span class="keyword">return</span> <span class="identifier">x</span> <span class="special">+</span> <span class="identifier">y</span><span class="special">;</span> <span class="special">},</span> <span class="identifier">v1</span><span class="special">,</span> <span class="identifier">v2</span> <span class="special">);</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">v3</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")v3: "</span><span class="special">;</span>
<span class="identifier">std</span><span class="special">::</span><span class="identifier">visit</span><span class="special">(</span> <span class="special">[](</span> <span class="keyword">auto</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">x</span> <span class="special">){</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"("</span> <span class="special">&lt;&lt;</span> <span class="identifier">name</span><span class="special">&lt;</span><span class="keyword">decltype</span><span class="special">(</span><span class="identifier">x</span><span class="special">)&gt;()</span> <span class="special">&lt;&lt;</span> <span class="string">")"</span> <span class="special">&lt;&lt;</span> <span class="identifier">x</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span> <span class="special">},</span> <span class="identifier">v3</span> <span class="special">);</span>
<span class="special">}</span>
</pre>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
<a name="mp11.reference"></a><a class="link" href="mp11.html#mp11.reference" title="Reference">Reference</a>
</h2></div></div></div>
<p>
The contents of the library are in namespace <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">mp11</span></code>, unless
specified otherwise.
</p>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.integral"></a><a class="link" href="mp11.html#mp11.reference.integral" title="Integral Constants, &lt;boost/mp11/integral.hpp&gt;">Integral Constants, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">integral</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<p>
For an Mp11 integral constant type <code class="computeroutput"><span class="identifier">T</span></code>,
<code class="computeroutput"><span class="identifier">T</span><span class="special">::</span><span class="identifier">value</span></code> is an integral constant in the C++
sense.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_bool_b"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_bool_b" title="mp_bool&lt;B&gt;"><code class="computeroutput"><span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> <span class="identifier">B</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_bool</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">,</span> <span class="identifier">B</span><span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_true"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_true" title="mp_true"><code class="computeroutput"><span class="identifier">mp_true</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">mp_true</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="keyword">true</span><span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_false"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_false" title="mp_false"><code class="computeroutput"><span class="identifier">mp_false</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">mp_false</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="keyword">false</span><span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_to_bool_t"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_to_bool_t" title="mp_to_bool&lt;T&gt;"><code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_to_bool</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">&gt;(</span><span class="identifier">T</span><span class="special">::</span><span class="identifier">value</span><span class="special">)&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_not_t"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_not_t" title="mp_not&lt;T&gt;"><code class="computeroutput"><span class="identifier">mp_not</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_not</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span> <span class="special">!</span><span class="identifier">T</span><span class="special">::</span><span class="identifier">value</span> <span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_int_i"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_int_i" title="mp_int&lt;I&gt;"><code class="computeroutput"><span class="identifier">mp_int</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">int</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_int</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="identifier">I</span><span class="special">&gt;;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integral.mp_size_t_n"></a><a class="link" href="mp11.html#mp11.reference.integral.mp_size_t_n" title="mp_size_t&lt;N&gt;"><code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_size_t</span> <span class="special">=</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;;</span>
</pre>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.list"></a><a class="link" href="mp11.html#mp11.reference.list" title="List Operations, &lt;boost/mp11/list.hpp&gt;">List Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">list</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_list_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_list_t" title="mp_list&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_list</span> <span class="special">{};</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_list</span></code> is the standard
list type of Mp11, although the library is not restricted to it and can
operate on arbitrary class templates such as <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple</span></code>
or <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">variant</span></code>. Even <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span></code>
can be used if the transformation does not alter the number of the elements
in the list.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_size_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_size_l" title="mp_size&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_size</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
returns the number of elements in the list <code class="computeroutput"><span class="identifier">L</span></code>,
as a <code class="computeroutput"><span class="identifier">mp_size_t</span></code>. In other
words, <code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="keyword">sizeof</span><span class="special">...(</span><span class="identifier">T</span><span class="special">)&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_empty_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_empty_l" title="mp_empty&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_empty</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_empty</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">==</span> <span class="number">0</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_empty</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">mp_true</span></code>
if the list <code class="computeroutput"><span class="identifier">L</span></code> is empty,
for <code class="computeroutput"><span class="identifier">mp_false</span></code> otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_front_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_front_l" title="mp_front&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_front</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
is the first element of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T1</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_pop_front_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_pop_front_l" title="mp_pop_front&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_pop_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_pop_front</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_pop_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
removes the first element of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_pop_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_first_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_first_l" title="mp_first&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_first</span> <span class="special">=</span> <span class="identifier">mp_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_first</span></code> is another name
for <code class="computeroutput"><span class="identifier">mp_front</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_rest_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_rest_l" title="mp_rest&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_rest</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_rest</span> <span class="special">=</span> <span class="identifier">mp_pop_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_rest</span></code> is another name
for <code class="computeroutput"><span class="identifier">mp_pop_front</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_second_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_second_l" title="mp_second&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_second</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
is the second element of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T2</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_third_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_third_l" title="mp_third&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_third</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
is the third element of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">T3</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T3</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_push_front_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_push_front_l_t" title="mp_push_front&lt;L, T...&gt;"><code class="computeroutput"><span class="identifier">mp_push_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_push_front</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_push_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> inserts the elements <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>
at the front of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_push_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_push_back_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_push_back_l_t" title="mp_push_back&lt;L, T...&gt;"><code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_push_back</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> inserts the elements <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>
at the back of the list <code class="computeroutput"><span class="identifier">L</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_rename_l_y"></a><a class="link" href="mp11.html#mp11.reference.list.mp_rename_l_y" title="mp_rename&lt;L, Y&gt;"><code class="computeroutput"><span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span>
<span class="identifier">Y</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">Y</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_rename</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">Y</span><span class="special">&gt;</span></code> changes the type of the list <code class="computeroutput"><span class="identifier">L</span></code> to <code class="computeroutput"><span class="identifier">Y</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;,</span> <span class="identifier">Y</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">Y</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_apply_f_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_apply_f_l" title="mp_apply&lt;F, L&gt;"><code class="computeroutput"><span class="identifier">mp_apply</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span>
<span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_apply</span> <span class="special">=</span> <span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_apply</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">&gt;</span></code> applies the metafunction <code class="computeroutput"><span class="identifier">F</span></code> to the contents of the list <code class="computeroutput"><span class="identifier">L</span></code>, that is, <code class="computeroutput"><span class="identifier">mp_rename</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>.
(<code class="computeroutput"><span class="identifier">mp_apply</span></code> is the same as
<code class="computeroutput"><span class="identifier">mp_rename</span></code> with the arguments
reversed.)
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_append_l"></a><a class="link" href="mp11.html#mp11.reference.list.mp_append_l" title="mp_append&lt;L...&gt;"><code class="computeroutput"><span class="identifier">mp_append</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_append</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_append</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">...&gt;</span></code>
concatenates the lists in <code class="computeroutput"><span class="identifier">L</span><span class="special">...</span></code> into a single list that has the same
type as the first list. <code class="computeroutput"><span class="identifier">mp_append</span><span class="special">&lt;&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;&gt;</span></code>. <code class="computeroutput"><span class="identifier">mp_append</span><span class="special">&lt;</span><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...&gt;,</span> <span class="identifier">L2</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;,</span> <span class="special">...,</span>
<span class="identifier">Ln</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...,</span> <span class="identifier">T2</span><span class="special">...,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_replace_front_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_replace_front_l_t" title="mp_replace_front&lt;L, T&gt;"><code class="computeroutput"><span class="identifier">mp_replace_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_front</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_replace_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code> replaces the first element of the list
<code class="computeroutput"><span class="identifier">L</span></code> with <code class="computeroutput"><span class="identifier">T</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_replace_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;,</span>
<span class="identifier">T</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_replace_first_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_replace_first_l_t" title="mp_replace_first&lt;L, T&gt;"><code class="computeroutput"><span class="identifier">mp_replace_first</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_first</span> <span class="special">=</span> <span class="identifier">mp_replace_front</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_replace_first</span></code> is another
name for <code class="computeroutput"><span class="identifier">mp_replace_front</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_replace_second_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_replace_second_l_t" title="mp_replace_second&lt;L, T&gt;"><code class="computeroutput"><span class="identifier">mp_replace_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_second</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_replace_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code> replaces the second element of the
list <code class="computeroutput"><span class="identifier">L</span></code> with <code class="computeroutput"><span class="identifier">T</span></code>. That is, <code class="computeroutput"><span class="identifier">mp_replace_second</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;,</span>
<span class="identifier">T</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.list.mp_replace_third_l_t"></a><a class="link" href="mp11.html#mp11.reference.list.mp_replace_third_l_t" title="mp_replace_third&lt;L, T&gt;"><code class="computeroutput"><span class="identifier">mp_replace_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_third</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_replace_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code> replaces the third element of the list
<code class="computeroutput"><span class="identifier">L</span></code> with <code class="computeroutput"><span class="identifier">T</span></code>.
That is, <code class="computeroutput"><span class="identifier">mp_replace_third</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="identifier">U3</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;,</span>
<span class="identifier">T</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.utility"></a><a class="link" href="mp11.html#mp11.reference.utility" title="Utility Components, &lt;boost/mp11/utility.hpp&gt;">Utility Components, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">utility</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_identity_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_identity_t" title="mp_identity&lt;T&gt;"><code class="computeroutput"><span class="identifier">mp_identity</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_identity</span>
<span class="special">{</span>
<span class="keyword">using</span> <span class="identifier">type</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">;</span>
<span class="special">};</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_identity_t_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_identity_t_t" title="mp_identity_t&lt;T&gt;"><code class="computeroutput"><span class="identifier">mp_identity_t</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_identity_t</span> <span class="special">=</span> <span class="identifier">T</span><span class="special">;</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_inherit_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_inherit_t" title="mp_inherit&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_inherit</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_inherit</span><span class="special">:</span> <span class="identifier">T</span><span class="special">...</span> <span class="special">{};</span>
</pre>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_if_c_b_t_e"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_if_c_b_t_e" title="mp_if_c&lt;B, T, E&gt;"><code class="computeroutput"><span class="identifier">mp_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> <span class="identifier">C</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">E</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_if_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T</span></code> when
<code class="computeroutput"><span class="identifier">B</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>,
for <code class="computeroutput"><span class="identifier">E</span></code> otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_if_c_t_e"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_if_c_t_e" title="mp_if&lt;C, T, E&gt;"><code class="computeroutput"><span class="identifier">mp_if</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">C</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">E</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_if</span> <span class="special">=</span> <span class="identifier">mp_if_c</span><span class="special">&lt;</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">&gt;(</span><span class="identifier">C</span><span class="special">::</span><span class="identifier">value</span><span class="special">),</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_if</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">E</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T</span></code> when
<code class="computeroutput"><span class="identifier">C</span><span class="special">::</span><span class="identifier">value</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>,
for <code class="computeroutput"><span class="identifier">E</span></code> otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_eval_if_c_b_t_f_u"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_eval_if_c_b_t_f_u" title="mp_eval_if_c&lt;B, T, F, U...&gt;"><code class="computeroutput"><span class="identifier">mp_eval_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">bool</span> <span class="identifier">C</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_eval_if_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_eval_if_c</span><span class="special">&lt;</span><span class="identifier">B</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">...&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">T</span></code> when
<code class="computeroutput"><span class="identifier">B</span></code> is <code class="computeroutput"><span class="keyword">true</span></code>,
for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code>
otherwise. Its purpose is to avoid evaluating <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code> when the condition is <code class="computeroutput"><span class="keyword">true</span></code> as it may not be valid in this case.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_eval_if_c_t_f_u"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_eval_if_c_t_f_u" title="mp_eval_if&lt;C, T, F, U...&gt;"><code class="computeroutput"><span class="identifier">mp_eval_if</span><span class="special">&lt;</span><span class="identifier">C</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span>
<span class="identifier">U</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">C</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_eval_if</span> <span class="special">=</span> <span class="identifier">mp_eval_if_c</span><span class="special">&lt;</span><span class="keyword">static_cast</span><span class="special">&lt;</span><span class="keyword">bool</span><span class="special">&gt;(</span><span class="identifier">C</span><span class="special">::</span><span class="identifier">value</span><span class="special">),</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span> <span class="identifier">U</span><span class="special">...&gt;;</span>
</pre>
<p>
Like <code class="computeroutput"><span class="identifier">mp_eval_if_c</span></code>, but
the first argument is a type.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_valid_f_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_valid_f_t" title="mp_valid&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_valid</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_valid</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_valid</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">mp_true</span></code>
when <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is a valid expression, for <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_defer_f_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_defer_f_t" title="mp_defer&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_defer</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_defer</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
When <code class="computeroutput"><span class="identifier">mp_valid</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>,
<code class="computeroutput"><span class="identifier">mp_defer</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is a struct with a nested type
<code class="computeroutput"><span class="identifier">type</span></code> which is an alias
for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>.
Otherwise, <code class="computeroutput"><span class="identifier">mp_defer</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is an empty struct.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_quote_f_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_quote_f_t" title="mp_quote&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_quote</span>
<span class="special">{</span>
<span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">U</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">fn</span> <span class="special">=</span> <span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...,</span> <span class="identifier">U</span><span class="special">...&gt;;</span>
<span class="special">};</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> transforms the template <code class="computeroutput"><span class="identifier">F</span></code> into a type. In the common case <code class="computeroutput"><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;</span></code>,
the nested template <code class="computeroutput"><span class="identifier">fn</span></code>
of the result is an alias for <code class="computeroutput"><span class="identifier">F</span></code>;
otherwise, <code class="computeroutput"><span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>,
allowing partial application.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.utility.mp_invoke_q_t"></a><a class="link" href="mp11.html#mp11.reference.utility.mp_invoke_q_t" title="mp_invoke&lt;Q, T...&gt;"><code class="computeroutput"><span class="identifier">mp_invoke</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_invoke</span> <span class="special">=</span> <span class="keyword">typename</span> <span class="identifier">Q</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_invoke</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> evaluates the nested template <code class="computeroutput"><span class="identifier">fn</span></code> of a quoted metafunction. <code class="computeroutput"><span class="identifier">mp_invoke</span><span class="special">&lt;</span><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>.
<code class="computeroutput"><span class="identifier">mp_invoke</span><span class="special">&lt;</span><span class="identifier">mp_quote</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.algorithm"></a><a class="link" href="mp11.html#mp11.reference.algorithm" title="Algorithms, &lt;boost/mp11/algorithm.hpp&gt;">Algorithms, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">algorithm</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_assign_l1_l2"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_assign_l1_l2" title="mp_assign&lt;L1, L2&gt;"><code class="computeroutput"><span class="identifier">mp_assign</span><span class="special">&lt;</span><span class="identifier">L1</span><span class="special">,</span> <span class="identifier">L2</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L1</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">L2</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_assign</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_assign</span><span class="special">&lt;</span><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...&gt;,</span>
<span class="identifier">L2</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;</span></code>.
That is, it replaces the elements of <code class="computeroutput"><span class="identifier">L1</span></code>
with those of <code class="computeroutput"><span class="identifier">L2</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_clear_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_clear_l" title="mp_clear&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_clear</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_clear</span> <span class="special">=</span> <span class="identifier">mp_assign</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">mp_list</span><span class="special">&lt;&gt;&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_clear</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;&gt;</span></code>,
that is, it removes the elements of <code class="computeroutput"><span class="identifier">L</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_transform_f_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_transform_f_l" title="mp_transform&lt;F, L...&gt;"><code class="computeroutput"><span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_transform</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...&gt;,</span> <span class="identifier">L2</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;,</span> <span class="special">...,</span>
<span class="identifier">Ln</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">...&gt;&gt;</span></code>
applies <code class="computeroutput"><span class="identifier">F</span></code> to each successive
tuple of elements and returns <code class="computeroutput"><span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_transform_q_q_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_transform_q_q_l" title="mp_transform_q&lt;Q, L...&gt;"><code class="computeroutput"><span class="identifier">mp_transform_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_transform_q</span> <span class="special">=</span> <span class="identifier">mp_transform</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;;</span>
</pre>
<p>
As <code class="computeroutput"><span class="identifier">mp_transform</span></code>, but takes
a quoted metafunction.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_transform_if_p_f_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_transform_if_p_f_l" title="mp_transform_if&lt;P, F, L...&gt;"><code class="computeroutput"><span class="identifier">mp_transform_if</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">L</span><span class="special">...&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_transform_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_transform_if</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">,</span> <span class="identifier">F</span><span class="special">,</span> <span class="identifier">L1</span><span class="special">,</span> <span class="identifier">L2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Ln</span><span class="special">&gt;</span></code>
replaces the elements of the list <code class="computeroutput"><span class="identifier">L1</span></code>
for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
with <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;</span></code>, and returns the result, where <code class="computeroutput"><span class="identifier">Ti</span></code> are the corresponding elements of
<code class="computeroutput"><span class="identifier">Li</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_fill_l_v"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_fill_l_v" title="mp_fill&lt;L, V&gt;"><code class="computeroutput"><span class="identifier">mp_fill</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_fill</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_fill</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;,</span> <span class="identifier">V</span><span class="special">&gt;</span></code>
returns <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">V</span><span class="special">&gt;</span></code>,
with the result having the same size as the input.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_count_l_v"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_count_l_v" title="mp_count&lt;L, V&gt;"><code class="computeroutput"><span class="identifier">mp_count</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_count</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_count</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code> returns <code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>, where <code class="computeroutput"><span class="identifier">N</span></code>
is the number of elements of <code class="computeroutput"><span class="identifier">L</span></code>
same as <code class="computeroutput"><span class="identifier">V</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_count_if_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_count_if_l_p" title="mp_count_if&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_count_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_count_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_count_f</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> returns <code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>, where <code class="computeroutput"><span class="identifier">N</span></code>
is the number of elements <code class="computeroutput"><span class="identifier">T</span></code>
of <code class="computeroutput"><span class="identifier">L</span></code> for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_contains_l_v"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_contains_l_v" title="mp_contains&lt;L, V&gt;"><code class="computeroutput"><span class="identifier">mp_contains</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_contains</span> <span class="special">=</span> <span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">mp_count</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_contains</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
when <code class="computeroutput"><span class="identifier">L</span></code> contains an element
<code class="computeroutput"><span class="identifier">V</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_repeat_c_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_repeat_c_l_n" title="mp_repeat_c&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_repeat_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_repeat_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_repeat_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code> returns a list of the same type as
<code class="computeroutput"><span class="identifier">L</span></code> that consists of <code class="computeroutput"><span class="identifier">N</span></code> concatenated copies of <code class="computeroutput"><span class="identifier">L</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_repeat_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_repeat_l_n" title="mp_repeat&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_repeat</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_repeat</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_repeat_c</span></code> but
with a type argument <code class="computeroutput"><span class="identifier">N</span></code>.
The number of copies is <code class="computeroutput"><span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span></code>
and must be nonnegative.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_product_f_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_product_f_l" title="mp_product&lt;F, L...&gt;"><code class="computeroutput"><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_product</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_product</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">L1</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">...&gt;,</span> <span class="identifier">L2</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">...&gt;,</span> <span class="special">...,</span>
<span class="identifier">Ln</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">...&gt;&gt;</span></code>
evaluates <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">,</span> <span class="identifier">U2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Un</span><span class="special">&gt;</span></code> for values <code class="computeroutput"><span class="identifier">Ui</span></code>
taken from the Cartesian product of the lists, as if the elements <code class="computeroutput"><span class="identifier">Ui</span></code> are formed by <code class="computeroutput"><span class="identifier">n</span></code>
nested loops, each traversing <code class="computeroutput"><span class="identifier">Li</span></code>.
It returns a list of type <code class="computeroutput"><span class="identifier">L1</span></code>
containing the results of the application of <code class="computeroutput"><span class="identifier">F</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_drop_c_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_drop_c_l_n" title="mp_drop_c&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_drop_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_drop_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_drop_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code> removes the first <code class="computeroutput"><span class="identifier">N</span></code>
elements of <code class="computeroutput"><span class="identifier">L</span></code> and returns
the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_drop_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_drop_l_n" title="mp_drop&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_drop</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_drop</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_drop_c</span></code>, but
with a type argument <code class="computeroutput"><span class="identifier">N</span></code>.
<code class="computeroutput"><span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span></code> must be a nonnegative number.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_iota_c_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_iota_c_n" title="mp_iota_c&lt;N&gt;"><code class="computeroutput"><span class="identifier">mp_iota_c</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_iota_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_iota_c</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;,</span>
<span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="number">1</span><span class="special">&gt;,</span> <span class="special">...,</span>
<span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_iota_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_iota_n" title="mp_iota&lt;N&gt;"><code class="computeroutput"><span class="identifier">mp_iota</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_iota</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_iota_c</span></code>, but
with a type argument <code class="computeroutput"><span class="identifier">N</span></code>.
<code class="computeroutput"><span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span></code> must be a nonnegative number. Returns
<code class="computeroutput"><span class="identifier">mp_list</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">0</span><span class="special">&gt;,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">1</span><span class="special">&gt;,</span>
<span class="special">...,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">integral_constant</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;&gt;</span></code>
where <code class="computeroutput"><span class="identifier">T</span></code> is the type of
<code class="computeroutput"><span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_at_c_l_i"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_at_c_l_i" title="mp_at_c&lt;L, I&gt;"><code class="computeroutput"><span class="identifier">mp_at_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_at_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_at_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">&gt;</span></code> returns the <code class="computeroutput"><span class="identifier">I</span></code>th
element of <code class="computeroutput"><span class="identifier">L</span></code>, zero-based.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_at_l_i"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_at_l_i" title="mp_at&lt;L, I&gt;"><code class="computeroutput"><span class="identifier">mp_at</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span>
<span class="identifier">I</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_at</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_at_c</span></code>, but with
a type argument <code class="computeroutput"><span class="identifier">I</span></code>. <code class="computeroutput"><span class="identifier">I</span><span class="special">::</span><span class="identifier">value</span></code>
must be a nonnegative number.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_take_c_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_take_c_l_n" title="mp_take_c&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_take_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_take_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_take_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code> returns a list of the same type as
<code class="computeroutput"><span class="identifier">L</span></code> containing the first
<code class="computeroutput"><span class="identifier">N</span></code> elements of <code class="computeroutput"><span class="identifier">L</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_take_l_n"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_take_l_n" title="mp_take&lt;L, N&gt;"><code class="computeroutput"><span class="identifier">mp_take</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_take</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_take_c</span></code>, but
with a type argument <code class="computeroutput"><span class="identifier">N</span></code>.
<code class="computeroutput"><span class="identifier">N</span><span class="special">::</span><span class="identifier">value</span></code> must be a nonnegative number.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_replace_l_v_w"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_replace_l_v_w" title="mp_replace&lt;L, V, W&gt;"><code class="computeroutput"><span class="identifier">mp_replace</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">W</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Replaces all <code class="computeroutput"><span class="identifier">V</span></code> elements
of <code class="computeroutput"><span class="identifier">L</span></code> with <code class="computeroutput"><span class="identifier">W</span></code> and returns the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_replace_if_l_p_w"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_replace_if_l_p_w" title="mp_replace_if&lt;L, P, W&gt;"><code class="computeroutput"><span class="identifier">mp_replace_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">W</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Replaces all <code class="computeroutput"><span class="identifier">T</span></code> elements
of <code class="computeroutput"><span class="identifier">L</span></code> for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> with <code class="computeroutput"><span class="identifier">W</span></code> and returns the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_replace_at_c_l_i_w"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_replace_at_c_l_i_w" title="mp_replace_at_c&lt;L, I, W&gt;"><code class="computeroutput"><span class="identifier">mp_replace_at_c</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">W</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_at_c</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Replaces the element of <code class="computeroutput"><span class="identifier">L</span></code>
at zero-based index <code class="computeroutput"><span class="identifier">I</span></code> with
<code class="computeroutput"><span class="identifier">W</span></code> and returns the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_replace_at_l_i_w"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_replace_at_l_i_w" title="mp_replace_at&lt;L, I, W&gt;"><code class="computeroutput"><span class="identifier">mp_replace_at</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">I</span><span class="special">,</span> <span class="identifier">W</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">I</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">W</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_replace_at</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Same as <code class="computeroutput"><span class="identifier">mp_replace_at_c</span></code>,
but with a type argument <code class="computeroutput"><span class="identifier">I</span></code>.
<code class="computeroutput"><span class="identifier">I</span><span class="special">::</span><span class="identifier">value</span></code> must be a nonnegative number.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_copy_if_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_copy_if_l_p" title="mp_copy_if&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_copy_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_copy_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Copies the elements <code class="computeroutput"><span class="identifier">T</span></code> of
<code class="computeroutput"><span class="identifier">L</span></code> for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> to a new list
of the same type and returns it.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_remove_l_v"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_remove_l_v" title="mp_remove&lt;L, V&gt;"><code class="computeroutput"><span class="identifier">mp_remove</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_remove</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Removes all <code class="computeroutput"><span class="identifier">V</span></code> elements
of <code class="computeroutput"><span class="identifier">L</span></code> and returns the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_remove_if_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_remove_if_l_p" title="mp_remove_if&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_remove_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_remove_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
Removes all elements <code class="computeroutput"><span class="identifier">T</span></code>
of <code class="computeroutput"><span class="identifier">L</span></code> for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> and returns
the result.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_partition_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_partition_l_p" title="mp_partition&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_partition</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_partition</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_partition</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;,</span> <span class="identifier">P</span><span class="special">&gt;</span></code>
partitions <code class="computeroutput"><span class="identifier">L</span></code> into two lists
<code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">...&gt;</span></code>
and <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U2</span><span class="special">...&gt;</span></code>
such that <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> for the elements
of <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">...&gt;</span></code>
and <code class="computeroutput"><span class="identifier">mp_false</span></code> for the elements
of <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U2</span><span class="special">...&gt;</span></code>.
Returns <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U1</span><span class="special">...&gt;,</span>
<span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">U2</span><span class="special">...&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_sort_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_sort_l_p" title="mp_sort&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_sort</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_sort</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_sort</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> sorts the list <code class="computeroutput"><span class="identifier">L</span></code>
according to the strict weak ordering <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">U</span><span class="special">&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_find_l_v"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_find_l_v" title="mp_find&lt;L, V&gt;"><code class="computeroutput"><span class="identifier">mp_find</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_find</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_find</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code>, where <code class="computeroutput"><span class="identifier">I</span></code>
is the zero-based index of the first occurence of <code class="computeroutput"><span class="identifier">V</span></code>
in <code class="computeroutput"><span class="identifier">L</span></code>. If <code class="computeroutput"><span class="identifier">L</span></code> does not contain <code class="computeroutput"><span class="identifier">V</span></code>,
<code class="computeroutput"><span class="identifier">mp_find</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_find_if_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_find_if_l_p" title="mp_find_if&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_find_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_find_if</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_find_f</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> is an alias for <code class="computeroutput"><span class="identifier">mp_size_t</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code>, where <code class="computeroutput"><span class="identifier">I</span></code>
is the zero-based index of the first element <code class="computeroutput"><span class="identifier">T</span></code>
in <code class="computeroutput"><span class="identifier">L</span></code> for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">P</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code>. If there is
no such element, <code class="computeroutput"><span class="identifier">mp_find_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_reverse_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_reverse_l" title="mp_reverse&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_reverse</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_reverse</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_reverse</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;&gt;</span></code> is <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_fold_l_v_f"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_fold_l_v_f" title="mp_fold&lt;L, V, F&gt;"><code class="computeroutput"><span class="identifier">mp_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_fold</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span>
<span class="identifier">F</span><span class="special">&lt;</span>
<span class="identifier">F</span><span class="special">&lt;</span>
<span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">,</span> <span class="identifier">T1</span><span class="special">&gt;,</span> <span class="identifier">T2</span><span class="special">&gt;,</span> <span class="special">...&gt;,</span>
<span class="identifier">Tn</span><span class="special">&gt;</span></code>,
or <code class="computeroutput"><span class="identifier">V</span></code>, if <code class="computeroutput"><span class="identifier">L</span></code> is empty.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_reverse_fold_l_v_f"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_reverse_fold_l_v_f" title="mp_reverse_fold&lt;L, V, F&gt;"><code class="computeroutput"><span class="identifier">mp_reverse_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_reverse_fold</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_reverse_fold</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">T2</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">Tn</span><span class="special">&gt;,</span> <span class="identifier">V</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T1</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T2</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&lt;...,</span> <span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">Tn</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;&gt;&gt;&gt;</span></code>,
or <code class="computeroutput"><span class="identifier">V</span></code>, if <code class="computeroutput"><span class="identifier">L</span></code> is empty.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_unique_l"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_unique_l" title="mp_unique&lt;L&gt;"><code class="computeroutput"><span class="identifier">mp_unique</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_unique</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_unique</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;</span></code>
returns a list of the same type as <code class="computeroutput"><span class="identifier">L</span></code>
with the duplicate elements removed.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_all_of_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_all_of_l_p" title="mp_all_of&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_all_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_all_of</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span> <span class="identifier">mp_count_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">==</span> <span class="identifier">mp_size</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_all_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
when <code class="computeroutput"><span class="identifier">P</span></code> holds for all elements
of <code class="computeroutput"><span class="identifier">L</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise. When <code class="computeroutput"><span class="identifier">L</span></code> is empty,
the result is <code class="computeroutput"><span class="identifier">mp_true</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_none_of_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_none_of_l_p" title="mp_none_of&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_none_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_none_of</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span> <span class="identifier">mp_count_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">==</span> <span class="number">0</span> <span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_none_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
when <code class="computeroutput"><span class="identifier">P</span></code> holds for no element
of <code class="computeroutput"><span class="identifier">L</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise. When <code class="computeroutput"><span class="identifier">L</span></code> is empty,
the result is <code class="computeroutput"><span class="identifier">mp_true</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.algorithm.mp_any_of_l_p"></a><a class="link" href="mp11.html#mp11.reference.algorithm.mp_any_of_l_p" title="mp_any_of&lt;L, P&gt;"><code class="computeroutput"><span class="identifier">mp_any_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">L</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">P</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_any_of</span> <span class="special">=</span> <span class="identifier">mp_bool</span><span class="special">&lt;</span> <span class="identifier">mp_count_if</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;::</span><span class="identifier">value</span> <span class="special">!=</span> <span class="number">0</span> <span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_any_of</span><span class="special">&lt;</span><span class="identifier">L</span><span class="special">,</span> <span class="identifier">P</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
when <code class="computeroutput"><span class="identifier">P</span></code> holds for at least
one element of <code class="computeroutput"><span class="identifier">L</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code> otherwise. When <code class="computeroutput"><span class="identifier">L</span></code> is empty, the result is <code class="computeroutput"><span class="identifier">mp_false</span></code>.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.set"></a><a class="link" href="mp11.html#mp11.reference.set" title="Set Operations, &lt;boost/mp11/set.hpp&gt;">Set Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">set</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<p>
A set is a list whose elements are unique.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.set.mp_set_contains_s_v"></a><a class="link" href="mp11.html#mp11.reference.set.mp_set_contains_s_v" title="mp_set_contains&lt;S, V&gt;"><code class="computeroutput"><span class="identifier">mp_set_contains</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">V</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_set_contains</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_set_contains</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">V</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
if the type <code class="computeroutput"><span class="identifier">V</span></code> is an element
of the set <code class="computeroutput"><span class="identifier">S</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code> otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.set.mp_set_push_back_s_t"></a><a class="link" href="mp11.html#mp11.reference.set.mp_set_push_back_s_t" title="mp_set_push_back&lt;S, T...&gt;"><code class="computeroutput"><span class="identifier">mp_set_push_back</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_set_push_back</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
For each <code class="computeroutput"><span class="identifier">T1</span></code> in <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>,
<code class="computeroutput"><span class="identifier">mp_set_push_back</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> appends <code class="computeroutput"><span class="identifier">T1</span></code>
to the end of <code class="computeroutput"><span class="identifier">S</span></code> if it's
not already an element of <code class="computeroutput"><span class="identifier">S</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.set.mp_set_push_front_s_t"></a><a class="link" href="mp11.html#mp11.reference.set.mp_set_push_front_s_t" title="mp_set_push_front&lt;S, T...&gt;"><code class="computeroutput"><span class="identifier">mp_set_push_front</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">S</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_set_push_front</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_set_push_front</span><span class="special">&lt;</span><span class="identifier">S</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> inserts at the front of <code class="computeroutput"><span class="identifier">S</span></code> those elements of <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code> for which <code class="computeroutput"><span class="identifier">S</span></code>
does not already contain the same type.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.map"></a><a class="link" href="mp11.html#mp11.reference.map" title="Map Operations, &lt;boost/mp11/map.hpp&gt;">Map Operations, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">map</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<p>
A map is a list of lists, the inner lists having at least one element (the
key.) The keys of the map must be unique.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_find_m_k"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_find_m_k" title="mp_map_find&lt;M, K&gt;"><code class="computeroutput"><span class="identifier">mp_map_find</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span>
<span class="identifier">K</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">K</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_find</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_map_find</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code> is an alias for the element of the
map <code class="computeroutput"><span class="identifier">M</span></code> with a key <code class="computeroutput"><span class="identifier">K</span></code>, or for <code class="computeroutput"><span class="keyword">void</span></code>,
if there is no such element.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_contains_m_k"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_contains_m_k" title="mp_map_contains&lt;M, K&gt;"><code class="computeroutput"><span class="identifier">mp_map_contains</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">K</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_contains</span> <span class="special">=</span> <span class="identifier">mp_not</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">is_same</span><span class="special">&lt;</span><span class="identifier">mp_map_find</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;,</span> <span class="keyword">void</span><span class="special">&gt;&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_map_contains</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>
if the map <code class="computeroutput"><span class="identifier">M</span></code> contains an
element with a key <code class="computeroutput"><span class="identifier">K</span></code>,
<code class="computeroutput"><span class="identifier">mp_false</span></code> otherwise.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_insert_m_t"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_insert_m_t" title="mp_map_insert&lt;M, T&gt;"><code class="computeroutput"><span class="identifier">mp_map_insert</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_insert</span> <span class="special">=</span> <span class="identifier">mp_if</span><span class="special">&lt;</span> <span class="identifier">mp_map_contains</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;&gt;,</span> <span class="identifier">M</span><span class="special">,</span> <span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="special">&gt;;</span>
</pre>
<p>
Inserts the element <code class="computeroutput"><span class="identifier">T</span></code> into
the map <code class="computeroutput"><span class="identifier">M</span></code>, if an element
with a key <code class="computeroutput"><span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>
is not already in <code class="computeroutput"><span class="identifier">M</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_replace_m_t"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_replace_m_t" title="mp_map_replace&lt;M, T&gt;"><code class="computeroutput"><span class="identifier">mp_map_replace</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_replace</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
If the map <code class="computeroutput"><span class="identifier">M</span></code> does not contain
an element with a key <code class="computeroutput"><span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>, inserts it (using <code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code>);
otherwise, replaces the existing element with <code class="computeroutput"><span class="identifier">T</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_update_m_t_f"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_update_m_t_f" title="mp_map_update&lt;M, T, F&gt;"><code class="computeroutput"><span class="identifier">mp_map_update</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_update</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
If the map <code class="computeroutput"><span class="identifier">M</span></code> does not contain
an element with a key <code class="computeroutput"><span class="identifier">mp_first</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">&gt;</span></code>, inserts it (using <code class="computeroutput"><span class="identifier">mp_push_back</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">T</span><span class="special">&gt;</span></code>);
otherwise, replaces the existing element <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">,</span> <span class="identifier">Y</span><span class="special">...&gt;</span></code>
with <code class="computeroutput"><span class="identifier">L</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">X</span><span class="special">,</span> <span class="identifier">Y</span><span class="special">...&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.map.mp_map_erase_m_k"></a><a class="link" href="mp11.html#mp11.reference.map.mp_map_erase_m_k" title="mp_map_erase&lt;M, K&gt;"><code class="computeroutput"><span class="identifier">mp_map_erase</span><span class="special">&lt;</span><span class="identifier">M</span><span class="special">,</span> <span class="identifier">K</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">M</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">K</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_map_erase</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
If the map <code class="computeroutput"><span class="identifier">M</span></code> contains an
element with a key <code class="computeroutput"><span class="identifier">K</span></code>, removes
it.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.function"></a><a class="link" href="mp11.html#mp11.reference.function" title="Helper Metafunctions, &lt;boost/mp11/function.hpp&gt;">Helper Metafunctions, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">function</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.function.mp_and_t"></a><a class="link" href="mp11.html#mp11.reference.function.mp_and_t" title="mp_and&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_and</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_and</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_and</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is an alias for the first type <code class="computeroutput"><span class="identifier">U</span></code>
in <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>
for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_false</span></code>. If no such
type exists, the last one is returned. <code class="computeroutput"><span class="identifier">mp_and</span><span class="special">&lt;&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_true</span></code>.
Similar to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">conjunction</span></code> in C++17.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.function.mp_all_t"></a><a class="link" href="mp11.html#mp11.reference.function.mp_all_t" title="mp_all&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_all</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_all</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_all</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> if <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> for all types
<code class="computeroutput"><span class="identifier">U</span></code> in <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise. Same as <code class="computeroutput"><span class="identifier">mp_and</span></code>,
but does not perform short-circuit evaluation. <code class="computeroutput"><span class="identifier">mp_and</span><span class="special">&lt;</span><span class="identifier">mp_false</span><span class="special">,</span> <span class="keyword">void</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_false</span></code>, but <code class="computeroutput"><span class="identifier">mp_all</span><span class="special">&lt;</span><span class="identifier">mp_false</span><span class="special">,</span> <span class="keyword">void</span><span class="special">&gt;</span></code>
is an error because <code class="computeroutput"><span class="keyword">void</span></code> does
not have a nested <code class="computeroutput"><span class="identifier">value</span></code>.
The upside is that <code class="computeroutput"><span class="identifier">mp_all</span></code>
is faster.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.function.mp_or_t"></a><a class="link" href="mp11.html#mp11.reference.function.mp_or_t" title="mp_or&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_or</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_or</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_or</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is an alias for the first type <code class="computeroutput"><span class="identifier">U</span></code>
in <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>
for which <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code>. If no such
type exists, the last one is returned. <code class="computeroutput"><span class="identifier">mp_or</span><span class="special">&lt;&gt;</span></code> is <code class="computeroutput"><span class="identifier">mp_false</span></code>.
Similar to <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">disjunction</span></code> in C++17.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.function.mp_any_t"></a><a class="link" href="mp11.html#mp11.reference.function.mp_any_t" title="mp_any&lt;T...&gt;"><code class="computeroutput"><span class="identifier">mp_any</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_any</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_any</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> if <code class="computeroutput"><span class="identifier">mp_to_bool</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">mp_true</span></code> for any type
<code class="computeroutput"><span class="identifier">U</span></code> in <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>, <code class="computeroutput"><span class="identifier">mp_false</span></code>
otherwise. Same as <code class="computeroutput"><span class="identifier">mp_or</span></code>,
but does not perform short-circuit evaluation.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.bind"></a><a class="link" href="mp11.html#mp11.reference.bind" title="Bind, &lt;boost/mp11/bind.hpp&gt;">Bind, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">mp11</span><span class="special">/</span><span class="identifier">bind</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_arg_i"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_arg_i" title="mp_arg&lt;I&gt;"><code class="computeroutput"><span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_arg</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">&gt;</span></code>
is a quoted metafunction whose nested template <code class="computeroutput"><span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code> returns the <code class="computeroutput"><span class="identifier">I</span></code>-th
zero-based element of <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.1_9"></a><a class="link" href="mp11.html#mp11.reference.bind.1_9" title="_1, ..., _9"><code class="computeroutput"><span class="identifier">_1</span></code>,
..., <code class="computeroutput"><span class="identifier">_9</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">using</span> <span class="identifier">_1</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">0</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_2</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">1</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_3</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">2</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_4</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">3</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_5</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">4</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_6</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">5</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_7</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">6</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_8</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">7</span><span class="special">&gt;;</span>
<span class="keyword">using</span> <span class="identifier">_9</span> <span class="special">=</span> <span class="identifier">mp_arg</span><span class="special">&lt;</span><span class="number">8</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">_1</span></code> to <code class="computeroutput"><span class="identifier">_9</span></code>
are placeholder types, the equivalent to the placeholders of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_f_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_f_t" title="mp_bind&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_bind</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> is a quoted metafunction that implements
the type-based equivalent of <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">bind</span></code>.
Its nested template <code class="computeroutput"><span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code> returns <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">V</span><span class="special">...&gt;</span></code>, where <code class="computeroutput"><span class="identifier">V</span><span class="special">...</span></code> is <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code> with the placeholders replaced by the
corresponding element of <code class="computeroutput"><span class="identifier">U</span><span class="special">...</span></code> and the <code class="computeroutput"><span class="identifier">mp_bind</span></code>
expressions replaced with their corresponding evaluations against <code class="computeroutput"><span class="identifier">U</span><span class="special">...</span></code>.
</p>
<p>
For example, <code class="computeroutput"><span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="keyword">int</span><span class="special">,</span> <span class="identifier">_2</span><span class="special">,</span> <span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">G</span><span class="special">,</span> <span class="identifier">_1</span><span class="special">&gt;&gt;::</span><span class="identifier">fn</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">,</span> <span class="keyword">void</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="keyword">int</span><span class="special">,</span> <span class="keyword">void</span><span class="special">,</span> <span class="identifier">G</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">&gt;&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_q_q_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_q_q_t" title="mp_bind_q&lt;Q, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span>
<span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_bind_q</span> <span class="special">=</span> <span class="identifier">mp_bind</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;;</span>
</pre>
<p>
As <code class="computeroutput"><span class="identifier">mp_bind</span></code>, but takes a
quoted metafunction.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_front_f_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_front_f_t" title="mp_bind_front&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind_front</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_bind_front</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_bind_front</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> binds the leftmost arguments of
<code class="computeroutput"><span class="identifier">F</span></code> to <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>. Its nested template <code class="computeroutput"><span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code> returns <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...,</span> <span class="identifier">U</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_front_q_q_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_front_q_q_t" title="mp_bind_front_q&lt;Q, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind_front_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_bind_front_q</span> <span class="special">=</span> <span class="identifier">mp_bind_front</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;;</span>
</pre>
<p>
As <code class="computeroutput"><span class="identifier">mp_bind_front</span></code>, but takes
a quoted metafunction.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_back_f_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_back_f_t" title="mp_bind_back&lt;F, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind_back</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...&gt;</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">mp_bind_back</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">mp_bind_back</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code> binds the rightmost arguments of
<code class="computeroutput"><span class="identifier">F</span></code> to <code class="computeroutput"><span class="identifier">T</span><span class="special">...</span></code>. Its nested template <code class="computeroutput"><span class="identifier">fn</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...&gt;</span></code> returns <code class="computeroutput"><span class="identifier">F</span><span class="special">&lt;</span><span class="identifier">U</span><span class="special">...,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.bind.mp_bind_back_q_q_t"></a><a class="link" href="mp11.html#mp11.reference.bind.mp_bind_back_q_q_t" title="mp_bind_back_q&lt;Q, T...&gt;"><code class="computeroutput"><span class="identifier">mp_bind_back_q</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Q</span><span class="special">,</span> <span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">mp_bind_back_q</span> <span class="special">=</span> <span class="identifier">mp_bind_back</span><span class="special">&lt;</span><span class="identifier">Q</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">fn</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...&gt;;</span>
</pre>
<p>
As <code class="computeroutput"><span class="identifier">mp_bind_back</span></code>, but takes
a quoted metafunction.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.integer_sequence"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence" title="Integer Sequences, &lt;boost/integer_sequence.hpp&gt;">Integer Sequences,
<code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">integer_sequence</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<p>
The contents of this header are defined in namespace <code class="computeroutput"><span class="identifier">boost</span></code>.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integer_sequence.integer_sequence_t_i"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence.integer_sequence_t_i" title="integer_sequence&lt;T, I...&gt;"><code class="computeroutput"><span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">I</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span><span class="special">...</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">struct</span> <span class="identifier">integer_sequence</span>
<span class="special">{</span>
<span class="special">};</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">I</span><span class="special">...&gt;</span></code> holds a sequence of integers of
type <code class="computeroutput"><span class="identifier">T</span></code>. Same as C++14's
<code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">integer_sequence</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integer_sequence.make_integer_sequence_t_n"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence.make_integer_sequence_t_n" title="make_integer_sequence&lt;T, N&gt;"><code class="computeroutput"><span class="identifier">make_integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">T</span><span class="special">,</span> <span class="identifier">T</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">make_integer_sequence</span> <span class="special">=</span> <span class="comment">/*...*/</span><span class="special">;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">make_integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;</span></code> is <code class="computeroutput"><span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">,</span> <span class="number">0</span><span class="special">,</span>
<span class="number">1</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">N</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span></code>.
Same as C++14's <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_integer_sequence</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integer_sequence.index_sequence_i"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence.index_sequence_i" title="index_sequence&lt;I...&gt;"><code class="computeroutput"><span class="identifier">index_sequence</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">...</span> <span class="identifier">I</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">index_sequence</span> <span class="special">=</span> <span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">I</span><span class="special">...&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">index_sequence</span><span class="special">&lt;</span><span class="identifier">I</span><span class="special">...&gt;</span></code>
is an alias for <code class="computeroutput"><span class="identifier">integer_sequence</span><span class="special">&lt;</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">I</span><span class="special">...&gt;</span></code>.
Same as C++14's <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">index_sequence</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integer_sequence.make_index_sequence_n"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence.make_index_sequence_n" title="make_index_sequence&lt;N&gt;"><code class="computeroutput"><span class="identifier">make_index_sequence</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <span class="identifier">N</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">make_index_sequence</span> <span class="special">=</span> <span class="identifier">make_integer_sequence</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">make_index_sequence</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">index_sequence</span><span class="special">&lt;</span><span class="number">0</span><span class="special">,</span> <span class="number">1</span><span class="special">,</span> <span class="special">...,</span> <span class="identifier">N</span><span class="special">-</span><span class="number">1</span><span class="special">&gt;</span></code>. Same as C++14's <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">make_index_sequence</span></code>.
</p>
</div>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.integer_sequence.index_sequence_for_t"></a><a class="link" href="mp11.html#mp11.reference.integer_sequence.index_sequence_for_t" title="index_sequence_for&lt;T...&gt;"><code class="computeroutput"><span class="identifier">index_sequence_for</span><span class="special">&lt;</span><span class="identifier">T</span><span class="special">...&gt;</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span><span class="special">...</span> <span class="identifier">T</span><span class="special">&gt;</span> <span class="keyword">using</span> <span class="identifier">index_sequence_for</span> <span class="special">=</span> <span class="identifier">make_integer_sequence</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span><span class="special">,</span> <span class="keyword">sizeof</span><span class="special">...(</span><span class="identifier">T</span><span class="special">)&gt;;</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">index_sequence_for</span><span class="special">&lt;</span><span class="identifier">N</span><span class="special">&gt;</span></code>
is <code class="computeroutput"><span class="identifier">make_index_sequence</span><span class="special">&lt;</span><span class="keyword">sizeof</span><span class="special">...(</span><span class="identifier">T</span><span class="special">)&gt;</span></code>. Same as C++14's <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">index_sequence_for</span></code>.
</p>
</div>
</div>
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="mp11.reference.tuple_for_each"></a><a class="link" href="mp11.html#mp11.reference.tuple_for_each" title='A "for each" algorithm for tuple-like types, &lt;boost/tuple_for_each.hpp&gt;'>A "for each"
algorithm for tuple-like types, <code class="computeroutput"><span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">tuple_for_each</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span></code></a>
</h3></div></div></div>
<p>
The contents of this header are defined in namespace <code class="computeroutput"><span class="identifier">boost</span></code>.
</p>
<div class="section">
<div class="titlepage"><div><div><h4 class="title">
<a name="mp11.reference.tuple_for_each.tuple_for_each"></a><a class="link" href="mp11.html#mp11.reference.tuple_for_each.tuple_for_each" title="tuple_for_each"><code class="computeroutput"><span class="identifier">tuple_for_each</span></code></a>
</h4></div></div></div>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">class</span> <span class="identifier">Tp</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">F</span><span class="special">&gt;</span> <span class="keyword">constexpr</span> <span class="identifier">F</span> <span class="identifier">tuple_for_each</span><span class="special">(</span><span class="identifier">Tp</span><span class="special">&amp;&amp;</span> <span class="identifier">tp</span><span class="special">,</span> <span class="identifier">F</span><span class="special">&amp;&amp;</span> <span class="identifier">f</span><span class="special">);</span>
</pre>
<p>
<code class="computeroutput"><span class="identifier">tuple_for_each</span><span class="special">(</span><span class="identifier">tp</span><span class="special">,</span> <span class="identifier">f</span><span class="special">)</span></code> applies
the function object <code class="computeroutput"><span class="identifier">f</span></code> to
each element of <code class="computeroutput"><span class="identifier">tp</span></code> by evaluating
the expression <code class="computeroutput"><span class="identifier">f</span><span class="special">(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">get</span><span class="special">&lt;</span><span class="identifier">J</span><span class="special">&gt;(</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">Tp</span><span class="special">&gt;(</span><span class="identifier">tp</span><span class="special">)))</span></code>
for <code class="computeroutput"><span class="identifier">J</span></code> in 0..<code class="computeroutput"><span class="identifier">N</span><span class="special">-</span><span class="number">1</span></code>,
where <code class="computeroutput"><span class="identifier">N</span></code> is <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">tuple_size</span><span class="special">&lt;</span><span class="identifier">std</span><span class="special">::</span><span class="identifier">remove_reference_t</span><span class="special">&lt;</span><span class="identifier">Tp</span><span class="special">&gt;&gt;::</span><span class="identifier">value</span></code>.
</p>
<p>
Returns <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">forward</span><span class="special">&lt;</span><span class="identifier">F</span><span class="special">&gt;(</span><span class="identifier">f</span><span class="special">)</span></code>.
</p>
</div>
</div>
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"><p><small>Last revised: May 10, 2017 at 20:23:11 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
<div class="spirit-nav"></div>
</body>
</html>