how do I check if a struct has BOOST_HANA_ADAPT_STRUCT in a template?

185 Views Asked by At

I have a template which should only apply for a type that is defined with BOOST_HANA_DEFINE_STRUCT or has adapt by BOOST_HANA_ADAPT_STRUCT. Something like following:

template <typename T>
std::enable_if_t<is_hana_struct<T>::value, void>
myfunc(T x)
{
}

How do I implement the is_hana_struct?

1

There are 1 best solutions below

0
Louis Dionne On BEST ANSWER

I think you're looking for hana::Struct<T>::value: http://boostorg.github.io/hana/group__group-_struct.html