Hi,
I am looking into the documentation of hana to merge two or more maps, say:
#include
namespace hana = boost::hana;
int main(int argc, char **argv) {
constexpr auto m1 = hana::make_map(
hana::make_pair("key1"_s, hana::type_cstd::string),
hana::make_pair("key2"_s, hana::type_cstd::string)
);
constexpr auto m2 = hana::make_map(
hana::make_pair("key3"_s, hana::type_cstd::string),
hana::make_pair("key4"_s, hana::type_cstd::string),
hana::make_pair("key5"_s, hana::type_cstd::string)
);
// Merge two or more maps?
constexpr auto result = m1 + m2;
return 0;
}
I'm not sure how to do this, probably taking the first map and for every
pair in the subsequent map return an insert? In pseudo code:
constexpr result = hana::insert(hana::insert(m1, pair1), pair2);
Can someone give me some pointers in the right direction?
Regards, Matthijs