In the good old days we used to adapt a struct
into a Boost.Fusion container or an associative container with
#include <boost/fusion/adapted/struct/adapt_struct.hpp>
#include <boost/fusion/adapted/struct/adapt_assoc_struct.hpp>
struct Person{
std::string name;
int age;
};
BOOST_FUSION_ADAPT_STRUCT(
Person,
(std::string, name)
(int, age)
);
struct tag_name;
struct tag_age;
BOOST_FUSION_ADAPT_ASSOC_STRUCT(
Person,
(std::string, name, tag_name)
(int, age, tag_age));
int main(){}
Now with Boost.Hana we can also adapt
#include <boost/hana/adapt_struct.hpp>
BOOST_HANA_ADAPT_STRUCT(Person,
name,
age
);
The question: Is there a sort of BOOST_HANA_ADAPT_ASSOC_STRUCT
(equivalent to BOOST_FUSION_ADAPT_ASSOC_STRUCT
) in Boost.Hana? Or is this done differently now?
Bonus question: Is there a BOOST_HANA_ADAPT_TPL
?