I'm using a hana map (created using hana::make_map). I have a very simple class that would inherit from the hana map, and expose a second map as such
auto values = hana::make_map( ... );
auto uncertainties = hana::make_map( ... );
template< typename Values, typename Uncertainty >
struct map: Values{
Uncertainty uncertainty;
constexpr map(Values v, Uncertainty u ):
Values( v ),
uncertainty( u )
{ }
};
auto data = map( values, uncertainties );
// I want to do the following
auto hbar = data[ hbar ]; // Type hbar defined elsewhere
auto hbar_u = data.uncertainty[ hbar ]
This used to work. I recently updated our version of boost hana and now I get the following compiler error:
map.hpp:2:13: error: base
'map_impl' is marked 'final'
struct map: Values{
^
If I understand this message correctly, boost hana has explicitly been marked so that I can no longer inherit.
What I really want to do is use the operator[] to access the values map and use .uncertainty to access the uncertainties map. How do I do this?
I really don't want to have to use any other boost library; hana is more than enough for my project.