I'm facing a situation where I usually would create a custom class by inheriting from boost::hana::tuple. For example, by using the following code,
template<typename ... args>
struct my_nonworking_custom_tuple_t : public boost::hana::tuple<args ...> //not working!!!
{
using base = boost::hana::tuple<args ...>;
//... all other stuff
auto my_getter() const { return base::operator[](1_c); }
};
This, however, doesn't work as boost::hana::tuple is implemented as final.
Thus it seems I'm forced to use composition,
template<typename ... args>
struct my_custom_tuple_t
{
//... all other stuff
boost::hana::tuple<args ...> tup;
auto my_getter() const { return tup[1_c]; }
};
However, as soon as I do that, the resulting class does not model the Hana concept "Sequence" anymore, so that I can't apply all the convenient Hana methods.
What do I need to do to turn my_custom_tuple_t into a Hana Sequence?