Is there a way to define(adapt) a struct for Hana that has template parameters?
The canonical example is a non-template class,
#include <boost/hana/define_struct.hpp>
#include <string>
namespace hana = boost::hana;
struct Person {
BOOST_HANA_DEFINE_STRUCT(Person,
(std::string, name),
(int, age)
);
};
We I try to add template parameters there is a compilation error:
template<class S = std::string, class I = int>
struct Person {
BOOST_HANA_DEFINE_STRUCT(Person<S, I>,
(S, name),
(I, age)
);
};
I though that this failed because of the use of commas, so I tried decltype(Person<S, I>)
in place of Person<S,I>
.
In Boost.Fusion we had BOOST_FUSION_DEFINE_TPL_STRUCT, but I can't find the equivalent in Hana.
How can I define a Hana Struct with template parameters?