Merging multiple maps
<p>I've already asked this on the boost mailinglist but I wasn't that clear about my intentions it seemed. It could also be me not completely understanding how I can accomplish this.</p>

<p>I want to merge multiple maps in hana, see the following code example:</p>

<pre><code>constexpr auto m1 = hana::make_map(
    hana::make_pair("key1"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key2"_s, hana::type_c&lt;std::string&gt;)
);

constexpr auto m2 = hana::make_map(
    hana::make_pair("key3"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key4"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key5"_s, hana::type_c&lt;std::string&gt;)
);

constexpr auto m3 = hana::make_map(
    hana::make_pair("key6"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key7"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key8"_s, hana::type_c&lt;std::string&gt;)
);
</code></pre>

<p>I already got an answer how to do this for two maps:</p>

<pre><code>constexpr auto result = hana::fold_left(m1, m2, hana::insert);
constexpr auto expected = hana::make_map(
    hana::make_pair("key1"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key2"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key3"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key4"_s, hana::type_c&lt;std::string&gt;),
    hana::make_pair("key5"_s, hana::type_c&lt;std::string&gt;)
);
</code></pre>

<p>When I checked the documentation, I can see that fold_left takes 2 or 3 arguments.</p>

<p>It looks like I need something like:
fold_left(fold_left(m1, m3, hana::insert), m2, hana::insert);</p>

<pre><code>template&lt;typename Map...&gt;
constexpr auto merge_multiple_maps(Map... args) {
  // do something useful here...
}
</code></pre>

<p>But I'm not sure how to proceed from here and I still haven't that much experience in meta programming...</p>

<p>Regards, Matthijs</p>