So I've built my boost::mpl::map
object which contains some mixture of keys and types. I now want to instantiate an instance of the map such that I have an instantiation of each type
in the map:
using namespace boost::mpl;
using MyMap = map<
pair<int, double>,
pair<double, double>,
pair<bool, int>>;
int main()
{
// create the map:
MyMap myMap;
// now I want a reference to the element indexed by "int"
using RefType = at<MyMap, int>::type&;
RefType myRef(myMap); // compile error!
}
The error I'm getting is something along the lines of:
error: cannot convert 'MyMap {aka map<...>} to blarghh {aka int}
Clearly I should be getting some sort of "index" value (maybe boost::mpl::map::order
?). So how does one actually access (ie get references to) elements in these associative mpl
containers? Also, where is the documentation for how this (sepcifically) is done?