在过去的美好时光里,我们曾经将 a 适配struct
到 Boost.Fusion 容器或关联容器中
#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(){}
现在有了 Boost.Hana,我们也可以适应
#include <boost/hana/adapt_struct.hpp>
BOOST_HANA_ADAPT_STRUCT(Person,
name,
age
);
问题: Boost.Hana中是否有某种BOOST_HANA_ADAPT_ASSOC_STRUCT
(相当于)?BOOST_FUSION_ADAPT_ASSOC_STRUCT
还是现在做的不同?
奖金问题:有BOOST_HANA_ADAPT_TPL
吗?