<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML header for doxygen 1.8.9.1-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Boost.Hana: boost::hana::map&lt; Pairs &gt; Struct Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
// Copyright Louis Dionne 2013-2017
// Distributed under the Boost Software License, Version 1.0.
// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
MathJax.Hub.Config({
    "HTML-CSS": {
        linebreaks: {
            automatic: true,
            width: "75% container"
        }
    }
});
</script><script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<!-- Additional javascript for drawing charts. -->
<script type="text/javascript" src="highcharts.js"></script>
<script type="text/javascript" src="highcharts-data.js"></script>
<script type="text/javascript" src="highcharts-exporting.js"></script>
<script type="text/javascript" src="chart.js"></script>
<script type="text/javascript" src="hana.js"></script>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="Boost.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">Boost.Hana
   &#160;<span id="projectnumber">1.3.0</span>
   </div>
   <div id="projectbrief">Your standard library for metaprogramming</div>
  </td>
   <td>        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
</td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('structboost_1_1hana_1_1map.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#related">Synopsis of associated functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="structboost_1_1hana_1_1map-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">boost::hana::map&lt; Pairs &gt; Struct Template Reference<div class="ingroups"><a class="el" href="group__group-datatypes.html">Data types</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Description</h2>
<div class="textblock"><h3>template&lt;typename... Pairs&gt;<br />
struct boost::hana::map&lt; Pairs &gt;</h3>

<p>Basic associative container requiring unique, <code>Comparable</code> and <code>Hashable</code> keys. </p>
<p>The order of the elements of the map is unspecified. Also, all the keys must be <code>Hashable</code>, and any two keys with equal hashes must be <code>Comparable</code> with each other at compile-time.</p>
<p>Note that the actual representation of a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code> is an implementation detail. As such, one should not assume anything more than what is explicitly documented as being part of the interface of a map, such as:</p><ul>
<li>the presence of additional constructors</li>
<li>the presence of additional assignment operators</li>
<li>the fact that <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a>&lt;Pairs...&gt;</code> is, or is not, a dependent type</li>
</ul>
<p>In particular, the last point is very important; <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a>&lt;Pairs...&gt;</code> is basically equivalent to </p><div class="fragment"><div class="line">decltype(hana::make_pair(std::declval&lt;Pairs&gt;()...))</div></div><!-- fragment --><p> which is not something that can be pattern-matched on during template argument deduction, for example.</p>
<h2>Modeled concepts </h2>
<ol type="1">
<li><code>Comparable</code><br />
Two maps are equal iff all their keys are equal and are associated to equal values. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::char_c&lt;&#39;a&#39;&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;int&amp;&amp;&gt;, <span class="keyword">nullptr</span>)</div><div class="line">        )</div><div class="line">        ==</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::type_c&lt;int&amp;&amp;&gt;, (<span class="keywordtype">void</span>*)0),</div><div class="line">            hana::make_pair(hana::char_c&lt;&#39;a&#39;&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s)</div><div class="line">        )</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --></li>
<li><code>Searchable</code><br />
A map can be searched by its keys with a predicate yielding a compile-time <code>Logical</code>. Also note that <code>operator[]</code> can be used instead of <code>at_key</code>. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="at__key_8hpp.html">boost/hana/at_key.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="find_8hpp.html">boost/hana/find.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="optional_8hpp.html">boost/hana/optional.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, <span class="charliteral">&#39;i&#39;</span>),</div><div class="line">    hana::make_pair(hana::type_c&lt;float&gt;, <span class="charliteral">&#39;f&#39;</span>)</div><div class="line">);</div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(m, hana::type_c&lt;int&gt;) == hana::just(<span class="charliteral">&#39;i&#39;</span>), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line">static_assert(<a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(m, hana::type_c&lt;float&gt;) == hana::just(<span class="charliteral">&#39;f&#39;</span>), <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(m, hana::type_c&lt;void&gt;) == hana::nothing);</div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(<a class="code" href="group__group-Searchable.html#ga6b6cdd69942b0fe3bf5254247f9c861e">hana::find</a>(m, hana::int_c&lt;3&gt;) == hana::nothing);</div><div class="line"></div><div class="line"><span class="comment">// operator[] is equivalent to at_key</span></div><div class="line">static_assert(m[hana::type_c&lt;int&gt;] == <span class="charliteral">&#39;i&#39;</span>, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line">static_assert(m[hana::type_c&lt;float&gt;] == <span class="charliteral">&#39;f&#39;</span>, <span class="stringliteral">&quot;&quot;</span>);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --></li>
<li><code>Foldable</code><br />
Folding a map is equivalent to folding a list of the key/value pairs it contains. In particular, since that list is not guaranteed to be in any specific order, folding a map with an operation that is not both commutative and associative will yield non-deterministic behavior. <div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="first_8hpp.html">boost/hana/first.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="fold__left_8hpp.html">boost/hana/fold_left.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="insert_8hpp.html">boost/hana/insert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="second_8hpp.html">boost/hana/second.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="comment">// Given a map of (key, value) pairs, returns a map of (value, key) pairs.</span></div><div class="line">    <span class="comment">// This requires both the keys and the values to be compile-time Comparable.</span></div><div class="line">    <span class="keyword">auto</span> invert = [](<span class="keyword">auto</span> <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>) {</div><div class="line">        <span class="keywordflow">return</span> <a class="code" href="group__group-Foldable.html#ga38c6b3f6b1cbadb9b8432a05ff16b7d2">hana::fold_left</a>(<a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>, hana::make_map(), [](<span class="keyword">auto</span> <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>, <span class="keyword">auto</span> pair) {</div><div class="line">            <span class="keywordflow">return</span> <a class="code" href="group__group-Sequence.html#gae22a1a184b1b2dd550fa4fa619bed2e9">hana::insert</a>(<a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>, hana::make_pair(<a class="code" href="group__group-Product.html#ga7bb979d59ffc3ab862cb7d9dc7730077">hana::second</a>(pair), <a class="code" href="group__group-Product.html#ga34bbf4281de06dc3540441e8b2bd24f4">hana::first</a>(pair)));</div><div class="line">        });</div><div class="line">    };</div><div class="line"></div><div class="line">    <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">        hana::make_pair(hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;),</div><div class="line">        hana::make_pair(hana::type_c&lt;float&gt;, hana::int_c&lt;2&gt;),</div><div class="line">        hana::make_pair(hana::int_c&lt;3&gt;, hana::type_c&lt;void&gt;)</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(invert(m) ==</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::int_c&lt;1&gt;, hana::type_c&lt;int&gt;),</div><div class="line">            hana::make_pair(hana::int_c&lt;2&gt;, hana::type_c&lt;float&gt;),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, hana::int_c&lt;3&gt;)</div><div class="line">        )</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --></li>
</ol>
<h2>Conversion from any <code>Foldable</code> </h2>
<p>Any <code>Foldable</code> of <code>Product</code>s can be converted to a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code> with <code><a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e" title="Converts an object from one data type to another. ">hana::to</a>&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">hana::map_tag</a>&gt;</code> or, equivalently, <code>hana::to_map</code>. If the <code>Foldable</code> contains duplicate keys, only the value associated to the first occurence of each key is kept. </p><div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2to_8hpp.html">boost/hana/core/to.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> xs = hana::make_tuple(</div><div class="line">        hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">        hana::make_pair(hana::type_c&lt;void&gt;, 1234),</div><div class="line">        hana::make_pair(hana::type_c&lt;int&gt;, <span class="keyword">nullptr</span>)</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::to&lt;hana::map_tag&gt;(xs) == hana::make_map(</div><div class="line">            hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --><h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="at__key_8hpp.html">boost/hana/at_key.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;functional&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;vector&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> ...Events&gt;</div><div class="line"><span class="keyword">struct </span>event_system {</div><div class="line">    <span class="keyword">using</span> Callback = std::function&lt;void()&gt;;</div><div class="line">    hana::map&lt;hana::pair&lt;Events, std::vector&lt;Callback&gt;&gt;...&gt; map_;</div><div class="line"></div><div class="line">    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Event, <span class="keyword">typename</span> F&gt;</div><div class="line">    <span class="keywordtype">void</span> <a class="code" href="group__group-functional.html#ga35c4fc3c5677b9f558150b90e74d3ab1">on</a>(Event e, F handler) {</div><div class="line">        <span class="keyword">auto</span> is_known_event = <a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>(map_, e);</div><div class="line">        static_assert(is_known_event,</div><div class="line">            <span class="stringliteral">&quot;trying to add a handler to an unknown event&quot;</span>);</div><div class="line"></div><div class="line">        map_[e].push_back(handler);</div><div class="line">    }</div><div class="line"></div><div class="line">    <span class="keyword">template</span> &lt;<span class="keyword">typename</span> Event&gt;</div><div class="line">    <span class="keywordtype">void</span> trigger(Event e)<span class="keyword"> const </span>{</div><div class="line">        <span class="keyword">auto</span> is_known_event = <a class="code" href="group__group-Searchable.html#ga38e7748956cbc9f3d9bb035ac8577906">hana::contains</a>(map_, e);</div><div class="line">        static_assert(is_known_event,</div><div class="line">            <span class="stringliteral">&quot;trying to trigger an unknown event&quot;</span>);</div><div class="line"></div><div class="line">        <span class="keywordflow">for</span> (<span class="keyword">auto</span>&amp; handler : this-&gt;map_[e])</div><div class="line">            handler();</div><div class="line">    }</div><div class="line">};</div><div class="line"></div><div class="line"><span class="keyword">template</span> &lt;<span class="keyword">typename</span> ...Events&gt;</div><div class="line">event_system&lt;Events...&gt; make_event_system(Events ...events) {</div><div class="line">    <span class="keywordflow">return</span> {};</div><div class="line">}</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> events = make_event_system(</div><div class="line">        BOOST_HANA_STRING(<span class="stringliteral">&quot;foo&quot;</span>),</div><div class="line">        BOOST_HANA_STRING(<span class="stringliteral">&quot;bar&quot;</span>),</div><div class="line">        BOOST_HANA_STRING(<span class="stringliteral">&quot;baz&quot;</span>)</div><div class="line">    );</div><div class="line"></div><div class="line">    std::vector&lt;std::string&gt; triggered_events;</div><div class="line">    events.on(BOOST_HANA_STRING(<span class="stringliteral">&quot;foo&quot;</span>), [&amp;] {</div><div class="line">        triggered_events.push_back(<span class="stringliteral">&quot;foo:1&quot;</span>);</div><div class="line">    });</div><div class="line">    events.on(BOOST_HANA_STRING(<span class="stringliteral">&quot;foo&quot;</span>), [&amp;] {</div><div class="line">        triggered_events.push_back(<span class="stringliteral">&quot;foo:2&quot;</span>);</div><div class="line">    });</div><div class="line">    events.on(BOOST_HANA_STRING(<span class="stringliteral">&quot;bar&quot;</span>), [&amp;] {</div><div class="line">        triggered_events.push_back(<span class="stringliteral">&quot;bar:1&quot;</span>);</div><div class="line">    });</div><div class="line">    events.on(BOOST_HANA_STRING(<span class="stringliteral">&quot;baz&quot;</span>), [&amp;] {</div><div class="line">        triggered_events.push_back(<span class="stringliteral">&quot;baz:1&quot;</span>);</div><div class="line">    });</div><div class="line"></div><div class="line">    events.trigger(BOOST_HANA_STRING(<span class="stringliteral">&quot;foo&quot;</span>));</div><div class="line">    events.trigger(BOOST_HANA_STRING(<span class="stringliteral">&quot;bar&quot;</span>));</div><div class="line">    events.trigger(BOOST_HANA_STRING(<span class="stringliteral">&quot;baz&quot;</span>));</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(triggered_events == std::vector&lt;std::string&gt;{</div><div class="line">        <span class="stringliteral">&quot;foo:1&quot;</span>, <span class="stringliteral">&quot;foo:2&quot;</span>, <span class="stringliteral">&quot;bar:1&quot;</span>, <span class="stringliteral">&quot;baz:1&quot;</span></div><div class="line">    });</div><div class="line">}</div></div><!-- fragment --> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
Synopsis of associated functions</h2></td></tr>
<tr class="memitem:a409d52de54cc7e55eca1a7b5dda4ce30"><td class="memTemplParams" colspan="2">template&lt;&gt; </td></tr>
<tr class="memitem:a409d52de54cc7e55eca1a7b5dda4ce30"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a409d52de54cc7e55eca1a7b5dda4ce30">make&lt; map_tag &gt;</a></td></tr>
<tr class="memdesc:a409d52de54cc7e55eca1a7b5dda4ce30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Function object for creating a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code>.  <a href="#a409d52de54cc7e55eca1a7b5dda4ce30">More...</a><br /></td></tr>
<tr class="separator:a409d52de54cc7e55eca1a7b5dda4ce30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae73cf43ee56352e4c25984b0fe3c3d04"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#ae73cf43ee56352e4c25984b0fe3c3d04">make_map</a> = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html">map_tag</a>&gt;</td></tr>
<tr class="memdesc:ae73cf43ee56352e4c25984b0fe3c3d04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code>; provided for convenience.  <a href="#ae73cf43ee56352e4c25984b0fe3c3d04">More...</a><br /></td></tr>
<tr class="separator:ae73cf43ee56352e4c25984b0fe3c3d04"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4feb32bd0a065a0732908716d4855b57"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a4feb32bd0a065a0732908716d4855b57">to_map</a> = <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html">map_tag</a>&gt;</td></tr>
<tr class="memdesc:a4feb32bd0a065a0732908716d4855b57"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code>to&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code>; provided for convenience.  <a href="#a4feb32bd0a065a0732908716d4855b57">More...</a><br /></td></tr>
<tr class="separator:a4feb32bd0a065a0732908716d4855b57"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0f32260f859b2510dd16235b7bc011ac"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a0f32260f859b2510dd16235b7bc011ac">keys</a></td></tr>
<tr class="memdesc:a0f32260f859b2510dd16235b7bc011ac"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <code>Sequence</code> of the keys of the map, in unspecified order.  <a href="#a0f32260f859b2510dd16235b7bc011ac">More...</a><br /></td></tr>
<tr class="separator:a0f32260f859b2510dd16235b7bc011ac"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2e016a68e3ec6eb25868fadb7ce80132"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a2e016a68e3ec6eb25868fadb7ce80132">values</a></td></tr>
<tr class="memdesc:a2e016a68e3ec6eb25868fadb7ce80132"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns a <code>Sequence</code> of the values of the map, in unspecified order.  <a href="#a2e016a68e3ec6eb25868fadb7ce80132">More...</a><br /></td></tr>
<tr class="separator:a2e016a68e3ec6eb25868fadb7ce80132"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5791e6dc0e27d8e3a113e4d94482550f"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a5791e6dc0e27d8e3a113e4d94482550f">insert</a></td></tr>
<tr class="memdesc:a5791e6dc0e27d8e3a113e4d94482550f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Inserts a new key/value pair in a map.  <a href="#a5791e6dc0e27d8e3a113e4d94482550f">More...</a><br /></td></tr>
<tr class="separator:a5791e6dc0e27d8e3a113e4d94482550f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af856f7bf77f69cdf1b8fd4e566eaef9b"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#af856f7bf77f69cdf1b8fd4e566eaef9b">erase_key</a></td></tr>
<tr class="memdesc:af856f7bf77f69cdf1b8fd4e566eaef9b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes a key/value pair from a map.  <a href="#af856f7bf77f69cdf1b8fd4e566eaef9b">More...</a><br /></td></tr>
<tr class="separator:af856f7bf77f69cdf1b8fd4e566eaef9b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd511f2c01f38405bfba0b6d5b2922e8"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#acd511f2c01f38405bfba0b6d5b2922e8">union_</a></td></tr>
<tr class="memdesc:acd511f2c01f38405bfba0b6d5b2922e8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the union of two maps.  <a href="#acd511f2c01f38405bfba0b6d5b2922e8">More...</a><br /></td></tr>
<tr class="separator:acd511f2c01f38405bfba0b6d5b2922e8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3b3430482d4e88052e621f63a234f3eb"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a3b3430482d4e88052e621f63a234f3eb">intersection</a></td></tr>
<tr class="memdesc:a3b3430482d4e88052e621f63a234f3eb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the intersection of two maps.  <a href="#a3b3430482d4e88052e621f63a234f3eb">More...</a><br /></td></tr>
<tr class="separator:a3b3430482d4e88052e621f63a234f3eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a718ddfe86437adbbca1e1a5db651d139"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a718ddfe86437adbbca1e1a5db651d139">difference</a></td></tr>
<tr class="memdesc:a718ddfe86437adbbca1e1a5db651d139"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the difference of two maps.  <a href="#a718ddfe86437adbbca1e1a5db651d139">More...</a><br /></td></tr>
<tr class="separator:a718ddfe86437adbbca1e1a5db651d139"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8bcb2455eb9f7074185d8fb61a99801e"><td class="memItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a8bcb2455eb9f7074185d8fb61a99801e">symmetric_difference</a></td></tr>
<tr class="memdesc:a8bcb2455eb9f7074185d8fb61a99801e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the symmetric set-theoretic difference of two maps.  <a href="#a8bcb2455eb9f7074185d8fb61a99801e">More...</a><br /></td></tr>
<tr class="separator:a8bcb2455eb9f7074185d8fb61a99801e"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplParams" colspan="2"><a class="anchor" id="a27607958295e6da8a0ba602a2db468f1"></a>
template&lt;typename X , typename Y &gt; </td></tr>
<tr class="memitem:a27607958295e6da8a0ba602a2db468f1"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a27607958295e6da8a0ba602a2db468f1">operator==</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
<tr class="memdesc:a27607958295e6da8a0ba602a2db468f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gacaf1ebea6b3ab96ac9dcb82f0e64e547" title="Returns a Logical representing whether x is equal to y.The equal function can be called in two differ...">hana::equal</a></code> <br /></td></tr>
<tr class="separator:a27607958295e6da8a0ba602a2db468f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplParams" colspan="2"><a class="anchor" id="a0cae3af55edb3eb05bfa184bda633f7d"></a>
template&lt;typename X , typename Y &gt; </td></tr>
<tr class="memitem:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memTemplItemLeft" align="right" valign="top">constexpr auto&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a0cae3af55edb3eb05bfa184bda633f7d">operator!=</a> (X &amp;&amp;x, Y &amp;&amp;y)</td></tr>
<tr class="memdesc:a0cae3af55edb3eb05bfa184bda633f7d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Comparable.html#gae33be2e0d5e04f19082f4b7740dfc9cd" title="Returns a Logical representing whether x is not equal to y.The not_equal function can be called in tw...">hana::not_equal</a></code> <br /></td></tr>
<tr class="separator:a0cae3af55edb3eb05bfa184bda633f7d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a1ee432be0bd10f08a637a437e311e4e2"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1ee432be0bd10f08a637a437e311e4e2"></a>
constexpr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a> ()=default</td></tr>
<tr class="memdesc:a1ee432be0bd10f08a637a437e311e4e2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default-construct a map. This constructor only exists when all the elements of the map are default-constructible. <br /></td></tr>
<tr class="separator:a1ee432be0bd10f08a637a437e311e4e2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a943219d1c9692938167639d8ad2525b8"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a943219d1c9692938167639d8ad2525b8"></a>
constexpr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a943219d1c9692938167639d8ad2525b8">map</a> (<a class="el" href="structboost_1_1hana_1_1map.html">map</a> const &amp;other)=default</td></tr>
<tr class="memdesc:a943219d1c9692938167639d8ad2525b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">Copy-construct a map from another map. This constructor only exists when all the elements of the map are copy-constructible. <br /></td></tr>
<tr class="separator:a943219d1c9692938167639d8ad2525b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a675bb30af155b40f72cbe8607eefbe4e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a675bb30af155b40f72cbe8607eefbe4e"></a>
constexpr&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a675bb30af155b40f72cbe8607eefbe4e">map</a> (<a class="el" href="structboost_1_1hana_1_1map.html">map</a> &amp;&amp;other)=default</td></tr>
<tr class="memdesc:a675bb30af155b40f72cbe8607eefbe4e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move-construct a map from another map. This constructor only exists when all the elements of the map are move-constructible. <br /></td></tr>
<tr class="separator:a675bb30af155b40f72cbe8607eefbe4e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4a4f472e036abf9bcbda81e831f46e32"><td class="memTemplParams" colspan="2"><a class="anchor" id="a4a4f472e036abf9bcbda81e831f46e32"></a>
template&lt;typename... P&gt; </td></tr>
<tr class="memitem:a4a4f472e036abf9bcbda81e831f46e32"><td class="memTemplItemLeft" align="right" valign="top">constexpr&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a4a4f472e036abf9bcbda81e831f46e32">map</a> (P &amp;&amp;...pairs)</td></tr>
<tr class="memdesc:a4a4f472e036abf9bcbda81e831f46e32"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct the map from the provided pairs. <code>P...</code> must be pairs of the same type (modulo ref and cv-qualifiers), and in the same order, as those appearing in <code>Pairs...</code>. The pairs provided to this constructor are emplaced into the map's storage using perfect forwarding. <br /></td></tr>
<tr class="separator:a4a4f472e036abf9bcbda81e831f46e32"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae18123925b628b5cfcb1adaef5c83ac7"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ae18123925b628b5cfcb1adaef5c83ac7"></a>
constexpr <a class="el" href="structboost_1_1hana_1_1map.html">map</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#ae18123925b628b5cfcb1adaef5c83ac7">operator=</a> (<a class="el" href="structboost_1_1hana_1_1map.html">map</a> const &amp;other)</td></tr>
<tr class="memdesc:ae18123925b628b5cfcb1adaef5c83ac7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Assign a map to another map <b>with the exact same type</b>. Only exists when all the elements of the map are copy-assignable. <br /></td></tr>
<tr class="separator:ae18123925b628b5cfcb1adaef5c83ac7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a6635ea36edc582518d278238defa0d"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9a6635ea36edc582518d278238defa0d"></a>
constexpr <a class="el" href="structboost_1_1hana_1_1map.html">map</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a9a6635ea36edc582518d278238defa0d">operator=</a> (<a class="el" href="structboost_1_1hana_1_1map.html">map</a> &amp;&amp;other)</td></tr>
<tr class="memdesc:a9a6635ea36edc582518d278238defa0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Move-assign a map to another map <b>with the exact same type</b>. Only exists when all the elements of the map are move-assignable. <br /></td></tr>
<tr class="separator:a9a6635ea36edc582518d278238defa0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4881a1810986e678959af8ccb58f5666"><td class="memTemplParams" colspan="2"><a class="anchor" id="a4881a1810986e678959af8ccb58f5666"></a>
template&lt;typename Key &gt; </td></tr>
<tr class="memitem:a4881a1810986e678959af8ccb58f5666"><td class="memTemplItemLeft" align="right" valign="top">decltype(auto) constexpr&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="structboost_1_1hana_1_1map.html#a4881a1810986e678959af8ccb58f5666">operator[]</a> (Key &amp;&amp;key)</td></tr>
<tr class="memdesc:a4881a1810986e678959af8ccb58f5666"><td class="mdescLeft">&#160;</td><td class="mdescRight">Equivalent to <code><a class="el" href="group__group-Searchable.html#ga3c1826aee6c6eb577810bb99c5c3e53d" title="Returns the value associated to the given key in a structure, or fail.Given a key and a Searchable st...">hana::at_key</a></code> <br /></td></tr>
<tr class="separator:a4881a1810986e678959af8ccb58f5666"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Associated functions</h2>
<a class="anchor" id="a409d52de54cc7e55eca1a7b5dda4ce30"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<div class="memtemplate">
template&lt;&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt; <a class="el" href="structboost_1_1hana_1_1map__tag.html">map_tag</a> &gt;</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; ...pairs) {</div><div class="line">        <span class="keywordflow">return</span> map&lt;implementation_defined&gt;{forwarded(pairs)...};</div><div class="line">    }</div></div><!-- fragment -->
<p>Function object for creating a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code>. </p>
<p>Given zero or more <code>Product</code>s representing key/value associations, <code>make&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code> returns a <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code> associating these keys to these values.</p>
<p><code>make&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code> requires all the keys to be unique and to have different hashes. If you need to create a map with duplicate keys or with keys whose hashes might collide, use <code>hana::to_map</code> or insert <code>(key, value)</code> pairs to an empty map successively. However, be aware that doing so will be much more compile-time intensive than using <code>make&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code>, because the uniqueness of keys will have to be enforced.</p>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2make_8hpp.html">boost/hana/core/make.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">        ==</div><div class="line">        hana::make&lt;hana::map_tag&gt;(</div><div class="line">            hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="ae73cf43ee56352e4c25984b0fe3c3d04"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto make_map = <a class="el" href="group__group-core.html#ga1d92480f0af1029878e773dafa3e2f60">make</a>&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html">map_tag</a>&gt;</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Alias to <code>make&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code>; provided for convenience. </p>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="core_2make_8hpp.html">boost/hana/core/make.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">        ==</div><div class="line">        hana::make&lt;hana::map_tag&gt;(</div><div class="line">            hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a4feb32bd0a065a0732908716d4855b57"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto to_map = <a class="el" href="group__group-core.html#gadc70755c1d059139297814fb3bfeb91e">to</a>&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html">map_tag</a>&gt;</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Equivalent to <code>to&lt;<a class="el" href="structboost_1_1hana_1_1map__tag.html" title="Tag representing hana::maps. ">map_tag</a>&gt;</code>; provided for convenience. </p>

</div>
</div>
<a class="anchor" id="a0f32260f859b2510dd16235b7bc011ac"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto keys</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>) {</div><div class="line">        <span class="keywordflow">return</span> implementation_defined;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns a <code>Sequence</code> of the keys of the map, in unspecified order. </p>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="keys_8hpp.html">boost/hana/keys.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="permutations_8hpp.html">boost/hana/permutations.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">        hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">        hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">    );</div><div class="line"></div><div class="line">    <span class="comment">// The order of the keys is unspecified.</span></div><div class="line">    <a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(</div><div class="line">        <a class="code" href="group__group-Struct.html#gaf8c7199742581e6e66c8397def68e2d3">hana::keys</a>(m) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ <a class="code" href="group__group-Sequence.html#gac1e182ac088f1990edd739424d30ea07">hana::permutations</a>(hana::make_tuple(hana::int_c&lt;1&gt;, hana::type_c&lt;void&gt;))</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a2e016a68e3ec6eb25868fadb7ce80132"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto values</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>) -&gt; decltype(<span class="keyword">auto</span>) {</div><div class="line">        <span class="keywordflow">return</span> implementation_defined;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns a <code>Sequence</code> of the values of the map, in unspecified order. </p>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="contains_8hpp.html">boost/hana/contains.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="permutations_8hpp.html">boost/hana/permutations.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="tuple_8hpp.html">boost/hana/tuple.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">        hana::make_pair(hana::int_c&lt;1&gt;, <span class="stringliteral">&quot;foobar&quot;</span>s),</div><div class="line">        hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">    );</div><div class="line"></div><div class="line">    <span class="comment">// The order of the values is unspecified.</span></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::values(m) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">hana::in</a>^ <a class="code" href="group__group-Sequence.html#gac1e182ac088f1990edd739424d30ea07">hana::permutations</a>(hana::make_tuple(<span class="stringliteral">&quot;foobar&quot;</span>s, 1234))</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a5791e6dc0e27d8e3a113e4d94482550f"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto insert</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>, <span class="keyword">auto</span>&amp;&amp; pair) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Inserts a new key/value pair in a map. </p>
<p>Given a <code>(key, value)</code> pair, <code>insert</code> inserts this new pair into a map. If the map already contains this key, nothing is done and the map is returned as-is.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">map</td><td>The map in which to insert a <code>(key,value)</code> pair.</td></tr>
    <tr><td class="paramname">pair</td><td>An arbitrary <code>Product</code> representing a <code>(key, value)</code> pair to insert in the map. The <code>key</code> must be compile-time <code>Comparable</code>.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="insert_8hpp.html">boost/hana/insert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">        hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">        hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        <a class="code" href="group__group-Sequence.html#gae22a1a184b1b2dd550fa4fa619bed2e9">hana::insert</a>(m, hana::make_pair(hana::type_c&lt;float&gt;, <span class="charliteral">&#39;x&#39;</span>)) ==</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234),</div><div class="line">            hana::make_pair(hana::type_c&lt;float&gt;, <span class="charliteral">&#39;x&#39;</span>)</div><div class="line">        )</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(<a class="code" href="group__group-Sequence.html#gae22a1a184b1b2dd550fa4fa619bed2e9">hana::insert</a>(m, hana::make_pair(hana::type_c&lt;void&gt;, <span class="charliteral">&#39;x&#39;</span>)) == m);</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="af856f7bf77f69cdf1b8fd4e566eaef9b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto erase_key</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; <a class="code" href="structboost_1_1hana_1_1map.html#a1ee432be0bd10f08a637a437e311e4e2">map</a>, <span class="keyword">auto</span>&amp;&amp; key) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Removes a key/value pair from a map. </p>
<p>Returns a new <code><a class="el" href="structboost_1_1hana_1_1map.html" title="Basic associative container requiring unique, Comparable and Hashable keys. ">hana::map</a></code> containing all the elements of the original, except for the <code>(key, value)</code> pair whose <code>key</code> compares <code>equal</code> to the given key. If the map does not contain such an element, a new map equal to the original is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">map</td><td>The map in which to erase a <code>key</code>.</td></tr>
    <tr><td class="paramname">key</td><td>A key to remove from the map. It must be compile-time <code>Comparable</code>.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="erase__key_8hpp.html">boost/hana/erase_key.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="pair_8hpp.html">boost/hana/pair.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>std::literals;</div><div class="line"></div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <span class="keyword">auto</span> m = hana::make_map(</div><div class="line">        hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">        hana::make_pair(hana::type_c&lt;void&gt;, 1234),</div><div class="line">        hana::make_pair(BOOST_HANA_STRING(<span class="stringliteral">&quot;foobar!&quot;</span>), hana::type_c&lt;char&gt;)</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">        hana::erase_key(m, BOOST_HANA_STRING(<span class="stringliteral">&quot;foobar!&quot;</span>)) ==</div><div class="line">        hana::make_map(</div><div class="line">            hana::make_pair(hana::type_c&lt;int&gt;, <span class="stringliteral">&quot;abcd&quot;</span>s),</div><div class="line">            hana::make_pair(hana::type_c&lt;void&gt;, 1234)</div><div class="line">        )</div><div class="line">    );</div><div class="line"></div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(hana::erase_key(m, hana::type_c&lt;char&gt;) == m);</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="acd511f2c01f38405bfba0b6d5b2922e8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto union_</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; ys) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns the union of two maps. </p>
<p>Given two maps <code>xs</code> and <code>ys</code>, <code>hana::union_(xs, ys)</code> is a new map containing all the elements of <code>xs</code> and all the elements of <code>ys</code>, without duplicates. If both <code>xs</code> and <code>ys</code> contain an element with the same <code>key</code>, the one in <code>ys</code> is taken. Functionally, <code>hana::union_(xs, ys)</code> is equivalent to </p><div class="fragment"><div class="line"><a class="code" href="group__group-Foldable.html#ga38c6b3f6b1cbadb9b8432a05ff16b7d2">hana::fold_left</a>(xs, ys, <a class="code" href="group__group-Sequence.html#gae22a1a184b1b2dd550fa4fa619bed2e9">hana::insert</a>)</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">xs,ys</td><td>The two maps to compute the union of.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="integral__constant_8hpp.html">boost/hana/integral_constant.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="type_8hpp.html">boost/hana/type.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="union_8hpp.html">boost/hana/union.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m1 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key1&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key2&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m2 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key3&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key4&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key5&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::union_(m1, m2) == hana::make_map(</div><div class="line">       hana::make_pair(<span class="stringliteral">&quot;key1&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">       hana::make_pair(<span class="stringliteral">&quot;key2&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">       hana::make_pair(<span class="stringliteral">&quot;key3&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">       hana::make_pair(<span class="stringliteral">&quot;key4&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">       hana::make_pair(<span class="stringliteral">&quot;key5&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">));</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m3 = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;true&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m4 = hana::make_map(</div><div class="line">       hana::make_pair(hana::type_c&lt;char&gt;, hana::char_c&lt;&#39;c&#39;&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;false&gt;)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::union_(m3, m4) == hana::make_map(</div><div class="line">       hana::make_pair(hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;false&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;char&gt;, hana::char_c&lt;&#39;c&#39;&gt;)</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a3b3430482d4e88052e621f63a234f3eb"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto intersection</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; ys) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns the intersection of two maps. </p>
<p>Given two maps <code>xs</code> and <code>ys</code>, <code>intersection(xs, ys)</code> is a new map containing exactly those (key, value) pairs from xs, for which key is present in <code>ys</code>. In other words, the following holds for any object <code>pair(k, v)</code>: </p><div class="fragment"><div class="line">pair(k, v) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ <a class="code" href="structboost_1_1hana_1_1map.html#a3b3430482d4e88052e621f63a234f3eb">intersection</a>(xs, ys) if and only if (k, v) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ xs &amp;&amp; k ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ <a class="code" href="structboost_1_1hana_1_1map.html#a0f32260f859b2510dd16235b7bc011ac">keys</a>(ys)</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>This function is not commutative, i.e. <code>intersection(xs, ys)</code> is not necessarily the same as <code>intersection(ys, xs)</code>. Indeed, the set of keys in <code>intersection(xs, ys)</code> is always the same as the set of keys in <code>intersection(ys, xs)</code>, but the value associated to each key may be different. <code>intersection(xs, ys)</code> contains values present in <code>xs</code>, and <code>intersection(ys, xs)</code> contains values present in <code>ys</code>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">xs,ys</td><td>Two maps to intersect.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="intersection_8hpp.html">boost/hana/intersection.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m1 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key1&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key2&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m2 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key3&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key4&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key5&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::intersection(m1, m2) == hana::make_map());</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m3 = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;true&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;hana&quot;</span>_s),</div><div class="line">    hana::make_pair(hana::type_c&lt;float&gt;, hana::int_c&lt;100&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m4 = hana::make_map(</div><div class="line">       hana::make_pair(hana::type_c&lt;char&gt;, hana::char_c&lt;&#39;c&#39;&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;false&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;boost&quot;</span>_s)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::intersection(m3, m4) == hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;true&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;hana&quot;</span>_s)</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a718ddfe86437adbbca1e1a5db651d139"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto difference</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; ys) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns the difference of two maps. </p>
<p>Given two maps <code>xs</code> and <code>ys</code>, <code>difference(xs, ys)</code> is a new map containing exactly those (key, value) pairs from xs, for which key is not present in <code>keys(ys)</code>. In other words, the following holds for any object <code>pair(k, v)</code>: </p><div class="fragment"><div class="line">pair(k, v) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ <a class="code" href="structboost_1_1hana_1_1map.html#a718ddfe86437adbbca1e1a5db651d139">difference</a>(xs, ys) if and only if (k, v) ^<a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ xs &amp;&amp; k ^not <a class="code" href="group__group-Searchable.html#ga0d9456ceda38b6ca664998e79d7c45b7">in</a>^ <a class="code" href="structboost_1_1hana_1_1map.html#a0f32260f859b2510dd16235b7bc011ac">keys</a>(ys)</div></div><!-- fragment --><dl class="section note"><dt>Note</dt><dd>This function is not commutative, i.e. <code>difference(xs, ys)</code> is not necessarily the same as <code>difference(ys, xs)</code>. Indeed, consider the case where <code>xs</code> is empty and <code>ys</code> isn't. In that case, <code>difference(xs, ys)</code> is empty, but <code>difference(ys, xs)</code> is equal to <code>ys</code>. For symmetric version of this operation, see <code>symmetric_difference</code>.</dd></dl>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">xs,ys</td><td>Two maps to compute the difference of.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="equal_8hpp.html">boost/hana/equal.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="intersection_8hpp.html">boost/hana/intersection.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="string_8hpp.html">boost/hana/string.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;string&gt;</span></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"><span class="keyword">using namespace </span>hana::literals;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m1 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key1&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key2&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m2 = hana::make_map(</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key3&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key4&quot;</span>_s, hana::type_c&lt;std::string&gt;),</div><div class="line">    hana::make_pair(<span class="stringliteral">&quot;key5&quot;</span>_s, hana::type_c&lt;std::string&gt;)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::intersection(m1, m2) == hana::make_map());</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m3 = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, hana::int_c&lt;1&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;true&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;hana&quot;</span>_s),</div><div class="line">    hana::make_pair(hana::type_c&lt;float&gt;, hana::int_c&lt;100&gt;)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m4 = hana::make_map(</div><div class="line">       hana::make_pair(hana::type_c&lt;char&gt;, hana::char_c&lt;&#39;c&#39;&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;false&gt;),</div><div class="line">       hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;boost&quot;</span>_s)</div><div class="line">);</div><div class="line"></div><div class="line"><a class="code" href="group__group-assertions.html#ga4bf9e0c46c44e21fbe5c5fbb3ace8356">BOOST_HANA_CONSTANT_CHECK</a>(hana::intersection(m3, m4) == hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::bool_c&lt;true&gt;),</div><div class="line">    hana::make_pair(hana::type_c&lt;std::string&gt;, <span class="stringliteral">&quot;hana&quot;</span>_s)</div><div class="line">));</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() { }</div></div><!-- fragment --> 
</div>
</div>
<a class="anchor" id="a8bcb2455eb9f7074185d8fb61a99801e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename... Pairs&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">constexpr auto symmetric_difference</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<b>Initial value:</b><div class="fragment"><div class="line">= [](<span class="keyword">auto</span>&amp;&amp; xs, <span class="keyword">auto</span>&amp;&amp; ys) {</div><div class="line">        <span class="keywordflow">return</span> tag-dispatched;</div><div class="line">    }</div></div><!-- fragment -->
<p>Returns the symmetric set-theoretic difference of two maps. </p>
<p>Given two sets <code>xs</code> and <code>ys</code>, <code>symmetric_difference(xs, ys)</code> is a new map containing all the elements of <code>xs</code> whose keys are not contained in <code>keys(ys)</code>, and all the elements of <code>ys</code> whose keys are not contained in <code>keys(xs)</code>. The symmetric difference of two maps satisfies the following: </p><div class="fragment"><div class="line"><a class="code" href="structboost_1_1hana_1_1map.html#a8bcb2455eb9f7074185d8fb61a99801e">symmetric_difference</a>(xs, ys) == <a class="code" href="structboost_1_1hana_1_1map.html#acd511f2c01f38405bfba0b6d5b2922e8">union_</a>(<a class="code" href="structboost_1_1hana_1_1map.html#a718ddfe86437adbbca1e1a5db651d139">difference</a>(xs, ys), <a class="code" href="structboost_1_1hana_1_1map.html#a718ddfe86437adbbca1e1a5db651d139">difference</a>(ys, xs))</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">xs,ys</td><td>Two maps to compute the symmetric difference of.</td></tr>
  </table>
  </dd>
</dl>
<h2>Example </h2>
<div class="fragment"><div class="line"><span class="comment">// Copyright Louis Dionne 2013-2017</span></div><div class="line"><span class="comment">// Distributed under the Boost Software License, Version 1.0.</span></div><div class="line"><span class="comment">// (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)</span></div><div class="line"></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="assert_8hpp.html">boost/hana/assert.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="map_8hpp.html">boost/hana/map.hpp</a>&gt;</span></div><div class="line"><span class="preprocessor">#include &lt;<a class="code" href="symmetric__difference_8hpp.html">boost/hana/symmetric_difference.hpp</a>&gt;</span></div><div class="line"></div><div class="line"><span class="keyword">namespace </span>hana = <a class="code" href="namespaceboost_1_1hana.html">boost::hana</a>;</div><div class="line"></div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m1 = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, 1),</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::true_c)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> m2 = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;float&gt;, 1.0),</div><div class="line">    hana::make_pair(hana::type_c&lt;long long&gt;, 2LL),</div><div class="line">    hana::make_pair(hana::type_c&lt;int&gt;, 3)</div><div class="line">);</div><div class="line"></div><div class="line">constexpr <span class="keyword">auto</span> result_m = hana::make_map(</div><div class="line">    hana::make_pair(hana::type_c&lt;bool&gt;, hana::true_c),</div><div class="line">    hana::make_pair(hana::type_c&lt;float&gt;, 1.0),</div><div class="line">    hana::make_pair(hana::type_c&lt;long long&gt;, 2LL)</div><div class="line">);</div><div class="line"></div><div class="line"><span class="keywordtype">int</span> main() {</div><div class="line">    <a class="code" href="group__group-assertions.html#ga29b2b21ffa5513e5b706c50ffee980af">BOOST_HANA_RUNTIME_CHECK</a>(</div><div class="line">            hana::symmetric_difference(m1, m2) == result_m</div><div class="line">    );</div><div class="line">}</div></div><!-- fragment --> 
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!--
Copyright Louis Dionne 2013-2017
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
-->
<!-- boost-no-inspect -->
<!-- HTML footer for doxygen 1.8.9.1-->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><b>boost</b></li><li class="navelem"><a class="el" href="namespaceboost_1_1hana.html">hana</a></li><li class="navelem"><a class="el" href="structboost_1_1hana_1_1map.html">map</a></li>
  </ul>
</div>
</body>
</html>